Oops - apologies for not having researched the archives with the same
keywords I ended up using in my "subject" line (I searched for "addTitle("
and didn't find much).

Anyway, it does work like this and I hope the below will help others:

        PdfReader pr = new PdfReader("noMeta.pdf");
        psa = new PdfStamper(pr, new FileOutputStream(
                "withMeta.pdf"));
        HashMap moreInfo = new HashMap();
        //as per
com.lowagie.examples.general.copystamp.AddWatermarkPageNumbers.main
        moreInfo.put("Title", "thisTitle");
        moreInfo.put("Subject", "this is the subject");
        moreInfo.put("Keywords", "itext, html, pdf, document properties"));
        moreInfo.put("Creator", "java app with iText");//"Application"
        moreInfo.put("Author", "Bruno Lowagie");
        psa.setMoreInfo(moreInfo);

the above has the same effect as
- document.addSubject
- document.addKeywords
- document.addTitle
- document.addAuthor
...
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:itext-questions-
> [EMAIL PROTECTED] On Behalf Of Ralf Hauser
> Sent: Monday, August 15, 2005 6:46 PM
> To: [email protected]
> Subject: [iText-questions] how to add meta information to a document that
> is closed?
> 
> Hi,
> 
> My application creates a pdf from a html as per
> http://www.lowagie.com/iText/examples/Chap0706.java .
> 
> I want to add some meta information similar to
> http://itextdocs.lowagie.com/examples/com/lowagie/examples/general/HelloWo
> rl
> dMeta.java
> 
> If I do it before converting the html, the title, keyword, etc. is lost
> during the html conversion. If I do it afterwards, this is not possible
> because the document is already closed.
> 
> I tried to first read the document back from the written file, but I did
> not
> find a way to add the Meta info.
> 
> Any hints would be highly appreciated!
> 
>    Ralf



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to