Great points from both Ian and Richaa! If you’re looking for even more advanced workflows, especially when dealing with editing or merging PDFs, I recommend PDF-LIB *or your javascript generate pdf projects.
Unlike jsPDF or html2pdf.js, PDF-LIB gives you deep control over existing PDF documents or lets you build complex PDFs from scratch, with programmatic precision:
import { PDFDocument } from 'pdf-lib';
const pdfDoc = await PDFDocument.create();
const page = pdfDoc.addPage();
page.drawText("Hello, PDF!");
const pdfBytes = await pdfDoc.save();
This is especially powerful if your XML data needs to be merged into specific sections, combined with other PDFs, or you need to apply security features. It’s a more advanced option but incredibly robust for serious document workflows.