[poppler] Patch: let Poppler::PDFConverter export also a selected number of pages

Glad Deschrijver Glad.Deschrijver at ugent.be
Fri Oct 7 08:46:24 PDT 2011


On Thursday 06 October 2011, Albert Astals Cid wrote:
> A Dimarts, 4 d'octubre de 2011, Glad Deschrijver vàreu escriure:
> > Following your request, I implemented setPageList(...) in PDFConverter.
> > In order to have a similar behavior as in PSConverter (i.e. saving the
> > selected pages to one file, and not to a file per page), I also added a
> > function savePagesAs(OutStream *outStr, std::vector<int> pagesList); to
> > PDFDoc. Since I have no PDF-hacking experience, I copied the code from
> > pdfunite.cc and adapted it to the new situation. So I hope that the code
> > is decent. At least it works perfectly on my PDF files.
> 
> I see there is quite a bit of code "copied" from the pdfunite sources, do
> you think you can make it a bit more generic so we only have one source
> and both functions use that same code?

I tried (see attachment).  I noticed that there was also quite some code 
shared with PDFDoc::savePageAs() so I put the shared code in two function 
PDFDoc::fetchPage() and PDFDoc::writePagesAndTrailer().

Best regards,
Glad

-- 
 The only way to abolish war is to make peace heroic.
      -- John Dewey, American philosopher and educator (1859-1952)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: save_selected_pages_to_pdf2.patch
Type: text/x-patch
Size: 15772 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20111007/2b8953be/attachment-0001.bin>


More information about the poppler mailing list