0

I am building an app, where i have loaded a PDF of 300 pages. This PDF has lot of content, which are added as keywords to the tableViewCell in another VC.

When i tap any cell from VC, it should navigate to the next VC, where i have a UIWebView which has the PDF.

Now the ask is, when i press this cell, the new VC directly should navigate to the given page where the information related to that keyword is present.

Any idea or points on how to show a given page in PDF will help.

Thanks.

EKN
  • 1,886
  • 1
  • 16
  • 29
  • @Wukerplank: I need to have some code. The link which you have shared does not have any. Is there any existing API? –  Jun 27 '17 at 09:26
  • You didn't actually provide any code yourself. Anyway, I meant to close your question as a duplicate of this one: https://stackoverflow.com/questions/19231508/how-to-control-page-display-to-pdf-loaded-in-uiwebview-for-ios-go-to-page – Wukerplank Jun 27 '17 at 11:23

2 Answers2

0

Because you're dealing with web, it is hard to have native navigation. I know from web development experience that to navigate to a specific part of a website, you can use anchor points/tags. I'd recommend looking into those. With them, you can change the URL from somepagehere.com to somepagehere.com/#page-1 or somepagepagehere.com/#-2, etc. Then, with the the UITableView you can point directly to these anchor points.

Let me know if this helps!

Theo Strauss
  • 1,281
  • 3
  • 19
  • 32
0

From your questions, it seems like you have a 300 page PDF file from an online location and you gather all the menu in your table view and each cell has the same url pointing to the link of the PDF.

This is not a good practice on the first place. This means that you are reloading the PDF file again and again when user simply want to see contents from another menu. It's also extremely hard to deal with paging problem from a web view.

Instead, if your pdf is well formatted(meaning it has a menu page and when you click on them from Adobe PDF reader, it can jump to the page), simply use this PDF reader. It also provides you the menu by itself and you don't need to have a table view controller and a webview controller. Moreover, you just need to put PDF file in your main bundle and never need to download every time.

Fangming
  • 24,551
  • 6
  • 100
  • 90