Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC:

how to display specified view from Custom URI Scheme? 5 years 11 months ago #13830

  • defcon8808
  • defcon8808's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
I using storyboard.

two navigation controller in main storyboard.

1. one navigation controller is main view to touch button from directly execute app.
-> no problem.

2. The other navigation controller is specified view from custom uri scheme.
-> problem. not display viewer.
below log
:
2018-05-21 16:20:28.735407+0900 plotnewpe[1598:55115] Starting synchronous request to www.npssystem.com/files/List_1.pdf with byte range: 376832-385799
2018-05-21 16:20:28.754800+0900 plotnewpe[1598:55115] START Download blocks: 47 to 48
2018-05-21 16:20:28.754934+0900 plotnewpe[1598:55115] START Download blocks: 46 to 47
2018-05-21 16:20:28.759897+0900 plotnewpe[1598:55115] START Download blocks: 46 to 48
2018-05-21 16:20:28.760099+0900 plotnewpe[1598:55115] 7346621f5821e87a2d3ebb0f7b3d06f5
2018-05-21 16:20:28.760229+0900 plotnewpe[1598:55115] PDFView rect :0.000000 0.000000 375.000000 667.000000
2018-05-21 16:20:28.760604+0900 plotnewpe[1598:55115] 1

below code(using common code of section 1,2)
:
let urlPath: String = "www.npssystem.com/files/List_1.pdf"
let plugin: RadaeePDFPlugin = self.pluginInit()
plugin.setDelegate(self);

//OPEN method

//Create Reader instance from Bundle (readonly)
//let reader = plugin.open(fromAssets: "test.pdf", withPassword: "")

//Create Reader instance from custom path
let reader = plugin.show(urlPath, atPage: 1, withPassword: "", readOnly: true, autoSave: false);

if (reader != nil) {
let vc: UIViewController = reader as! UIViewController

//Title bar inherits the Navigation barTintColor
self.navigationController?.navigationBar.barTintColor = UIColor.black
self.navigationController?.navigationBar.isTranslucent = false;

//Icons inherit the Navigation tintColor
self.navigationController?.navigationBar.tintColor = UIColor.orange

self.navigationController?.pushViewController(vc, animated: false)

Please Log in or Create an account to join the conversation.

how to display specified view from Custom URI Scheme? 5 years 11 months ago #13833

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,

we tried to open your pdf file from your url using: "www.npssystem.com/files/List_1.pdf" (we added "http://") and it seems to work with demo project.
We used this code line:
let reader = plugin.show("http://www.npssystem.com/files/List_1.pdf", withPassword: "")
Please be sure to use the correct url and set the App Transport Security Settings into info.plist file.

Please Log in or Create an account to join the conversation.

how to display specified view from Custom URI Scheme? 5 years 10 months ago #13946

  • defcon8808
  • defcon8808's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0


check this video.

i don't know why it doesn't open...

I checked below

1. correct url - checked
2. set the ATS Settings - checked

Please Log in or Create an account to join the conversation.

how to display specified view from Custom URI Scheme? 5 years 10 months ago #13948

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,

please double check if the url used to open the pdf file from custom url scheme is correct.
I've made some test with my custom url scheme "radaee://", and these are the results:
I noticed that if I use something like "radaee://http://my_destination_url/my_pdf.pdf", I have to remove radaee://.
This is not enough, cause I noticed that with the url above, ":" char is removed from "http://" string.
I suggest to set your custom url in this way:
"radaee://my_destination_url/my_pdf.pdf"
than replace your custom url scheme with http or https before your openURL method.
With the result string I'm able to open the pdf using ShowReader method.
The following user(s) said Thank You: defcon8808

Please Log in or Create an account to join the conversation.

how to display specified view from Custom URI Scheme? 5 years 9 months ago #14036

  • defcon8808
  • defcon8808's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
Thank you. I resolved it. my mistake.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum