Merging pdf does not retain source pdf formatting
Hello @Hopding,
First of all, awesome tool. the best, free library so far.
Anyway, I have an issue that I've been trying to resolve. I'm currently merging multiple pdfs using the example in your README. However, the merged pdf does not retain the original formatting of the source PDF. Is this an expected behavior? Since I've read from one of your comments here that copying pdf contents does not copy other underlying data (e.g. links ). Does this perhaps include the formatting as well? If so, can you suggest any workaround?
Thanks!!!
Hello @kimlambiguit!
Can you share some sample PDFs and screenshots?
Hi @Hopding
Forgot to mention this are Acrofields. So basically what happens is I have a bunch of PDFs with acrofields that are filled and saved. The saved PDFs are then merged. Below is a sample page.
Original, non merged PDF

Merged.

Please ignore the blacked out portion. Just covering some company details :)
Thank you for taking notice and good day.
Hello @Hopding. is there additional information that you need to help formulate a root cause or a workaround?
@kimlambiguit pdf-lib doesn't currently copy AcroForms when copying or embedding pages. See https://github.com/Hopding/pdf-lib/issues/417#issuecomment-620900368. One thing you could try is "flattening" the form fields before using pdf-lib to load the documents. This would remove the form fields themselves while preserving their filled values. (Note, however, that you'll have to find a different tool to do the flattening. pdf-lib does not have APIs for that).