Pergunta

How can I add text to a pdf document, which is not visible?

The document manipulation should be done in java. The usecase is to add further metadata to a document (in a proprietary format, about 40kb), before the document is signed and archived.

I tried:

  • annotation field with size 0,0
  • .txt file attachment

but, this annoys readers of the PDF, because they see a difference (comment / attachment bar).

Is there a comment object or a syntax to comment out lines in a PDF document?

EDIT: I've tried adding text between PDF objects. This works, the problem is: acrobat reader asks to resave the file when closing window.

Adding the text after %EOF is not a solution, because signing is not applied to the metadata, which is a needed feature.

Foi útil?

Solução

The proper way to add metadata to a PDF would be through XMP. It allows you to add arbitrary metadata and allows defining the metadata types inside of the same PDF file (which you really should do if you're archiving and which is a requirement in archival standards such as PDF/A).

XMP data can be extracted by readers who don't understand the PDF format using a simple text scanning algorithm yet at the same time it will be inside of the document so will be protected by the digital signature you apply.

You can read more about it here: http://www.adobe.com/products/xmp/

Outras dicas

I have seen PDF's who had a bunch of metadata in the footer, just in color white while the background was also white, so normally you wouldn't recognize it when you're looking at the PDF. But that's quite nasty..

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top