Hi,

Am Sonntag, 5. Juli 2009 schrieb Simon Glass:
> Hi,
>
> I have moved to the svn version and have got conversion to/from PDF
> working as well as adding thumbnail images to the PDF. The library seens
> to work really well, and I'm very pleased to have found it.
Great!


> Now I need to implement rearranging, deleting and inserting pages.
>
> Is there a function to delete pages? PdfPagesTree has a DeletePage
> function but it says to use the PdfDocument class instead. What is the
> recommended approach? Also, when pages are deleted, does it delete the
> content that is referred to by that page? If not, is there anything to
> scan what objects are used by a page (but not others) and delete them also?
I updated the documentation a little bit in SVN. You should use 
PdfMemDocument::DeletePages. Deleting is only possible in MemDocuments and 
not in StreamedDocuments. That's why this is not in the PdfDocument 
interface.

You are right: only the reference is deleted from the tree. If you want to 
really delete all unused objects, you have to look at every reference in 
every page to determine which objects are shared between pages. This is slow. 
If you still need it, take a look at the implementation of 
PdfVecObjects::GetObjectDependencies and PdfVecObjects::GarbageCollection .

Regarding general moving and deletion of pages: Take a look into 
podofopdfpages in the tools directory.

>
> Also a few comments: the use of inlining is a bit nasty. I think this is
> why the library doesn't work if you compile it with PODOFO_EXTRA_CHECKS
> but don't also define this in your application. Does inlining really help?
I will take a look at this. Inlining should not cause conflicts with 
PODOFO_EXTRA_CHECKS. We should avoid having inlined code within 
PODOFO_EXTRA_CHECKS. Do you know which symbol causes the problems?

>
> Secondly it could really do with about 10 solid examples, like:
>
> - scanning pages for images and locating them in the file
> - splitting a PDF into two new files with odd/even pages
> - adding thumbnails to an existing PDF
> - creating a PDF from two JPEG files
> - renaming pages of a PDF
> - others I can't immediately think of
Yes, I fully agree. One can never have enough examples. You wrote in your mail 
that you added thumbnails to a PDF successfully. Could you provide an example 
for that? Maybe we can collect a few simple examples from the users here on 
the list.

>
> None of these would be hard to do I think, am happy to help.
>
> Also is anyone working on a Qt-friendly API?
What do you mean by "Qt-friendly" ? If it is about naming of our API: I love 
the Qt API and coding style. For some reason we decided differently in the 
past and stick now to it to have a consistent code base. And, well, it is 
only naming: I have to work with so many different coding styles, so that 
this is nothing to argue about.

If it is about supporting QString etc. in our API's. I do not think that this 
is necessary. It would create a dependency to Qt which is not needed for most 
users. I am no big fan of #ifdef's so I would try to avoid ifdefs, for 
constructors that take QString and are only available in PODOFO_QT_MODE. 

As far as I know - no one is workin on anything Qt-related, so probably no.

best regards,
        Dom

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



-- 
**********************************************************************
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
**********************************************************************

Attachment: signature.asc
Description: This is a digitally signed message part.

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

Reply via email to