Bookmarking an embedded pdf on iPad - ipad

I have a web page with an embedded pdf file. I can bookmark pages in the pdf using the query string and passing those values to the source tag.
While this works well on a desktop browser, I can't seem to get bookmarks to work in an iPad. Two finger scrolling works, but not the bookmarks.
Anyone have any ideas?

Related

Partial display of pdf in iframe of iOS browser

We have a main page in which we are having pdf links. On click of these links the page will redirect to another page which contains iframe. The pdf document will be displayed in that iframe. This scenario is working in other OS other than IOS. In IOS the iframe is showing only the pdf part of screen size. It is not providing scroll bar as well for us to scroll down. We tried changing css Overflow: scroll but did not work.
If you are using iOS 8, there is a bug with displaying PDFs in iframes that basically truncates the PDF file to display only the first page like an image would display. Apple has yet to come out with a fix for this (4+ major releases into iOS 8). This affected an application used by my salesforce in the filed on their tablets/phones so I have to create a work-around. Until Apple fixes their issue this is working for us.
Interim solution: Use Google Docs Viewer as pass through for documents
Little know feature of google docs is the ability to pass through a URL to a PDF. Works like a charm in iOS 8.
//url of your PDF hosted wherever you currently keep it
var pdfurl = 'http://www.manning.com/crowther/HH5aCSS3_SampleCh-01.pdf';
//wrap the url with the google docs gview url
pdfurl = 'http://docs.google.com/gview?url=' + pdfurl + '&embedded=true';
Maybe this workaround can help you too.
JSFiddle Demo

Open specific page of a pdf in iFrame on iPad

I am trying to open a specific page of a pdf (for example, http://cb.vu/unixtoolbox.pdf#page=14) inside an iFrame. While it works on desktop browsers, it is not working on an iPad.
Also noticing that, this does not work on the iPad even without the iFrame if I want to go the page 14 by typing http://cb.vu/unixtoolbox.pdf#page=14 directly in the address bar of mobile safari.
Has any of you came across this problem? If so, how did you solve it?
Thanks a lot for any help!

html5/css3, Asp.net MVC3 - View pdf in an html page on mobile safari

My upcoming mobile web project requires viewing dynamically chosen pdf files inside the webpage. I am using iFrame to display the pdf file and the file can be scrolled using two-finger scrolling. But the problems I am facing are:
The first page of the file is not displayed completely on the iPad and gets cut off along the width unlike when I view it on the desktop browsers where the first page of the pdf is always entirely displayed although zoomed out to fit in the iFrame area.
There is no visual indication for the users that the pdf document can be scrolled, i.e., there is no scroll bar on the pdf document.
The controls (page navigation, zoom etc.) for the pdf viewer (Adobe reader) don't appear on the document unlike when I see it on the desktop browsers.
What is the best way to achieve what I am trying to do? Do any of you experts know any solutions/workarounds to the problems I am facing? An entirely different approach using anything other than iFrame can also be considered.
The reason why the pdf should be inside the html page is that, the list of pdf files will be on a menu bar on the left side of the page and the user can click on any of them to view on the same page. Ideally, they will have the capability to toggle between full screen view and that view.
Any help is appreciated.
I created a tiny JavaScript module that helps you to show a PDF inline and be able to scroll it. But I also couldn't figure out a way to make it fit the total width of the parent container.
Check it out: https://github.com/williamrjribeiro/ipdf-scroll
Cheers.
I came across this Recommended way to embed PDF in HTML? while researching on the web to find an answer.
The mentioned link discusses about some options that I can use and the google document viewer works for me though don't know if there is anything (like data limit) I need to be aware of before using it on the website. Also I have no idea if it is a good solution (though the full screen mode is not available, but zoom-in/zoom-out and next/prev page buttons are there are show up in the mobile safari on the iPad) to use for an web app that will be run on the iPad.
Anyway, I will keep researching for a better solution and if i don't find any, I'll stick to the google document viewer.
The issue appears to be a bug with Safari on the IPad.
I didn't find a solution for embedding the pdf in html but I did find this:
If you return FileStreamResult from your controller action instead of a view, the pdf will open in a new tab, it's not embedded html but at least your user is not having to download files and open them manually.
I had the same problem of the pdf not being displayed completely. The only thing I found to fix this was the change the size of the div containing the pdf.
For example if the element containing the pdf is a div then I change its width to any value and the rollback to the value it had before. Changing Width or height any one works.
Sometimes I had to wait a little using a setTimeout before calling my resizable method

CGPDFDocument and voiceover

I have a PDF rendering app that loads PDF content from a URL (CGPDFDocumentCreateWithURL). The PDF loads fine, and I can display on screen no problem. These PDF also contain text for searching. I'm trying to make this comtent visible to the VoiceOver API. I've never worked with this frameowrk before.
Anyone have any hints or links that can help me get started?
If you have access to the text from the particular PDF page, you can set the accessibilityValue of the view you are using to display the page to the text value. This will then read the contents out.
If for some reason your PDF view is not accessible to voiceover, you can use an overlay view, and update its accessibility value as you change pages.

ios - UIWebView Bookmark Bug with pdfs

I have some code that generates a pdf from text files, and adds bookmarks to various locations within said pdf using UIGraphicsAddPDFContextDestinationAtPoint and UIGraphicsSetPDFContextDestinationForRect. The UIWebView appears to be bugged, where clicking certain bookmarks temporarily renders other bookmarks to send the view to the top of the document. I say "temporarily" because clicking on an unaffected bookmark seems to reset all bookmarks so they point where they are supposed to.
This doesn't appear to be a coding problem, as it only occurs in UIWebView. When I open the pdf in iBooks, the links always work fine. However I would prefer to view the pdf in app, and the only other ways to do it that I'm aware of (UIImageView & UISliderView) would probably eliminate the bookmarks altogether. So I'm hoping there could be a way to fix UIWebView so this problem no longer occurs.
Any suggestions?

Resources