Leonard Rosenthol <leonardr <at> pdfsages.com> writes:

> 
> At 12:54 PM 11/8/2004, Sven Henckel wrote:
> >How is it possible with iText to read the output intent of a PDF document?
> 
>          First, you need to know that not all PDF's have an output intent - 
> only those that are PDF/X compliant.
> 
>          However, given a PDF with one present, you can use the low level 
> object classes to get to the appropriate object in the tree and read the 
> data.  An array of intents can be found off the /OutputIntents key of the 
> Catalog/Root object.
> 
> Leonard

Thanks for your quick response!

Now, I can get some information about the output intent. Is it also possible to
extract an included ICC profile?
Maybe with the PRIndirectRreference...?

PdfDictionary dictionary = reader.getCatalog();
PdfArray pdfArray = (PdfArray)dictionary.get(PdfName.OUTPUTINTENTS);
if (pdfArray != null) {
    ArrayList list = pdfArray.getArrayList();
    for (int i = 0; i < list.size(); i++) {
        PdfDictionary dict = (PdfDictionary)list.get(i);
        Set set = dict.getKeys();
        for (Iterator iterator = set.iterator(); iterator.hasNext();) {
            PdfName key = (PdfName)iterator.next();
            String value = dict.get(key).toString();
            System.out.println(key.toString() + " = " + value);
            
            if (key.equals(PdfName.DESTOUTPUTPROFILE)) {
                PRIndirectReference indirectReference =
(PRIndirectReference)dict.get(key);
                PdfReader irReader = indirectReference.getReader();
                // what to to?
            }
        }
    }
}



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to