1

My Goal is to Export All Pages in the PDF, For Exporting PDF I'm using jsPDF.HTML() method, Here is my code

const exportToPdf = () => {
    const doc = new jsPDF("p", "pt", "a4");
   
    doc.html(page1 + page2 + page3 + page4 + page5, {
      callback: function (pdf) {
        pdf.save("multipage.pdf");
        window.open(pdf.output("bloburl"));
      },
      dompurify: dompurify,
      margin: 50,
    });

Here page1, page2, page3 are HTML strings For that specific page. I'm rendering those pages using Tabs! styling for All those pages are given by external CSS file. while exporting from the localhost it is working fine & CSS changes from the external file also applies, but when we export it from the Hosted Site only CSS given with the inline styling are applying not from the external file

This is the log I'm getting in console: Failed to load resource: the server responded with a status of 403 (Forbidden) whether it is possible that Azure is creating the issue ?

I don't know what's the issue behind that, Your suggestion will be very helpful, Thanks!!

  • HTTP 403 is a server-side permissions error, but you're generating a PDF client-side... – Dai Nov 17 '22 at 11:39
  • Yeah bro, it may be a issue of server configuration, but I've created another example using same method .HTML(), where I'm exporting one div, here I've also given external CSS but that works perfectly on hosted Site! generated PDF has changes related to external CSS file @Dai – programmers_view Nov 17 '22 at 11:51
  • Why can't you host the CSS file yourself? – Dai Nov 17 '22 at 11:53
  • Sorry but what do you mean by hosting the CSS File? @Dai – programmers_view Nov 17 '22 at 11:59

0 Answers0