I answered my question...both are right! To remove an entry, as per the javadocs, you need to update the map with a null value, not use the map.remove method.
So the book is right, you can remove entries with setMoreInfo, but since it's a little counter intuitive as to how to do that, I would recommend that the 3rd Edition have a quick example or sentence identifying how. :) Sorry to clog-up the list. -AJ On 2/22/2012 2:38 PM, AJ Weber wrote: > This question stems from my previous question... > > I'm trying to remove document metadata with code very similar to that in > iText In Action (2nd ed), Listing 12.2. That is, I'm retrieving the map > from the reader, and setting it on the stamper with .setMoreInfo(). > > The paragraph in the book immediately following the listing (Section > 12.1.1, page 382 in my copy) says that I should be able to "...add, > remove or replace entries in the HashMap, and put the altered metadata > in the PDF using setMoreInfo()." > > This doesn't seem to be working, and one of the comments from either > Bruno or Paulo (I'm not 100% sure who responds with the "1T3XT BVBA" > email address) seems to indicate that it isn't correct. > > Which is wrong? Is there a bug in setMoreInfo, or is the book > incorrect? Does anyone know how I can update/remove entries in the > info-dictionary using stamper? > > I'm using iText 5.1.1 with Java5. > > Thanks, > AJ > > > ------------------------------------------------------------------------------ > Virtualization& Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > 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 ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ 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