Hi Dom

 

I tried that like in impose.. first when running in Debug on windows very slow, 
I believe it is the mem checking on STL library. However I found that I doubled 
up on all dictionaries that included Dictionaries and Arrays with arrays etc...

 

So like impose, I scan and mark those objs used by the Page resources and also 
group dictionary. I then add the new Xobj, mark that as well, when I have 
finished all the Xobjs.  Then write these marked OBJ's at the beginning of the 
new PDF, works well so far with about 30 ish test PDF I have tried. I will 
probably keep trying to work on this and seeing if it can be improved..

 

I was look into the standard create Xobj, I think it would not be hard to clean 
up the basic function, FillXObjectFromDocumentPage 

 // TODO: remove unused objects: page, ... 

 

However if I wanted more than 1 page converted into a XOBJ you need a way to 
check exsiting objs so as not to duplicated them. I have not thought of a way 
to do that yet.. unless you pass in an array of pages you wish converted into 
Xobjs'

 

Regards

Harald

 
> From: [email protected]
> To: [email protected]
> Subject: Re: [Podofo-users] Deleting and renumbering Objects..
> Date: Sun, 16 May 2010 23:20:06 +0100
> CC: [email protected]
> 
> Hi,
> 
> Take a look at PdfVecObjects::RenumberObjects. It should do exactly what you 
> want, but beware: scanning every object and reference takes it's time. I 
> think 
> the algorithm is O(n^2), so if you have a large PDF it might not be the best 
> choice. It could be faster to create a new PDF with all required objects from 
> scratch and getting the references right from the start.
> 
> Best regards, 
> Dom
> 
> Am Donnerstag 13 Mai 2010 schrieb Harald Weinhandl:
> > Hi
> > 
> > 
> > 
> > I am embeding a PDF in another PDF , create XOBJ and add them to the PDF at
> > the end.
> > 
> > 
> > 
> > Scan through the PDF and mark all Obj references and inhereted references
> > needed for the page / pages, store these references in a container..
> > 
> > 
> > 
> > In my new PDF , I just write only these objects into the new PDF, along
> > with the new XOBJ's, all works fine.
> > 
> > 
> > 
> > However of course I have may have many blanks OBJ's which apart from a
> > large XREF block full of unsued entries, is not a real problem.. If I have
> > a large PDF and only want to select a single page, it works the file is
> > small as I only have the data needed for that page/xobj. I would like to
> > know if there is a way to just delete unused objects and that the left
> > over Objs are reordered but also all the inderect and direct refernces.
> > 
> > I tried a few methods , but since every reference needs to be updated ,is
> > there a simple way of doing this ?
> > 
> > 
> > 
> > Regards
> > 
> > Harald
> > 
> > _________________________________________________________________
> > Need a new place to live? Find it on Domain.com.au
> > http://clk.atdmt.com/NMN/go/157631292/direct/01/
> > 
> 
> 
> -- 
> **********************************************************************
> Dominik Seichter - [email protected]
> KRename - http://www.krename.net - Powerful batch renamer for KDE
> KBarcode - http://www.kbarcode.net - Barcode and label printing
> PoDoFo - http://podofo.sf.net - PDF generation and parsing library
> SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game, for KDE
> Alan - http://alan.sf.net - A Turing Machine in Java
> **********************************************************************
                                          
_________________________________________________________________
New, Used, Demo, Dealer or Private? Find it at CarPoint.com.au
http://clk.atdmt.com/NMN/go/206222968/direct/01/
------------------------------------------------------------------------------

_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to