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

Glad Deschrijver glad.deschrijver at gmail.com
Tue Oct 4 11:00:16 PDT 2011


Hi,

Thanks Albert for committing my previous patches.

On Saturday 01 October 2011, Albert Astals Cid wrote:
> A Dijous, 29 de setembre de 2011, vàreu escriure:
> > I also want to be able to save a single page from a PDF file in a new PDF
> > file. I guess the cleanest way to do this will be to add a function
> > "savePageAs(const QString &exportFilePath, int page)" to
> > Poppler::Document. Is that OK?
> 
> No, please add a void setPageList(const QList<int> &pageList); like we have
> in PSConverter.
> 
> Also it would be great if instead of sending the patches to me directly you
> uses the poppler mailing list at
> http://lists.freedesktop.org/mailman/listinfo/poppler

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.

Best regards,
Glad

-- 
 Truth is stranger than fiction, but it is because fiction is obliged
 to stick to possibilities. Truth isn't.
      -- Mark Twain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: save_selected_pages_to_pdf.patch
Type: text/x-patch
Size: 5676 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20111004/187cc1e6/attachment.bin>


More information about the poppler mailing list