Hi there,
is it possible to add an existing pdf page to generated document?
i have to generate 2 pages with pdfmake, but the rest of the pages that will stay the same for all the generated documents.
if its not possible maybe you have some clever idea how to do it?
Thanks,
Mike
Pdfmake library is designed for generating PDF files; does not allow editing or loading PDF files.
Hi there,
is it possible to add an existing pdf page to generated document?
i have to generate 2 pages with pdfmake, but the rest of the pages that will stay the same for all the generated documents.
if its not possible maybe you have some clever idea how to do it?
Thanks,
Mike
yes, using hummus-recipe npm module
Full disclaimer, I'm a total newbie but I think you can do this (however messy) in the following manner:
If you really want to use pdfmake for this you should technically be able to convert each page of each PDF into an image (jsPDF?) and draw the image onto a new page using pdfmake (can this be done with a PDF converted to SVG??? no clue).
This would of course require additional dependencies. If you don't mind the additional dependencies, you might want to add pdf-lib js to your packages and feed a buffer of the generated pdf to it and then you can do anything BUT add hyperlinks (afaik) to a newly generated PDF with your pdfmake document as well as any other PDF you need to add.
I like doing it this way because pdfmake has by far the best formula for creating pdfs from scratch on the client, however pdf-lib is very powerful when it comes to pdf manipulation - also on the client.