Open vitorbraga opened 2 years ago
Hi, I'm trying to generate a PDF with some line-breaks. I spread some <div class="html2pdf__page-break"/> across my HTML.
<div class="html2pdf__page-break"/>
When I look into the preview (the window that appears when I try to generate the PDF), the line-breaks work fine.
But when I export it as a blob and save it on my server (S3), there are no line-breaks. Am I missing something here?
Here is my code:
const pdf = await html2pdf() .set({ pagebreak: { avoid: ['.avoid'] }, html2canvas: { scrollX: 0, scrollY: 0 }}) .from(pdfContent) .toPdf() .get('pdf') .then((pdf) => pdf); const preBlob = pdf.output('blob'); const formData = new FormData(); formData.append('report', preBlob, 'my-file.pdf');
Thanks
Hi. I worked in a similar problem 1 month ago and remove class and set the all custom styles on " style=" " " directive works for me.
Try this one
Hi, I'm trying to generate a PDF with some line-breaks. I spread some
<div class="html2pdf__page-break"/>
across my HTML.When I look into the preview (the window that appears when I try to generate the PDF), the line-breaks work fine.
But when I export it as a blob and save it on my server (S3), there are no line-breaks. Am I missing something here?
Here is my code:
Thanks