[poppler] Patch to Get PDF ID

Albert Astals Cid aacid at kde.org
Fri Jul 16 06:11:11 PDT 2010


A Divendres, 16 de juliol de 2010, srinivas adicherla va escriure:
> Hi,
> 
>       I made a small mistake in the last patch. Attached patches will
> compile now.
> 
>    By considering valuable suggestions from all, I created 3 patches to get
>    the ID from the PDF document.
> 
>   All patches do the same. But the implementation has different. I request
>   all to give suggestions that which is the good way, and if there is any
>   other better way
>   please let  me know.
> 
>   Explanation:
> 
>   patch1:
>           Here I wrote getPermanentID() & getUpdateID() seperate functions.
>   I called these from poppler-glib to get the entire ID and return the
>   structure PopplerDocumentId.
>           But here the repetetion of the code for getting "ID" object from
>   trailer dictionary and check the conditions. To elimante that,
> 
>   pathc2:
>           I wrote one more function getID(GooString *id, int index) in
>   PDFDoc.cc, and calling this from getPermanentID() and getUpdateID(), by
>   passing appropriate index.
>           To eliminate this index thing,
> 
>   patch3:
>           I declare one enum PDFID
>                               {
>                                    permanentID,
>                                    updateID
>                               }
>                 and remove getPermanentID() and getUpdateID() functions.
>   Added getID(GooString *id, PDFID idType)
> 
>   Iam not at good in giving names to variable & functions. Please give me
>   suggestions.
> 
>   Please let me know when you commit this patch. If any of the patch is
>   considered from the above.

The patches to the poppler core look mostly ok (there are some missing free() 
in some of the branches that return error but i can fix this)

Carlos, what do you think of the patches to the glib frontend?

Albert

> 
> Thanks
> --
> A Srinivas


More information about the poppler mailing list