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

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));

So the html you are passing does not include any css/javascript in the head tag. So not seeing any styles makes sense. I’m not sure this is something that will possible with the pdf generator

what should I do here any suggestion? i see docs but didn’t find anything helpful

I tried to use ionic css cdn but it gives me black blank page

Not really much you can do. If the pdf-generator is not giving you an option to include the JS/CSS, then you are at a dead end. Best bet is to rethink what you are trying to do.

I created a function returning a string, that string being some html and css code. It works perfectly so far. Just struggling to embed img tag, precisely on the src attribute.