Question

I have the Data.xml file and a pdf file filled with informations. I'm trying to embed the data.xml file in the XMP metadata stream of the PDF because this data should be hidden.

I used iText to create the pdf and to add the usual metadata such as author etc. But I'm not able to understand how to add the xml as metadata in the xmp stream. Is there a function in the iText or xmlworker library that allows me to do this? I've tried but I can't fin the way to do this.

(I have no code to post because all code written to create the pdf and so on works perfectly, just dunno how to proceed to do what I described before. Is there something in the iText library that provides it, or i should use other tools?)

Was it helpful?

Solution

"In PDF/A-3, the data is added as a document-level attachment. That makes much more sense than to put it into an XMP stream.

The document-level attachment won't be visible on any page, but people will be able to select it in the attachment panel, just like they'll be able to see the contents of the XMP (it's easy to add a document-level attachment with iText). There are of course many other ways to add data to a PDF that isn't visible. For instance Adobe Illustrator adds proprietary artifacts as a /PieceInfo entry in the root dictionary of the PDF. That's also possible with iText. There are many solutions, all are better than abusing the XMP stream"

Attaching at the document level solved the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top