I'm trying to append some content directly to the page's existing content-stream (it's already formatted with the correct operators& operands, because I removed it previously).
> What makes you think this will result in valid PDF syntax? Because I removed the exact block of PDF syntax from the stream in a previous step (and although it could be different, in this particular case, it was the last part of the Contents stream, so it's putting it back exactly where it was). >> Not only is the updated content not being written, > Maybe it is written, but not visible when you open the file in Adobe Reader. You are right here. I checked the document with RUPS, and the stream has the additional block restored to the end of it, but it is not being displayed. I'm unclear why that is, since, like I said, it's identical to what I originally removed, and in this case, it's in the exact same location of the stream. > What is ipText? Is it valid PDF syntax? Isn't it extremely dangerous > to append a snippet of PDF syntax like this? What are you trying to > achieve? It's the block of text extracted from the Contents stream in a previous step, exactly as it was in the Contents stream (it's a text block starting with BT and ending with ET). I needed a temporary place to store it with the document; I considered creating an XObject and putting it there, but it would not be referenced in the temporary PDF file, and I was theorizing it could be stripped-out during an optimization, plus I didn't see a way to add the raw PDF syntax with the iText methods. > Aha, docinfo is a dictionary. More specifically: metadata. > You're using a method to add more metadata in an attempt to remove > metadata... > Also: you are adding some existing metadata to the content stream of a page. Is there a method to remove metadata from a document (instead of setMoreInfo? ). Yes, the metadata "value" is, as I mentioned, already valid PDF syntax, because I stored it there in a previous step. > > I have no clue about what you're trying to achieve. > I only have an opinion: what you're doing is dangerous. I wouldn't do it. I appreciate your advice (very much). My only other option would be to insert the text back on the document using getOverContent (I guess), but I would have to fully parse the text block (BT...ET) so I could understand setting the font, location, text, etc. I thought extracting the block and re-inserting it exactly as it was would save me that trouble. ------------------------------------------------------------------------------ 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