skorpion wrote > I did not realize that I have to use a different OutputStream object. > > If I want overwrite the PDF file and not create a new pdf file?
In iText the PdfStamper always generates a complete new file, it does not manipulate an existing file but writes it anew. If you want your program to replace the original PDF with your manipulated one, you * either have to write to a temporary file, close everything, delete the original, and rename the temporary file; * or you have to read the original file into memory, delete the file, create a PdfReader from the in-memory document, and manipulate it using a PdfStamper writing to a new file with the name of the original file. The former way is safer: If in the process an error occurs, you at least have the original file. The latter way requires less disk memory and does not use additional (temporary) file names. -- View this message in context: http://itext-general.2136553.n4.nabble.com/Insert-custom-dictionary-in-pdf-file-tp4659026p4659050.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ 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