pdfmake-wrapper
pdfmake-wrapper copied to clipboard
Help Please: How Do You Mix Page Orientations?
Hi, I am converting some html to PDF but I have a couple of issues.
- Can't mix page orientations
- I can't seem to insert a blank page
//example get html var printContents = document.getElementById("exampleId")?.innerHTML;
//example var html = htmlToPdfmake(printContents);
var htmlBlankPage = htmlToPdfmake(); //not sure what should go here
var htmlOverview = htmlToPdfmake(printOverview);
var htmlFFListing = htmlToPdfmake(printFFListing);
var htmlNNListing = htmlToPdfmake(printNNListing);
var htmlSSListing = htmlToPdfmake(printSSListing);
var htmlSummary = htmlToPdfmake(printSummary);
const pdf = new PdfMakeWrapper();
PdfMakeWrapper.setFonts(pdfFonts);
pdf.pageSize("A4");
pdf.pageOrientation("portrait");
pdf.add(printOverview);
pdf.add(); // add blank page
pdf.add(printFFListing);
pdf.pageOrientation("landscape");
pdf.add(printNNListing); // should be displayed in landscape
pdf.pageOrientation("portrait"); // the rest of the pdf in portrait
pdf.add(printSSListing);
pdf.add(); // add blank page
pdf.add(summary);
Thank you
any definition (Txt, Ol, etc..) has a method to break a page and orientation. For example:
pdf.add(printOverview);
pdf.add(
new Txt('some text').pageOrientation('portrait').pageBreak('before').end
);
pdf.add(
new Txt('some text 2').pageOrientation('landscape').pageBreak('before').end
);
Please close this issues if it was resolved.