I have stumbled upon a bug in ROOT’s multi-page pdf output [v. 5.34.18]: It seems that appending a page that is larger than the previous page (or the first page?) does not work as expected. You can find the test code below. Note that executing this code will produce a file named test.pdf (and overwrite if it exists).
[Bug Description]: Notice that [quote]c1[/quote] and [quote]c2[/quote] have significantly differing dimensions. If you check the output pdf you will notice that the sizing of the second page is wrong. It does not correspond to the specified size (aspect ratio of 1:3).
This seems to happen whenever the new size in one of the dimensions is large/significantly larger (?) than the old size.
Note that changing the order of the instructions (first printing the large canvas, then the small one) results in the correct pdf.
[Example Code]:
{
TCanvas * c1 = new TCanvas( "c1", "", 500, 500 );
c1->Print( "test.pdf[" );
TH1F * h1 = new TH1F( "", "", 10, -5, 5 );
h1->FillRandom( "gaus" );
h1->Draw();
c1->Print( "test.pdf" );
TCanvas * c2 = new TCanvas( "c2", "", 500, 1500 );
TH1F * h2 = new TH1F( "", "", 10, -5, 5 );
h2->FillRandom( "landau" );
h2->Draw();
c2->Print( "test.pdf" );
c2->Print( "test.pdf]" );
}