Olivier BASTIN (506) wrote:

Hi,

How to retrieve the pdf title?
You'd need something like this:
PdfReader reader = new PdfReader("my.pdf");
Map info = reader.getInfo();
String title = info.get("Title");

I have try with this code:

        private static void getTitle(AcroFields form, PdfStamper
stamper, PdfReader reader)
        {
        ...
                PdfDictionary dictionary = reader.getCatalog();
                System.out.println(dictionary.get(PdfName.TITLE));
        ...
        }
        
The value is null.

Note that the Catalog is not the same as the Information Dictionary.
You will find a reference to the Info Dictionary in the trailer, not
in the Root Dictionary (= Catalog).
br,
Bruno


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to