pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkuehler <andr...@lehmi.de>
Subject Re: OPI Support
Date Tue, 16 Oct 2012 18:04:13 GMT
Hi,

Am 16.10.2012 09:15, schrieb Erik Scholtz:
> Hi everybody,
>
> Since version 1.2 (Acrobat 3) on, PDF supports OPI. From PDF 1.3 onwards, both
> OPI 1.3 and 2.0 comments are supported.
> Nowadays it is usual, to use the XMP-Metadata: But I have a lot of old
> PDF-files, still containing OPI-Metadata and no XMP-Metadata.
>
> Does anyone of you have a glue, how to get the OPI-data from these PDF with
> pdfbox to work with them?
I don't know what OPI is in detail but according to the pdf specs OPI data may 
occur within XObjectImages and XObjectForms.

ExtractImages [1] demonstrates where to look for those XObjects. PDFBox doesn't 
provide a getter for those OPI data so that you have to get them like this:

XObjectImage xobject = ....
COSDictionary opi = (COSDictionary)xobject.getCOSStream()
				.getDictionaryObject("OPI");

The opi dictionary should contain the data you are looking for.

> Thanks in advance,
> Erik


BR
Andreas Lehmkühler

[1] 
http://svn.apache.org/repos/asf/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/ExtractImages.java

Mime
View raw message