cesarvr / pdf-generator

Cordova plugin to generate pdf in the client-side
MIT License
107 stars 61 forks source link

How to send via email a pdf ? #29

Open uselessai opened 7 years ago

uselessai commented 7 years ago

In the documentation says that is posible to send the pdf via email.. but you don't say how..

cesarvr commented 7 years ago

take a look at this example example, when you generate the PDF en iOS you can pass the control to the user to decide what to do he can send it by mail, open it, etc... if you have it in base64 you can use your own API to do that.

uselessai commented 7 years ago

Nope.. It doesnt work for me.. I have a Xiaomi Redmi Note 3. Android version 6.0.1

Ionic version 3 / Angular 4

Code

cordova.plugins.pdf.htmlToPDF({ url: "http://www.google.es", documentSize: "A4", landscape: "portrait", type: "share" }, (sucess) => console.log('sucess: ', sucess), (error) => console.log('error:', error)); });

It doesn't appearance this options menu.. when I click in "download pdf".. it only ask me the name and where I want to download it.. and nothing else.. no base64 generator option.. nothing at all..

AlexChesser commented 7 years ago

Hey @detolox I've just been working on that. It has been broken in Android until today.

You'll have to grab some bleeding edge stuff. Because Android base64 hasn't need working before now. I'm not sure if it is in master yet.

https://github.com/cesarvr/pdf-generator/issues/9 is solving base64 and the PDF via email sample code is also linked in there.