Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48977

Css and html tags are not implemented on pdf generated in vue ionic

$
0
0

I am using this ionic package to generate pdf file

https://github.com/cesarvr/pdf-generator

Pdf is generating but it seems like html tags and css is not applied on pdf it seem broken

enter image description here

I am generating pdf like that. I am getting outer html of vue component and then generating pdf from that but thats not happening correctly

 let options = {
        documentSize: "A4",
        type: "share",
        fileName: "myFile.pdf",
      };
 console.log(this.$refs.order.$el.outerHTML)
      PDFGenerator.fromData(`<html lang="en"><head></head><body><div id="app">${this.$refs.order.$el.outerHTML }</div></body></html>`, options)
        .then(() => "ok")
        .catch((err) => console.log(err));

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 48977

Trending Articles