Closed xLEpEX closed 1 year ago
can you add the sample files. It seems like Recipe is unable to find the page it needs to add the overlay at some point. Maybe it has no pages?
you could also examine a bit by:
const OverlayPDFDoc = new Recipe(overlayPDFByte);
console.log(OverlayPDFDoc.pageNumber)
console.log(OverlayPDFDoc.metadata)
https://stackblitz.com/edit/node-imkbyf?file=index.ts I'm not sure, could it be possible that I'm on the wrong version. Thiere is no method / property with the name pageNumber / metadata
I'm using the version 3.8.0
What is also a little bit stage is, that I'm not getting a byte stream back on .endPDF() instead it's returning a Recipe object on every method
you need to make sure to start editing and finalize a page:
generatedPDFDoc.editPage(1).overlay('./src/overlay.pdf', 0, 0, {fitHeight: true, fitWidth: true}).endPage().endPDF(....')
you may also have a look at the test overlay file https://github.com/julianhille/MuhammaraJS/blob/develop/tests/recipe/overlay.js#L14
@xLEpEX how do you fix the metadata issue? I'm migrating from hummus-recipe, and using metadata properties too. Where do I get similar info?
Fyi: the recipe object is mostly a complete copy of recipe module so it should basically be a drop in replacement. Please let me know when things do not work so I could change it or add it to the readme.
Hello,
I'm trying to apply an overlay to my PDF and getting the error: "TypeError: Cannot destructure property 'width' of 'this.metadata[this.pageNumber]' as it is undefined."
I'm Loading the PDF, from a Buffer and im not sure if i missing something
` const overlayPDFByte = fs.readFileSync('./src/overlay.pdf') const generatedPDFByte = Buffer.concat(chunks);
`