Hyperlinks to PDFs in Android in-app browser

Keith_Gilbert

17-01-2017

I have InDesign and HTML articles that contain a link to a PDF on a web server. When the link is tapped on an iOS device or the Web viewer, the PDF displays fine. But on Android devices the in-app browser is launched, but nothing displays. Setting the link to open in the device browser works fine on both iOS and Android. Is this a limitation of the Android in-app browser? Is there a workaround? I'd rather not use the device browser.

Accepted Solutions (0)

Answers (13)

Answers (13)

RG21

31-03-2017

I am definitely not an expert but I was having the same problem and I simply switched  the link from opening in the cordova inapp browser to a window open link.

Make sure you have a pdf reader on your device for this to work.

Here's my link now:

<a href="#" onclick="window.open('http://www.grace.to/newsletters/gn.pdf', '_system', 'location=no');    return false;"><img src="images/newsletter-tn.png" alt="Grace Notes" title="newsletter"> <h3>Grace Notes</h3><p>Read our newsletter</p></a>

Hope this helps.

TK_ITA

13-02-2017

Hi Kirk, when i make the button in the Adobe Experince manager i put this link WSK Official Site - World Global System​ inside the button. You wanted to know this?

So when i click with my Samsung on a result pdf does not load....

Many thanks

adobekirk

Employee

10-02-2017

Hi TK_ITA,

I was able to download the app and get into the RESULTS section from within the in-app browser. However, all of the results were in HTML. They all successfully opened up within the in-app Webview. Can you share with me the exact URL that is linked from within the app? Feel free to send it privately if it is sensitive.


Thanks,Kirk

adobekirk

Employee

10-02-2017

Hi Keith,

Thank you for the URLs. You provided both an HTTP URL that redirected to an HTTPS URL, as well as an independent HTTPS URL. The HTTP URL responds with a 301 that redirects to an HTTPS URL. Both HTTPS URLs return 503s (meaning they are unavailable). Can you let me know when your HTTPS web server is working again or send me different URLs? I'm testing via curl:

> curl -I [HTTPS_URL]

HTTP/1.1 503 Service Unavailable

> curl -I [HTTP_URL]

HTTP/1.1 301 Moved Permanently

Location: [DIFFERENT_HTTPS_URL]

> curl -I [DIFFERENT_HTTPS_URL]

HTTP/1.1 503 Service Unavailable

Thanks,

Kirk

TK_ITA

06-02-2017

Kirk can you help also me please?

i wrote you the instruction to move in our app so you can test the problem. Or i should open an other post?

WSK Promotion sull'App Store

You should click on WSK  (red button on the left top) than su VIEW FULL EVENT SCHEDULE, than on the first MORE, than on RESULTS, than on RESULTS (below the circuit, you are inside a website), than if you click you can't open the PDF with android.

Many Thanks

adobekirk

Employee

03-02-2017

Hi Keith,

Can you verify that you've specifically been able to reproduce the https issue with Acrobat Reader (and not another PDF reader)? It is the burden of the PDF reader to handle the https intent and not all PDF readers handle https intents.

Also, can you include the URL of the PDF which you're testing? [Feel free to scramble the domain and/or some of the letters - I'm interested in the overall structure and placement of non-alpha characters.]

Thanks,

Kirk

TK_ITA

03-02-2017

The same in our App. If i link directly to PDF it does work, but if i link to a website and than i try to open PDF it doesn't work.

We need solutions please!

Keith_Gilbert

02-02-2017

Kirk, based on the info you provided, I did some more testing. It turns out that links to public PDFs on a Web server from an HTML article do work fine in an Android app, and if Acrobat Reader or other PDF renderer is installed on the Device, the reader is launched and the PDF is displayed. But, this doesn't work if the URL for the PDF is an HTTPS url. And, to further complicate matters, some of the non-secure HTTP URLs for some of our PDFs automatically redirect to HTTPS, which also keeps the PDFs from displaying on Android. Both of these situations are handled properly in the iOS in-app browser.

TK_ITA

02-02-2017

Hi Kirk, we have that problem inside our app WSK PROMOTION. I use Adobe Experience Manager, but when in Android i click on pdf doesn't work it doesn't open pdf with operating system.

So if you can help me here our app:

WSK Promotion sull'App Store

You should click on WSK  (red button on the left top) than su VIEW FULL EVENT SCHEDULE, than on the first MORE, than on RESULTS, than on RESULTS (below the circuit, you are inside a website), than if you click you can't open the PDF with android.

Do you have any solution?

Sorry for my english.

Thanks

adobekirk

Employee

30-01-2017

Hi Keith,

Android does not ship with a default PDF reading experience, so Android users view PDFs through third party apps like Adobe Reader. This is different than iOS, which includes PDF rendering within the browser.

At the time of this writing, AEM Mobile does not support the rendering of arbitrary PDFs in the in-app web browser (or anywhere outside of articles), so the customer leaves the app to view a PDF delivered directly from an HTTP endpoint.

If there is a PDF renderer app like Adobe Reader on the device on which you are testing, then linked PDF files from AEM Mobile should render in that app. Specifically, AEM Mobile recognizes that the URL in question is a PDF, and then hands the URL to the operating system, and the operating system opens it in the appropriate app.

One possible workaround to keep the user in the app would be to upload the PDF separately as a published, but orphaned, article and then link to that orphaned PDF article using a navto. Of course, that has other tradeoffs like any updates to the PDF would require re-publishing the article.

To understand more about exactly where the problem is, can you post some more details (to me privately if you're not comfortable posting them publicly):

* What is the URL in question (you can leave out the domain name - I'm more interested in the path and the file extension, if any)?

* What happens if you link to a non-remote PDF, for example one in shared content?

* Can you confirm that the behavior is the exact same whether the link is a hyperlink overlay within a fixed layout file from InDesign or a hyperlink in an HTML article?

Thanks,
Kirk