cesarvr / pdf-generator

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

Saved File name #53

Closed amit25685 closed 6 years ago

amit25685 commented 6 years ago

I am getting "default" as file name when saving. How we can give file name with extension in this for "Generate & Share" button?

cesarvr commented 6 years ago

Hi you just need to pass the {fileName:'name-of-your-file.pdf' } , example:

 document.addEventListener('deviceready', function() {

        pdf.htmlToPDF({
            url: "http://www.google.es",
            documentSize: "A4",
            landscape: "portrait",
            type: "base64",
             fileName:'name-of-your-file.pdf'
        }, this.success, this.failure);

 });