[poppler] Get/Set PDF ID

Carlos Garcia Campos carlosgc at gnome.org
Fri Jun 18 04:39:00 PDT 2010


Excerpts from srinivas adicherla's message of vie jun 18 13:17:39 +0200 2010:
> Hi Carlos,
> 
>    Yes, we can fix the bug. But I need a suggestion that for setting the ID
> which is the better way?
> 
>  1) One method is using my function PDFDoc::setID(). Here I just add the ID
> to the trailer dictionary, and saving it using Incremental Update. It just
> adds few lines to the end of the pdf file containing the new trailer
> dictionary.
> 
>  2) Second method is using PDFDoc::saveAs(). we need to pass the
> writeForceRewrite mode to this function to add the ID to the document. But
> the process is slow ( it has to rewrite the all objects in the pdf). But
> still this rewriting is not working for all pdfs.
> 
> What i am thinking is let me add function setID(), and later i will fix the
> bug in the saveAs() for saveCompleteRewrite mode.
> 
> Please give me suggestions.

The thing is that I still don't see the point of allowing the user to
set the ID, it should be set automatically when the document changes.

> On Fri, Jun 18, 2010 at 4:20 PM, Carlos Garcia Campos <carlosgc at gnome.org>wrote:
> 
> > Excerpts from srinivas adicherla's message of vie jun 18 08:16:22 +0200
> > 2010:
> > > Hi,
> > >
> > >     First of all thank you all for giving me suggestions & comments. I
> > made
> > > changes to the previous patch and attached the new patch for
> > getting/setting
> > > PDF ID.
> > > I attached the patch without having the API Documentation. I will do it
> > as
> > > early as possible. I think I made indentation correctly this time. Mean
> > > while, send me suggestions/comments about this patch.
> > > If possible tell me how to add API documentation.
> > >
> > > @Carlos Garcia : I also thought that PDFDoc::SaveAS() will set the ID in
> > the
> > > document. But that is not always.
> > >
> > > In PDFDoc::saveAs(GooString *filename,PDFWriteMode mode). We have to pass
> > > the mode as writeForceRewrite then only it generates the ID and set it.
> > But
> > > I tried with some PDF files, It is setting the ID in the trailer
> > dictionary,
> > > but it is loosing the data. I don't know why it is happening.  It has
> > > happened for all pdf files I have checked so far.
> >
> > In that case it's a bug in saveAs(), let's fix it instead of adding a
> > new method to work around it.
> >
> > > Thanks
> >
-- 
Carlos Garcia Campos
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20100618/9520cd69/attachment.pgp>


More information about the poppler mailing list