# Gtk::PrintOperation prints only first page

**URL:** <https://www.ruby-forum.com/t/gtk-printoperation-prints-only-first-page/82079>\
**Category:** Ruby-Gnome 2\
**Created:** [January 17, 2007, 10:14am UTC](https://www.ruby-forum.com/t/gtk-printoperation-prints-only-first-page/82079 "2007-01-17T10:14:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [January 17, 2007, 10:14am UTC](https://www.ruby-forum.com/t/gtk-printoperation-prints-only-first-page/82079/1 "2007-01-17T10:14:32Z")

</div>

greetings,

i print the pages on Gtk::PrintOperation’s ‘draw-page’ signal, and since  
i don’t know how many pages i’m going to print, i’ve n\_pages set to 1  
before the first page, and i increase that from ‘draw-page’ if there’s  
more pages to go.

this works fine if ‘print preview’ was selected from PrintOperation’s  
run, but only the first page is printed when ‘print’ is selected.  
it looks like ‘draw-page’ does not get called when in print mode.

devs, please confirm this, and if so, please make ‘print’ as it is in  
‘print preview’  
thanks,

regards,  
balint

---

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [January 18, 2007, 2:27pm UTC](https://www.ruby-forum.com/t/gtk-printoperation-prints-only-first-page/82079/2 "2007-01-18T14:27:27Z")

</div>

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys - and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [January 18, 2007, 3:29pm UTC](https://www.ruby-forum.com/t/gtk-printoperation-prints-only-first-page/82079/3 "2007-01-18T15:29:06Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] Gtk::PrintOperation prints only first  
page” on Thu, 18 Jan 2007 15:26:08 +0200,  
Dobai-Pataky Bálint [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> i figured out, i’ll have to save my cairo context generated in PrintOperaion’s  
> paginate, and reuse it in draw-page, but i don’t know how to clone it.  
> i searched rcairo for a proper Cairo::Context.new, but found out that it needs  
> a surface first, and i got stuck there.  
> if anyone has any ideas how should i transfer the Cairo::Contexts from paginate  
> to draw-page, please help me out.

You can’t clone a Cairo::Context. You need to reuse your  
drawing operations instead of Cairo::Context. I can’t have  
any advice until you show us your sample script. (I hope the  
sample script is as small as possible.)

## Thanks,

kou

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys - and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [January 24, 2007, 4:44pm UTC](https://www.ruby-forum.com/t/gtk-printoperation-prints-only-first-page/82079/4 "2007-01-24T16:44:26Z")

</div>

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys - and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)
