I'm trying to work out a solution to flatten PDFs with already-filled out fields on a Linux command line. I was messing around with GhostScript at first, but I found that tended to convert all the field data to garbage characters.
When I run this command
pdftk foo.pdf output bar.pdf flatten
and open bar.pdf
in a PDF reader, it's flattened, but the data that was in the fields simply isn't present. The PDF is just the same as if it wasn't filled out, minus the fillable fields.
Is there something I'm missing here?
All the solutions I find on Google are about populating empty forms with .fdf
files, which doesn't really pertain to my situation.
qpdf foo.pdf fixed.pdf
thenpdftk fixed.pdf bar.pdf flatten