Where to place the QrBill Section #400
staatzstreich
started this conversation in
General
Replies: 1 comment 1 reply
-
I would recommend to change the size to You don't have to add a blank page manually, you can just change the size with the const pdf = new PDF(data, "qrbill.pdf", { "size": "A4" }, () => {
console.log("PDF has been successfully created.");
}); You may need to use the Switching to previous pages feature from PDFKit to create the Header and Footer. That way you can check if you are on the last page and omit the Footer so that it won't interfere with the payment part. const pdf = new PDF(data, "qrbill.pdf", { "autoGenerate": false, "size": "A4" });
// Create your invoice
pdf.addQRBill();
pdf.on("beforeEnd", () => {
const range = pdf.bufferedPageRange();
for(let i = range.start, end = range.start + range.count; i < end; i++){
pdf.switchToPage(i);
if(i !== end){
// Render Header and Footer
}
}
});
pdf.end(); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello...
i am generating Invoices with react-pdf and have the need to deliver a Swiss Qr Bill... My Invoices are Multipage and with a fixed Header and Footer.
Should I add a blank A4 sized page with the Qr Bill at the bottom or is it ok to include only the A6/5 sized Version?
I ask because, if you open the A6/5 sized version generated PDF like so
on MacOS with the Preview-App it looks good but with Printing Preview the PDF is "Auto rotated" and Scaled. It is placed center of a A4 Page.
Is this ok with Swiss Banking Institutes?
For me as an no Swiss Citizen this is very confusing. Can you help with clarification ?
Thanks and Best,
Michael
Beta Was this translation helpful? Give feedback.
All reactions