When i press on button the device ask me to select a program to open file, then i select adobe reader pdf. But adobe reader pdf tells me ‘impossible to load file …’.
Maybe i must give the right path of my a.pdf file. I copied a.pdf file in various folder in my project but nothing.
Sounds like a good plan. Make sure you use the full path to the file, otherwise I don’t think it will work. Other than that I don’t think the problem is Ionic related, perhaps something wrong with the application you open it with or something wrong with the file.
<button (click)="openURL('a.pdf')">Open pdf </button>
I don’t give any path. In which folder of the project the pdf file must be positioned? And when i call openURL what url i must insert? I tried with openURL('file:///android_asset/www/a.pdf') but nothing. I also don’t think the problem is Ionic related.
Thank you.
Well this is a forum for ionic related questions, so you might wanna try out stackoverflow or something
Where you put your pdf files and what the full path is entirely up to you. I am just trying to tell that you should make sure that you use the full path to the pdf file when you want to open it. And not just use a.pdf for example.
Is it a downloaded pdf file? Or is it something you put in your assets folder as a developer? You need to give me more info if you want me to help you.
Ok, it is a file that i put in my project in folder ‘www’. I don’t know what url insert in openURL(url). What is the value of variable string url? (I have an android device and filename ‘a.pdf’)
Thank you. When i click the button <button (click)="openURL('a.pdf')">Open pdf</button> I see Acrobat Reader that runs, but after i read a message ‘cannot find the file’.
It seems a problem relative to the path of file.
Can you please elaborate how your passing the file path to the plugin and also how you specifying the mime type. Adding some code snippet will be more helpful…