Rolf
Posts: 0
Joined: Sun Feb 23, 2014 9:03 pm

Open a local PDF in iOS and Android

Hi there,
been looking through the forum, but couldn't find any clear answer....

I have some PDFs to include in my app. Uploaded them to Webresources/views/assets/images and so far so good.
As they are really needed offline, linking to a website wouldn't do the job.

Basically, I'd like to include a link so the user can click on the link (or an image as a link) and the PDF will open in an application (eg webbrowser) on the device of this users. Comparable with clicking on an attachment in an email, or with 'open in new window' in a web browser.

How do I do this?
I've read about InAppBrowser as an option, how do I get this to work with such a file?

Rolf
Posts: 0
Joined: Sun Feb 23, 2014 9:03 pm

Open a local PDF in iOS and Android

BTW,
I've tried to use 'navigate to link' with 'open in new window' checked..... works to open the file, but after pressing 'done' I get a completely blank screen ;-(

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Open a local PDF in iOS and Android

Hello! Try this way prewindow.open(encodeURI('full/path/to/file.pdf'), '_system');/pre

Rolf
Posts: 0
Joined: Sun Feb 23, 2014 9:03 pm

Open a local PDF in iOS and Android

Sorry, that doesn't work (tried that).
I get only a completely white page and in contrast with 'navigate to link' even the PDF doesn't open.....
Testing in iOS7 on the device and in online tester (there the pdf opens in new tab, but the white screen remains)....

What am I missing?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Open a local PDF in iOS and Android

Could you clarify what file path you use in code?

Rolf
Posts: 0
Joined: Sun Feb 23, 2014 9:03 pm

Open a local PDF in iOS and Android

files/views/assets/image/testpdf.pdf

This path did work in the 'navigate to link' tool (but that also had a problem, as the return screen was completely blank)

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

Open a local PDF in iOS and Android

Hello,

It works fine for me. Please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a
and specify app's name. We'll check it.

Rolf
Posts: 0
Joined: Sun Feb 23, 2014 9:03 pm

Open a local PDF in iOS and Android

Hi Nikita,
I've shared the app (AIDapp) with you.
The link is now on the 'info' page.

Thanx!

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Open a local PDF in iOS and Android

Hello Rolf, please tell steps to test the issue within app (page name) and on Preview.

Rolf
Posts: 0
Joined: Sun Feb 23, 2014 9:03 pm

Open a local PDF in iOS and Android

Hi Appery-staff,
sorry for the late reply, seems my initial reply was not published here....

The link (to a test-PDF included in the app) can be found on the page you end up on when you click 'Information' from the home menu.

When you first launch the app, you should select a language (Dutch or English, I'd advise English ;-), you don't need to login etc.

Return to “Issues”