• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Read/write XMP Metadata

Guest
Jan 09, 2008 Jan 09, 2008

Copy link to clipboard

Copied

can anyone advise on how to read and write XMP metadata using the version of iText that ships with CF8?

we've successfully written XMP metadata into a PDF (see attached proof-of-concept code bolted together from a couple of sources), but this metadata doesn't display within Acrobat Pro 7's File Properties - Additional Metadata and also doesn't appear to be readable using iText's PDFReader class to read the same file (via PdfReader.getMetadata()).

we've compared the raw file output between a CF-generated iText-created PDF and a PDF containing readable metadata created with another app. the CF iText PDF is adding XMP header/footer XML to the RDF packet towards the tail of the PDF stream, and is not adding RDF metadata to the head of the PDF file.

we've also tried creating our own XMPSchema with our custom namespace, but get an instantiation error when trying to create the new XMPSchema.
TOPICS
Advanced techniques

Views

2.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Jan 10, 2008 Jan 10, 2008
The XmpArray constructor expects one of the constant values. Not the literal string "UNORDERED".

Change your instantiation code from this
subject = CreateObject("java","com.lowagie.text.xml.xmp.XmpArray").init("UNORDERED");

To this
XmpArray = CreateObject("java","com.lowagie.text.xml.xmp.XmpArray");
subject = XmpArray.init(XmpArray.UNORDERED);

Votes

Translate

Translate
Valorous Hero ,
Jan 10, 2008 Jan 10, 2008

Copy link to clipboard

Copied

The XmpArray constructor expects one of the constant values. Not the literal string "UNORDERED".

Change your instantiation code from this
subject = CreateObject("java","com.lowagie.text.xml.xmp.XmpArray").init("UNORDERED");

To this
XmpArray = CreateObject("java","com.lowagie.text.xml.xmp.XmpArray");
subject = XmpArray.init(XmpArray.UNORDERED);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 10, 2008 Jan 10, 2008

Copy link to clipboard

Copied

my bad, thank you. Acrobat is now reading the XMP data correctly.

EDITED Jan 2008 to add XMP getMetadata() example code... hope this helps someone.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 10, 2008 Jan 10, 2008

Copy link to clipboard

Copied

LATEST
You are welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation