[poppler] [PATCH] glib ps export api change
krh at bitplanet.net
Tue May 17 16:44:10 PDT 2005
On Tue, 2005-05-17 at 10:36 +0200, Marco Pesenti Gritti wrote:
> what about the attached patch? It seem more convenient than using a
> GList... for further convenience we could add an add_page api too, but
> that's not necessary yet...
Yeah, I like that idea, but I think we could make the API even simpler.
How about just these three functions:
poppler_ps_file_new (PopplerDocument *document, const char *filename);
poppler_ps_file_add_page_range (PopplerPSFile *ps_file,
poppler_ps_file_destroy (PopplerPSFile *ps_file);
Specifically, we remove poppler_page_render_to_ps(). With this API you
create the file, add the ranges you want to print to the file and then
destroy it. For starters, we'll only support adding one page range, but
if necessary, we can add support for several page ranges later, as your
comment in the patch says. New patch attached.
> On 5/16/05, Kristian Høgsberg <krh at bitplanet.net> wrote:
> > On Wed, 2005-05-11 at 10:20 +0200, Juerg Billeter wrote:
> > > Implementing page range print support in evince revealed that
> > > poppler_ps_file_new in the glib binding lacks parameters for specifying
> > > the print range, the total number of pages doesn't suffice.
> > How does this work if we only want to print even pages or odd pages?
> > Browsing through PSOutputDev.cc it looks like first_page and last_page
> > are used for two things: figuring out how many pages to print (last_page
> > - first_page + 1) and calculating the bounding box of those pages. From
> > a poppler point of view (i.e. wether or not evince is going to support
> > this) I think we should export API to print an arbitrary subset of pages
> > to postscript. Not sure what the API should be... Albert suggested
> > taking a list of pages to print which certainly would work.
> > Maybe what we should do is to make a poppler_document_print_range(int
> > first, int last) method, which allows us to add
> > poppler_document_print_subset(GList *pages) later, when necessary.
> > cheers,
> > Kristian
> > _______________________________________________
> > poppler mailing list
> > poppler at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/poppler
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 9081 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20050517/a2e7d147/print-page-range.bin
More information about the poppler