<div class="gmail_quote">2011/11/7 Zoltán Vörös <span dir="ltr"><<a href="mailto:zvoros@gmail.com">zvoros@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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<br>
<br>
surface = cairo.PDFSurface('pdffile.pdf'<u></u>, 504, 648);<br>
cr = cairo.Context(surface)<br>
cr.set_source_surface(self.<u></u>surface, 0, 0)<br>
cr.paint()<br>
<br>
self.page += 1<br>
self.path = self.pages[self.page] # we show another page<br>
self.draw_note(self.widget('<u></u>draw'), self.path) # This redraws the surface on gtk drawable, which is self.surface<br>
cr.set_source_surface(self.<u></u>surface, 0, 0)<br>
<br>
cr.copy_page()<br>
cr.show_page()<br>
<br>
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.<br></blockquote><div><br>
</div><div>I have zero experience with using this API, but to me it looks like you are doing to the context:</div><div><br></div><div>1. paint the page 1 from self.surface</div><div>2. set source surface to self.surface (now containing page 2)</div>
<div>3. copy the current page (which I guess would be page 1 since nothing is telling otherwise), possibly including an implicit show_page()?</div><div>4. show(create?) the (copy of?) next page</div><div><br></div><div>So at no point is the page 2 painted to the context as far as I understand it. You should probably be calling show_page() after paint() of 1st page, and do the same after paint()ing the 2nd page, and not call copy_page() at all. </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Well, any hints would be appreciated.<br></blockquote><div><br></div><div>I hope my guesses are correct rather than just confusing :)</div><div><br></div><div>-- </div></div>Kalle Vahlman, <a href="mailto:zuh@iki.fi" target="_blank">zuh@iki.fi</a><br>
Powered by <a href="http://movial.com" target="_blank">http://movial.com</a><br>Interesting stuff at <a href="http://sandbox.movial.com" target="_blank">http://sandbox.movial.com</a><br><br>