Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

How to Embed your own data in PDF files

54 sec read

Because of its power and flexibility, the PDF file format is often used for Internal workflows. Sometimes it would be useful to embed your own data within the PDF itself. Generally this information will be ignored by most tools and the PDF remains usable as an ordinary PDF.   Here are some ideas on how you can do this.

The XML metafile

You can embed a XML file as part of the PDF metadata. This can contain just about any extra tags so it is an ideal place to bury data about the whole file.

Extra Dictionary Tags

It may need to customise your PDF creation but you can add extra Dictionary tags. As a PDF developer  I often see PDF files with non-standard tags added in by Creo or other tools. So you could include additional data on objects, such as image copyright or asset tag for it in your workflow.

Invisible Annotations on a page

If you want to include page specific data, you could include some invisible Annotations, which allow you to embed links and binary data and associate it with a specific page in the PDF file.

Custom tags in Structured Content

Structured content allows you to add your own metadata to the textual content. So the information could be tagged up to flag-up keywords, database field values, and so on.

Because the PDF file is such a flexible creature, it lends itself to many creative tricks to extend its functionality. Do you have any such favourite tricks to share?



Our software libraries allow you to

Convert PDF files to HTML
Use PDF Forms in a web browser
Convert PDF Documents to an image
Work with PDF Documents in Java
Read and write HEIC and other Image formats in Java
Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

3 Replies to “How to Embed your own data in PDF files”

  1. Hello, Mark.
    Thank you for your article.
    Could you please suggest if it posible to use embedded XML-file as a data source for PDF-form.
    I mean displaing a values of elements and atributes of my XML-file that has been embedded into PDF-file (according to PDF-A/3 specification) in appliance with the formular defined in this PDF-file.

Comments are closed.