[poppler] Incremental update in poppler

Leonard Rosenthol leonardr at pdfsages.com
Tue Jul 11 14:19:53 PDT 2006


At 04:34 PM 7/11/2006, Julien Rebetez wrote:
>I started to implement pdf write support in poppler through incremental
>update, you can find my current patch here (it also contains the
>interactive form part.. and it's far from finished):

         I still think this is the wrong approach to the 
problem...and you would be MUCH better off working on implementing 
better object support in Xpdf and then a full "write from scratch" feature.


>The main change is the addition of the 'addIncrementalObject' function
>to PDFDoc :
>When you call this function, the object given as argument is 'queued' in
>the document.

         So then all new objects are indirect?  How do you plan to 
handle direct objects?


>The next time 'PDFDoc::SaveAs' is called, all the queued objects are
>written (with a new XRef/Trailer and all the needed stuff) to the file.

         What are you doing about existing Linearization?  You can't 
keep it there as it is no out of sync with the new data you've written...


>This part works almost correctly (though Acrobat wants to repair the
>updated file before reading it).

         If Acrobat wants to repair, that means that it is NOT 
working correctly.  Open it back up with Poppler or Xpdf and watch 
for error messages.


>The last point is not implemented at the moment (you can 'simulate it'
>by saving the document and re-opening it) because Object are only
>written to the file when PDFDoc::SaveAs is called.

         Also, I suspect that you aren't rewriting Appearance streams 
for you fields - which means that Acrobat will display them incorrectly.


>I'm not a Poppler-guru, but the only way I see to add this 'live update'
>feature is that PDFDoc::addIncrementalObject should add the updated
>Object/Xref/Trailer directly into the stream.

         Or follow my original suggestion of doing real object 
handling in Xpdf - which would then enable live changes/updates to any object.


Leonard

---------------------------------------------------------------------------
Leonard Rosenthol                            <mailto:leonardr at pdfsages.com>
Chief Technical Officer                      <http://www.pdfsages.com>
PDF Sages, Inc.                              215-938-7080 (voice)
                                              215-938-0880 (fax)



More information about the poppler mailing list