It's really simple. Just open the device, giving it the number of pages you 
want to print. Then start the page, the set the scale to some value that gives 
you enough room to fit everything on your page.

Now simply call the FLTK drawing command, just like you would inside 
someWidget::draw(). Then end the page and print the next one.

Finally, close the device.

  // print pages
  Fl_Printer * p = new Fl_Printer();
  if (!p->start_job(num_windows)) {
    // Print each page...
    for (page = 0; page<n; page++) {
      int width, heightl
      p->start_page();
      p->printable_rect(&width, &height);
      
      // draw a headline
      fltk3::font(fltk3::HELVETICA_BOLD, 12);
      fltk3::color(0, 0, 0);
      fltk3::draw("It's really simple.", width/2, 32);

      // set the scale, if needed (default is 72dpi)
      p->scale(scale, scale);
      // print more

      p->end_page();
    }
    p->end_job();
  }
  delete p;




On 07.08.2011, at 23:16, Richard Sanders wrote:

> I need to print a page that is has more text lines than the window (or
> screen).
> 
> I am not having a problem printing things. I am wondering if anyone
> has experience printing a multi page document who would share their
> insites (rather than me re inventing thew wheel). 
> 
> _______________________________________________
> fltk mailing list
> [email protected]
> http://lists.easysw.com/mailman/listinfo/fltk

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to