Closed karo-init closed 1 year ago
Hi @karo-init !
We can use Multipage PDF as basePDF. Could you please share minimal reproduction and code?
Hi @hand-dot,
this is the code i tried out:
function App() {
const template: Template = {
basePdf: EXAMPLE_PDF,
schemas: [
{
a: {
type: "text",
position: { x: 0, y: 0 },
width: 10,
height: 10,
},
b: {
type: "text",
position: { x: 10, y: 10 },
width: 10,
height: 10,
},
c: {
type: "text",
position: { x: 20, y: 20 },
width: 10,
height: 10,
},
},
],
};
const inputs = [{ a: "a1", b: "b1", c: "c1" }];
const onGeneratePDF = async () => {
const pdf = await generate({ template, inputs });
const blob = new Blob([pdf.buffer], { type: "application/pdf" });
window.open(URL.createObjectURL(blob));
};
And EXAMPLE_PDF is a Multipage PDF I created from a webpage with the built in PDF Printer from Chrome Browser. The Encoding of the PDF starts with "export const EXAMPLE_PDF = 'data:application/pdf;base64, ... ".
Thanks in advance for looking at it !
@karo-init
Sorry for the late reply. Could you upload EXAMPLE_PDF?
@karo-init I labeled the answer because I did not receive a reply. If there are no replies at this point, it will be closed after 30 days. If you have any questions, please comment.
This issue has been automatically marked as stale because it has been open 30 days with no activity after answered. Remove stale label or comment or this issue will be closed in 7 days.
This issue was automatically closed because of stale in 7 days
Hi Kyohei, at first thanks for the great repository ! I'm still on the "Getting started level" with it and I tried to use a self created Multipage PDF as basePDF but I had only success with a Single Page PDF. Do I have to use an additional property for using a Multipage PDF as basePDF or is it not possible yet ?