Generating HTML on current page in order to export PDF page

Hey all,

I am trying to export a page to PDF. I did take a look this post https://devs.journeyapps.com/t/export-page-to-pdf/422 but I’m still unsure how to go about it.

Is there a way to download the html on the current view? I was thinking I could do that, convert it to base64, and store it as a text field on the model. Then, I would have a webhook call a cloud task that does

async function saveReport(pdf, generatedPdf) {
const generated_pdf = await Attachment.create({base64: base64, mediaType:'application/pdf', filename: 'job_report.pdf'});
pdf.generated_pdf = generated_pdf;

}

Hey @alex.dang you cannot download the html of the view (at least not to my knowledge). But, you can create a pdf with html and the JourneyApps pdf library. In our use case, I had to create what I wanted the pdf to look like via handlebars. That then gets converted to a pdf via the JourneyApps pdf library.

1 Like