Multipage PDF in PyROOT?

Hi, I’m having trouble producing a multi-page PDF using PyROOT in the IPython interpreter. I have a python list of 3 canvases, and I do this:

In [6]: canvases[0].Print("FOMsummaryRun0535.pdf[")
Info in <TCanvas::Print>: pdf file FOMsummaryRun0535.pdf has been created

In [7]: canvases[1].Print("FOMsummaryRun0535.pdf")
Info in <TCanvas::Print>: Current canvas added to pdf file FOMsummaryRun0535.pdf

In [8]: canvases[2].Print("FOMsummaryRun0535.pdf]")
Info in <TCanvas::Print>: Current canvas added to pdf file FOMsummaryRun0535.pdf

The produced file file comes out with only one page, and the page contains canvases[1]. I get the same if I add the option “pdf” to the Print() command and also if I use SaveAs() instead.

Am I doing something wrong, or does PyROOT interact weirdly with left-open pdf files?

Nevermind, I had read the part of the documentation that said

but I neglected to read the further details. Is there a way to refer to a pdf/ps file in this way without using a specific canvas? It seems weird to call Print() two additional times on canvases that are already being printed…

Hi,

may get better response on the ROOT Support forum, as this is outside my expertise and I at least don’t see anything in which way python would interact in an odd way.

Cheers,
Wim