Did I overlook a simple thing?

 

A: I can set Metadata using listing 12.2 in a file which has none

B: I can read Metadata which is in a file with some

C: I can change the values in the Hashmap with new ones

 

D: But when I do stamper.setMoreInfo() the values remain the same

Itext 5.1.0 running under Groovy - all fm_values are variables I send in

 

import com.itextpdf.text.pdf.PdfStamper

import com.itextpdf.text.pdf.PdfReader

 

reader = new PdfReader( fm_file )

stamper = new PdfStamper ( reader , new FileOutputStream( fm_fileOut ))

info = reader.getInfo()

 

if ( fm_subject != null) { info.put("Subject", fm_subject) }

if ( fm_author != null) { info.put("Author", fm_author) }

if ( fm_title != null) { info.put("Title", fm_title) }

if ( fm_keywords != null) { info.put("Keywords", fm_keywords) }

if ( fm_creator != null) { info.put("Creator", fm_creator) }

//return info

// unescaping this returns expected new values

 

stamper.setMoreInfo(info)

stamper.close()

 

i.e. can you REMOVE, or do you need to REMOVE metadata values first??

 

john renfrew 

Right Way Up 
Office  +44 1675 475341 
Fax      +44 1675 475342 
Mobile +44 7767 443992

 

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to