pdfsak icon indicating copy to clipboard operation
pdfsak copied to clipboard

Merge PDFs with Form Field LOST!

Open mgip opened this issue 2 years ago • 1 comments

I try to merge 2 pdf, one of them has a few form field filled allready, but, when i merged in the output file the fields do not show.

mgip avatar May 06 '22 12:05 mgip

Hi,

Thanks for the issue.

PDFsak uses latex's pdfpages package for merging, which treats PDFs as images and ignore forms as well as comments (source 1, source 2).

The easiest way for your use cases is probably to use qpdf. To merge a.pdf with b.pdf into c.pdf you can run:

qpdf --empty --pages a.pdf b.pdf -- c.pdf

and forms will be preserved.

In alternative, to use PDFsak we would need to first "flatten" the PDF, that is, convert it into an image, and then merging. This would be achieved with something like:

magick convert -density 300 a.pdf a2.pdf
pdfsak -if a2.pdf -if b.pdf -o c.pdf

we could implement that in PDFsak, however the form will not be editable anymore in the final document.

raffaem avatar May 06 '22 13:05 raffaem