Thanks a lot man. You saved my project. For those who wanna do it in Ionic 4, change the imports to '@ionic-native/file-opener/ngx' and '@ionic-native/file/ngx' and it'll work.
Ionic v3 needs different commands for installing these packages: npm install --save @ionic-native/file@4 npm install --save @ionic-native/file-opener@4 for the rest look at: ionicacademy.com/create-pdf-files-ionic-pdfmake/ Thanks for your help!
Yes you always need to check if an old /new video is for v3 or v4, there are some differences you have to watch out for. Thanks for leaving these notes!
For Ionic v3 be sure that you install versions @4 with npm ( npm install --save @ionic-native/file@4 and npm install --save @ionic-native/file-opener@4) last versions do not work properly
Just in case anyone is wondering, I tried to create it today with Ionic 4 (4.12.0) and had to use: npm install @ionic-native/file@latest npm install @ionic-native/file-opener@latest
Hey Simon, I'm having trouble with PDFMake, it works fine on the web but when I run it on my Android device the PDF doesn't open... Any ideas of what might be happening?
great tutorial sir, i am having trouble in deploying the same on my device, it is throwing an exception. but, is working well on ionic lab. i am unable to make it work on device. please help!
I was having trouble to print in a cordova device, after looking in the ionic forum, I found this: if (this.plt.is('cordova')){ this.pdfObj.getBuffer((buffer) => { var utf8 = new Uint8Array(buffer); var binaryArray = utf8.buffer; var blob = new Blob([binaryArray], { type: 'application/pdf'});
this.file.writeFile(this.file.dataDirectory, 'myletter.pdf', blob, { replace: true}).then(fileEntry => { this.fileOpener.open(this.file.dataDirectory + 'myletter.pdf', 'application/pdf'); }) }); }else { this.pdfObj.download(); } So I could print in my device.
Hi Simon can you make a tutorial How to just open a .PDF file stored locally(www or assets) in the app (The PDF should open Inside the ionic app not using external apps) thank you in advance.
Failed to install 'cordova-plugin-file-opener2': Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.') at CordovaEventEmitter.emit (events.js:199:17)
Si les llega a pasar esto "FileOpener open file not working Object(…) is not a function error", se soluciona con un downgrade npm install @ionic-native/file-opener@4.20.0 --save
Thanks a lot man. You saved my project.
For those who wanna do it in Ionic 4, change the imports to '@ionic-native/file-opener/ngx' and '@ionic-native/file/ngx' and it'll work.
Yes simply add ngx if you see an old tutorial! Glad I saved your project :)
Thx simon...
Ionic v3 needs different commands for installing these packages:
npm install --save @ionic-native/file@4
npm install --save @ionic-native/file-opener@4
for the rest look at: ionicacademy.com/create-pdf-files-ionic-pdfmake/
Thanks for your help!
Yes you always need to check if an old /new video is for v3 or v4, there are some differences you have to watch out for. Thanks for leaving these notes!
Simon, thanks for the video, do you know where can i find more tools for pdf? i mean add images, links or just make it pretier.
Excellent my friend. How can I insert a barcode in the pdf?
Would you recommend PDFMake for converting client-side images (phone captures) to create a B&W PDF suitable for faxing? Iconic framework.
Hmm I think in general that could work, you might have to see if the quality in the end is acceptable!
Is it the same way to generate PDF if I have multiple items added dynamically one after another
Beautiful...just outstanding. You just saved my whole work man.
For Ionic v3 be sure that you install versions @4 with npm ( npm install --save @ionic-native/file@4 and npm install --save @ionic-native/file-opener@4) last versions do not work properly
Just in case anyone is wondering, I tried to create it today with Ionic 4 (4.12.0) and had to use:
npm install @ionic-native/file@latest
npm install @ionic-native/file-opener@latest
Hey Simon, I'm having trouble with PDFMake, it works fine on the web but when I run it on my Android device the PDF doesn't open... Any ideas of what might be happening?
Simon Grimm
Please reply to this. I have the same problem.
KM Ramirez I found out that the ionic writeFile API can't write the blob (don't know why), I've replaced it with a binaryArray.
Hello, can you show how you did it? thank you
@@GiselaDifini, can you show how you did that replaced, please? Thanks in advance.
Having the same problem please help @Gisela
great tutorial sir, i am having trouble in deploying the same on my device, it is throwing an exception. but, is working well on ionic lab. i am unable to make it work on device. please help!
Thank u Sr Simon
deffinetely you are an ionic master!!!
Thanks dude, helped me a lot!
Wow! Amazing!! This will be very important to my project!
I was having trouble to print in a cordova device, after looking in the ionic forum, I found this:
if (this.plt.is('cordova')){
this.pdfObj.getBuffer((buffer) => {
var utf8 = new Uint8Array(buffer);
var binaryArray = utf8.buffer;
var blob = new Blob([binaryArray], { type: 'application/pdf'});
this.file.writeFile(this.file.dataDirectory, 'myletter.pdf', blob, { replace: true}).then(fileEntry => {
this.fileOpener.open(this.file.dataDirectory + 'myletter.pdf', 'application/pdf');
})
});
}else {
this.pdfObj.download();
}
So I could print in my device.
Hi Simon can you make a tutorial How to just open a .PDF file stored locally(www or assets) in the app (The PDF should open Inside the ionic app not using external apps) thank you in advance.
Failed to install 'cordova-plugin-file-opener2': Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('The platform "android" does not appear to be a valid cordova platform. It is missing API.js. android not supported.')
at CordovaEventEmitter.emit (events.js:199:17)
hello, wat did you use for ios emulator ? im using macbook but idk for ios emulator.. haha.. thanksss
there are payments cheques example?
awesome one simon sir
wow... can u please make a video (or give me any link) for pdf compression (to reduce size)
can you make video on ionic cordova plugin cordova-plugin-document-viewer and open pdf from assets folder...
NICE, NICE, NICE, and VERY NICE, i LIKE IT, does a tutorial teaching how to open pdf files on ionic with an API link? please?
Thanksss! :D
i cant download pdf file in my device
pdf got created in v4 but my application got creashed after opening the file
any suggestions..anyone??
I want to create table in pdf
How to upload multiple file in one time server hit in ionic 3
Hi i actually created HTML screen in my iPad and want to convert the entire html screen to pdf. Can anyone help me out please.
_co.createpdf is not a function i have this error
Then you haven't defined the function in your class.
Arabic is not supported ... how to solve this ??
hi its its not supporting for arabic language
Can you make app for open pdf file which is in folder www/
I'll look into that Rijwan!
thanks!!!!
can you tell me how to add images?
Check out the docs for PDFMake here, there are examples for images as well: pdfmake.org/#/gettingstarted
How can i, put a name to my pdf document?
For the output file? Simply change the name. Otherwise you might have to look into the PDF Make apps on how and where to position text!
Simon Grimm thank you so much
Si les llega a pasar esto "FileOpener open file not working Object(…) is not a function error", se soluciona con un downgrade
npm install @ionic-native/file-opener@4.20.0 --save
how to open the pdf file by fileOpener .
Try to use this plugin: ionicframework.com/docs/native/file-opener/
anyone know how to display Chinese words?
Thai Language is not supported
ได้ ยังครับ 555
github.com/bpampuch/pdfmake/issues/562
ผมแก้ไม่ได้เลย ช่วยแนะนำได้ไหมครับ