PHP & PDF Solutions

 

SetaPDF FormFiller API - Fill in a Reader Enabled document

Normally PDF forms are not saveable in the free Adobe Reader. But Adobe offers different services which enable such hidden feature in Adobe Reader by passing special digital signatures to a document.

The SetaPDF-FormFiller API is able to handle such document if you take care about the following facts:

  • You have to define a special constant which will prevent that the info-dictionary of the document will be overwritten:
  • Unicode support is not possible without preparing the original document before the rights are granted. ($renderAppearancesByViewer-parameter in the factory method has to be false)

How to prepare a document for unicode usage

The unicode-"support" in the API is simply based on the fact, that a flag indicates the reader to rerender the appearances of all form fields. If the API sets this flag in a rights enabled document, the digital signature will get invalid, the document will lose the rights and the client will receive an annoying error message.

If we would prepare a document with this special flag before attaching the rights, Acrobat, for example, will remove this flag automatically before enabling the rights...

Finally the only solution to simulate the needed behaviour is a simple JavaScript which has to be included into the "Document JavaScripts"-part of the document before enabling the reader rights. It will force the fields to be rerendered by swapping a simple property back and forth:

Try it your own with the following demo script:

Choose one of the following rights enabled (saveable) PDF files.