Its sounds to me like you have "append changes" turned on.  You guessed
right about the "history".  In append mode, changes are tacked onto the
end of the PDF.  This is the only way to make changes to a PDF without
destroying filled signatures and/or Usage Rights ("reader enabled"
PDFs).
 
Paulo's right about memory/file usage too, when calling "setField"
repeatedly, and the file would reflect it if you saved after N "set"
calls.  I think this would be caused not by the actual value changes (a
PdfString inside a dictionary gets changed, you just rewrite the dict,
you don't add additional objects), but by the generated appearances,
which are separate objects (several, each time).  Those PdfStreams will
loiter in the cross reference table and be written to the file unless
you called removeUnusedObjects(), per his suggestion.
 
Just feeling verbose this morning.  Must be the "10 kinds of people"
t-shirt I'm wearing:  "There are 10 kinds of people in the world, those
who understand binary, and those who don't".
 
 
--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
 
 


________________________________

        From: Paulo Soares [mailto:[email protected]] 
        Sent: Saturday, November 20, 2010 1:32 AM
        To: Post all your questions about iText here
        Subject: Re: [iText-questions] AcroFields.setField increasing
the size ofPDFdramatically
        
        
        Calling setField repeatedly will leave the previous value
behind. You'll have to reload the pdf and call
PdfReader.removeUnusedObjects() to clean up.
         
        Paulo

                ----- Original Message ----- 
                From: rocky.madden <mailto:[email protected]>  
                To: [email protected] 
                Sent: Friday, November 19, 2010 11:13 PM
                Subject: [iText-questions] AcroFields.setField
increasing the size of PDFdramatically


                I am using PdfStamper to update a field within a PDF via
the
                AcroFields.setField method. All works well, however in
load testing on the
                same field with random values I have noticed that each
time this method is
                invoked it increases the size of the PDF (e.g. The data
for this field is
                just a random string which is replaced, not appended).
Is there a "history"
                or some other log held each time this method invoked? If
so, is there a way
                to remove such information from the PDF? Looping over
this method 10,000
                iterations increases a 270k file to over 6,000k.
                -- 
                View this message in context:
http://itext-general.2136553.n4.nabble.com/AcroFields-setField-increasin
g-the-size-of-PDF-dramatically-tp3051129p3051129.html
                Sent from the iText - General mailing list archive at
Nabble.com.
                
        
------------------------------------------------------------------------
------
                Beautiful is writing same markup. Internet Explorer 9
supports
                standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and
DOM L2 & L3.
                Spend less time writing and  rewriting code and more
time creating great
                experiences on the web. Be a part of the beta today
                http://p.sf.net/sfu/msIE9-sfdev2dev
                _______________________________________________
                iText-questions mailing list
                [email protected]
        
https://lists.sourceforge.net/lists/listinfo/itext-questions
                
                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

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

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