I am creating a series of laboratory exercises for my University. Thus, I created a .cls file that includes every package and applies any format I need. Among the included packages is the eforms
package to create fillable fields and soul
package to apply highlighting. Note that I use XeLaTeX for compiling. My main problem is that when I close the pdf, Adobe Reader always prompts "Do you want to save changes to ... before closing?" even no changes are made in those fields, even there is not any field at all. How can I overcome that issue while preserving the visibility of my fields?
A possible solution is to set true
the pdfa
option of hyperref
package. That option disables a variety of properties that prevent the document from being PDF/A compliant. One of those properties is the NeedAppearances
, which is set to false
instead of default true. The result of that action is that fields are invisible unless they are clicked. The same behavior also is observed by fields created using hyperref
commands.
Another possible solution is to use pdfx
package with the a-3b
option. This solution works almost like a charm, document claims compliance with PDF/A standard, all fields are visible and document is opened in read-only mode, so Adobe Reader doesn't ask for saving for no reason. Unfortunately, pdfx
messes with soul
package and the \hl{}
command for highlighting; doesn't allow text to be highlighted. For example, when a whole sentence is highlighted with \hl
, only whitespaces inside the sentence are displayed as highlighted. Thus, this solution cannot be applied since highlighting is a mandatory.
Foxit Reader, on the other hand, seems to be smarter. With the default setting (no pdfx and no pdfa option of hyperrref) Foxit knows when a field is edited and only then asks for saving. But, Foxit's performance is poor compared to Adobe Reader.
So, I am thinking a variety of solutions:
Is there any way to instruct Adobe Reader, possibly through latex commands, to open a document as read-only, in a similar way that Adobe Reader does when opens a PDF/A document?
Since PDF/A format doesn't seem a bad perspective, is there any way to support highlighting in PDF/A documents, with
soul
package or with an alternative method/package?
EDIT: I also tried to experiment with a simple example of eforms from here: http://www.math.uakron.edu/~dpstory/acrotex/examples/html/eforms_tst.pdf. The original pdf does not prompt for saving. Although, I compiled the source file that is attached using pdflatex and the prompt appeared again! I updated all packets from MikTeX console and the issue still persists.