junrrein/pdfslicer

Form fields are removed

rugk opened this issue · 8 comments

rugk commented

When the page is saved, form fields are removed, so you cannot enter text in there,

What's worse, even when text is already entered there, it is just removed. So you have an empty field… 🤔

It keeps the checkbox state though.

same issue (same lib, maybe?): https://gitlab.gnome.org/Archive/pdfmod/issues/1

Hi there, thanks for the report.

I had no idea this was happening, as I've never used documents with form fields. I'll have to investigate and see if the lib I'm using supports copying them over. I'm sorry if you've lost any data by using the app!

Slicer and PdfMod don't use the same library. PdfMod is effectively unmaintained (last release on 2011), and Slicer is semi-maintained, so unfortunately you can't expect news on this issue anytime soon.

Can you try using the command-line qpdf application? That one does use the same library as Slicer, so it would help identifying which is the source of the problem (the library or the app).

Closing issue since information wasn't provided.

I didn't realy use files with form fields before, and that's why I didn't hit the bug.

But now I see what you mean. Now Slicer preservers the form fields of the first opened file, but loses the form fields of any added files. I believe this is a limitation of the library Slicer uses to save files, but I need to investigate some more.

After investigating, I found out that QPDF (the library Slicer uses for saving documents) can't copy form fields when copying pages from other PDF files. I don't think this issue will be solved before it's implemented upstream.

rugk commented

Is there an upstream issue?

That's a really good question, thanks for asking that. It turns out there isn't one (either open or closed) so I created one.

From this comment in the linked issue:

(...) it is possible to copy the entire AcroForm and Annotations dictionaries from one file to another, after forms will work on any page you copy, but this brings a lot of extra stuff around, and for large files, it is very inefficient. (...)

So while doing this would be at a lower and coarse-grained level than I would prefer, it's possible. It may get implemented as a stop-gap measure until QPDF implements a high-level interface for this.