pdf-merge provides an api for merging PDF files, but it does not work when trying to combine buffers or streams. When trying to combine these buffers in a standard way or through packets (aka Buffer.concat, stream-concat, buffer-concat), the result includes only the last stream instead of the combined result.
It seems that more people encountered this problem, but no solution was provided (example: NodeJS: merge two PDF files into one using the buffer obtained by reading them )
I assume this is due to the unique presentation of the PDF file.
I also tried pdfkit addContent (buffer), but the result is an empty file and apparently it is not supported ( https://github.com/devongovett/pdfkit/issues/417 ).
Has anyone experienced this problem and made it work? We should use threads for performance problems (therefore, file mitigation is not an option).
Thank.
source
share