Re: writing multiple surfaces to a single (pdf) file

Zoltán Vörös <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Many thanks for the fast feedback!

> 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 ) 
Well, this is/was actually the problem: I did read the docs, but it is 
completely unclear to me what one is supposed to do. At the moment, I 
have this

             surface = cairo.PDFSurface('pdffile.pdf', 504, 648);
             cr = cairo.Context(surface)
             cr.set_source_surface(self.surface, 0, 0)
             cr.paint()

             self.page += 1
             self.path = self.pages[self.page]                     # we 
show another page
             self.draw_note(self.widget('draw'), self.path)   # This 
redraws the surface on gtk drawable, which is self.surface
             cr.set_source_surface(self.surface, 0, 0)

             cr.copy_page()
             cr.show_page()

and it does print two pages to the pdf file, but the two pages are the 
same. I can't get the second page to the file, though it is painted 
properly on the self.surface, so I can it in the gui.
Well, any hints would be appreciated.
Cheers,
Zoltán
--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.