1

I am working in phonegap for windows phone 8 app. Currently I am stuck with opening a pdf file from LOCAL AREA (like in phone >> documents >> myfolder>>1.pdf)

I tried in js

document.addEventListener("deviceready", deviceready, false);

function deviceready() {
   window.open('.documents/myfolder/1.pdf', '_blank', 'location=no');
}

but it doesn't work.

I also tried

window.open('**documents**/myfolder/1.pdf', '_blank', 'location=no');

and

window.open('**/documents**/myfolder/1.pdf', '_blank', 'location=no');

but neither works.

Otherwise, if there is a PDF viewer plugin for phonegap and WP8, please share the link.

Note: I have adobe pdf reader installed on the phone

Hobo
  • 7,536
  • 5
  • 40
  • 50
Venkat
  • 11
  • 1
  • 4

1 Answers1

1

Try any of the following that works for you.

window.open('http://www.example.com/test.pdf', '_system', 'location=yes');

window.open('http://www.example.com/test.pdf', '_blank', 'location=no,closebuttoncaption=Close,enableViewportScale=yes'); 

Check this Google PDF viewer

window.open('https://docs.google.com/viewer?url=http://www.example.com/test.pdf&embedded=true', '_blank', 'location=yes'); 

  Read this , this and this. Hope it will help you.         

Community
  • 1
  • 1
AAhad
  • 2,805
  • 1
  • 25
  • 42