November 22, 2003

can't do it free

Meant to blog this up ages ago—-Creative Commons said to my email below … “you are right, at the moment XMP can’t be done in free software, we’re going to do it using the Acrobat SDK and hopefully people will get into building the free software tools to do it”.

Bugger. I really can’t believe that this is so difficult.

I’m going to write to the Perl PDF::API2 guy and see what he has to say.

Posted by james at November 22, 2003 09:46 PM
Comments

No, but the programming task really isn't that hard. As far as I can tell you can do it with relatively minimal invasiveness in one of two ways:

1) XMP already exists and the tool that put it there followed "the rules" in the spec and left at least 4K to work with. You can just overwrite this section of the file without disrupting the PDF at all. Unfortunately, its a destructive change so signed PDFs will break and you're limited to whatever is already there. On the bright side it doesn't break the regex-based scripts people have written for XMP.

2) If I'm reading things correctly the appropriate way to handle this is to use the PDF's incremental update feature to write the XMP stream as well as an updated Catalog dictionary with a Metadata flag.

Reading is actually easier---you only need to correctly locate the Catalog dictionary and then have it tell you the object number of the Metadata stream, which is usually just in plaintext XML.

The only downside is that I'm pretty sure you can only have Metadata streams on PDF1.4+ though it may be that having one in a <PDF1.4 file doesn't do any harm... Attempting to promote a PDF file by changing the header would, again, break signed PDFs AFAIK.

Posted by: Byron Ellis at November 23, 2003 12:39 AM

If ifs and ans were pots and pans. (c)

Posted by: Gerrard at June 13, 2004 07:32 PM
Post a comment









Remember personal info?