On Nov 4, 2010, at 09:31, David Quinn wrote:

> Is there an easy way to edit the PDF metadata? I've tried reading through the 
> adobe pdf standard and am somewhat confused. I'd like to try and write a 
> python script that takes the bibdesk author/date and attaches it to the pdf, 
> but I'm having difficulty getting started.

If you're using Python, I'd do this with PyObjC.  You can create a PDFDocument, 
then set its attributes.  Something like this (warning: typed in Mail, may 
destroy your computer, etc.)

from Foundation import *
from Quartz import *

url = NSURL.fileURLWithPath_("/path/to/file.pdf")
pdfdoc = PDFDocument.alloc().initWithURL_(url)
assert pdfdoc, "failed to create document"

attrs = {}
attrs[PDFDocumentTitleAttribute] = "Some Title"
attrs[PDFDocumentAuthorAttribute] = "A. Author and B. Author"

pdfdoc.setDocumentAttributes_(attrs)
pdfdoc.writeToFile_("/tmp/mynewfile.pdf")



------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Bibdesk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-users

Reply via email to