I need to embed some custom meta data to a PDF file using the Apple’s Objective C SDK. Is there any working sample code available that does that?
What I need is very basic. Open an existing pdf and add some meta data and then save it.
Example of information stored will be like…. a customer’s name, contact number, items ordered.
I saw that this “CGPDFContextAddDocumentMetadata” supports metadata but I don’t know how the meta data look like and how is it used passed to this function.
Any help will be greatly appreciated…:)
Metadata is metadata (of course, it is recommended by Adobe that you use XMP XML). So long as you create a valid CFDataRef and pass it into arg two, you’re pretty much good to go with anything. For example, here’s how to pass the string “Hello World” into a PDF’s metadata:
An XMP file might look like this: