andi
Posts: 0
Joined: Sat May 25, 2013 9:32 am

Navigate to link (pdf)

I just tried to open a pdf - which should be as nicly as possible

When i use the "navigate to link" - a new page is opened, but it is empty
On the PCwebbrowser it works fine, but on the android device it didn't work

when i insert a it looks not nice (open chrome - download the file - has to open the file manually .... )

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

Navigate to link (pdf)

Hello! The problem is that in Android/iOS browser doesn't have built-in PDF viewer. You can use https://docs.google.com/viewer to view PDF file. Here is code example:

codevar cb, url = "https://docs.google.com/viewer?url=http://www.site.com/full/url/file.pdf&quot
if(window.plugins) {
cb = window.plugins.childBrowser;
}
if (cb != null) {
cb.showWebPage(url);
}
else {
window.open(url);
};/code

Bikram Ray
Posts: 0
Joined: Wed May 22, 2013 5:52 pm

Navigate to link (pdf)

Thanks for the code snippet. I was rendering pdf from Microsoft Azure CDN services and worked perfect. It is great to have scenario based code snippet.

Return to “Issues”