Expand my Community achievements bar.

SOLVED

Hyperlinks to PDFs in Android in-app browser

Avatar

Level 4

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.

1 Accepted Solution

Avatar

Correct answer by
Level 1

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.

View solution in original post

15 Replies

Avatar

Level 2

Someone can answer to that question??!! I have the same problem!!

@Keith_Gilbert have you found the solution?Keith_Gilbert

Thanksssss

Avatar

Employee

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

Avatar

Level 2

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

Avatar

Level 4

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.

Avatar

Level 2

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!

Avatar

Employee

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

Avatar

Level 2

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

Avatar

Level 4

Kirk, yes I'm indeed using the latest version of Adobe Reader for Android.

Avatar

Level 4

I sent you a couple of example URLs directly.

Avatar

Employee

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

Avatar

Employee

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

Avatar

Level 2

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

Avatar

Correct answer by
Level 1

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.

Avatar

Level 1
Level 1

I do not understand that I cannot just simply copy a link on a android tablets adope app. This is my way around it. You can share it so thats what I do I share to e mail in the a mail it comes up as a link and from there I can click on the link and copy so now I can paste it anywhere. But there should be no need for this long unnecessary trick. By share it should be an COPY LINK. Here is my link 

https://documentcloud.adobe.com/link/review?uri=urn:aaid:scds:US:d4e8b503-0d3c-4d48-afa3-2bc7c4d484f...

You have long press it