[cairo] writing multiple surfaces to a single (pdf) file

Andrea Canciani ranma42 at gmail.com
Sun Nov 6 12:47:30 PST 2011


2011/11/6 Zoltán Vörös <zvoros at gmail.com>:
> Hi All,
>
> I would like to ask how one can save multiple surfaces into a single pdf
> file. I know how to save a single surface, but what if I would like to write
> two surfaces to two pages of a pdf file. One example could be if I save the
> original surface, then modify, and then save the new surface. Is this
> possible, or one has to concatenate the pdf files outside?

You can do that in cairo using cairo_copy_page() or cairo_show_page().

See http://cairographics.org/manual/cairo-cairo-t.html#cairo-copy-page
and http://cairographics.org/manual/cairo-cairo-t.html#cairo-show-page

Unfortunately I cannot find any short sample that uses them...
I hope the documentation is sufficient

(The simplest reference I can provide is:
http://cgit.freedesktop.org/cairo/tree/test/multi-page.c#n106
)

Andrea

> Thanks,
> Zoltán
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>


More information about the cairo mailing list