Trying to print 3 windows with 1 Button

I need to print 3 windows with a single button press. The 3 windows are setup as tab style navigation. I’ve recycled the following code from the forum, and I wonder if I can iterate through the windows and create a single print job with all three windows in it. Note that I am using a print to PDF, not a real printer, and I want only 1 PDF file with 3 pages(one per window). Is this in the realm of possibility or just a pipe dream?

windowName = system.nav.getCurrentWindow()
try:
    rc = system.gui.getWindow(windowName).getRootContainer()
    job = system.print.createPrintJob(rc)
    job.setMargins(0.5)
    job.showPageFormat = 1
    job.orientation = 1
    job.print()
except:
    # window not opened
    pass

If you can print them separately from one button, then as long as the pdf printer driver supports appending, then I would say yes, it would be possible.

1 Like

Thanks for the reply. I’m going to do some further testing with this, but for now I’m going to stick with just one window printing, which should provide the bare minimum to get by with for now.