Save 2 canvases to pdf

Hi,
I have 2 canvases full of TPads (2x3 each).
I’m trying to save them to one, multi-page pdf:

allCanv->Print(“RampAnalysis.pdf[”,“pdf”);
allCanv->Print(“RampAnalysis.pdf”,“pdf”);
allCanv2->Print(“RampAnalysis.pdf”,“pdf”);
allCanv2->Print(“RampAnalysis.pdf]”,“pdf”);

(I have actually tried several combinations…) but the pdf which is produced is not good:
xpdf RampAnalysis.pdf
Syntax Error: Couldn’t read xref table
Syntax Warning: PDF file is damaged - attempting to reconstruct xref table…
Syntax Error: Couldn’t find trailer dictionary
Syntax Error: Couldn’t read xref table

what am I doning wrong?

Cheers,

 Mariusz

I will try but, pdf printing is supposed to work on the whole canvas not just only sub-pads.

Sorry, I was not precise. I have 2 canvases allCanv and allCanv2. I want to print them on two pages of pdf file.
This is how I get the error. Root 5.34 running on fedora 16.

Cheers, Mariusz

for me this one is ok:

{

TFile f("hsimple.root","READ");

c1 = new TCanvas("c1","c1",200,10,700,500);
c2 = new TCanvas("c2","c2",200,300,700,500);

c1->cd(); hpx->Draw();
c2->cd(); hpx->Draw();

c1->Print("h1.pdf[");
c2->Print("h1.pdf");
c2->Print("h1.pdf");
c1->Print("h1.pdf");
c1->Print("h1.pdf]");

}

Thanks. It turned out that my problem was not related to pdf printing itself.

Cheers, Mariusz

[quote=“couet”]for me this one is ok:

[code]
{

TFile f(“hsimple.root”,“READ”);

c1 = new TCanvas(“c1”,“c1”,200,10,700,500);
c2 = new TCanvas(“c2”,“c2”,200,300,700,500);

c1->cd(); hpx->Draw();
c2->cd(); hpx->Draw();

c1->Print(“h1.pdf[”);
c2->Print(“h1.pdf”);
c2->Print(“h1.pdf”);
c1->Print(“h1.pdf”);
c1->Print(“h1.pdf]”);

}

[/code][/quote]