Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: iText - PdfRead - get Title, Author, Keywords,...

15 views
Skip to first unread message

wheresjim

unread,
Feb 16, 2006, 3:23:59 PM2/16/06
to
Valerio Wrote:

>Hi,
>I'm using the iText library to add some form and some javascript to an
>existing pdf (I read the original pdf and I copy everithing in it to
>the new file, adding to it the field and the javascript)
>It works fine, but I don't knok how to get the title, the author, the
>keyword,... from the original pdf.
>Another problem is that I can't copy the hyperlink in the original
>file...

>I use the method described by Bruno Lowagie in the chapter 13 of iText
>tutorial (Chap13_pdfreader.java)

>Can anyone help me?

>Thanks, Valerio

No one had answered this query, and I found the answer so I thought I'd
share:


PdfReader reader = new PdfReader("yourpdf.pdf");
HashMap map= reader.getInfo();
Set keys = map.keySet();
Iterator i = keys.iterator();

while(i.hasNext()) {
String thiskey = (String)i.next();
System.out.println(thiskey + ":" + (String)map.get(thiskey));
}

0 new messages