TCanvas::Print() strange behaviour

Hi,
today I wanted to print a canvas using the menu (I am not sure that I ever tried to do that
before) so I clicked the canvas menu on “File” and then “Print” (see attached gif).

A box came up asking me for a printing command and a printer name. Note that the printer name
came from a pulldown menu that showed all my installed printers correctly.
But ROOT told me this:

root [1] Info in TCanvas::Print: pdf file /tmp/rootprinthkQO69.pdf has been created
lp: Error - unable to access “aeal2bw2” - No such file or directory
This is the end of ROOT – Goodbye

pccalcaterra2:~/GEMs$ dir /tmp/rootprinthkQO69.pdf
ls: cannot access /tmp/rootprinthkQO69.pdf: No such file or directory
pccalcaterra2:~/GEMs$ dir /tmp/rootprinthkQO69
-rw-------. 1 acal acal 0 2016-03-01 13:18 /tmp/rootprinthkQO69

Now, apart from the fact that “file /tmp/rootprinthkQO69.pdf” was not written at all (0 bytes),
and in any case without any .pdf extension, why did “lp” seem to think that “aeal2bw2”
was the file to be printed, while it is the printing queue instead?

What is supposed to be the command that ROOT (5.34 BTW) passes to my system
(Scientific Linux 6.7, btw again) to obtain the magic printing.

Thanks! Sandro Calcaterra


I am not sure that sending directly to the printer is a good idea… I never do that. I always generate the file first. Does it work if you just generate the pdf ?

Yes of course it works! I also “almost” always obtain first a .pdf file from SaveAs
and then I look at/print it later.

But I cannot see why it should it be a bad idea.
And then again, if it is a bad idea, why not just eliminate the “Print” menu choice?

I use ROOT since 20 years, and the whole thing is admirable, useful and necessary.
Still, after all these years, you still find now and then these annoying corners
where somebody coded something just plain silly, and nobody ever took the pain to fix.

Thanks for your reply anyway.
AC.

Indeed, it seems it is a bug. You should report it on JIRA bugtracker.

@ACalcaterra

Sorry I do not meant I will not look at it … Of course I will …

root [1] Info in <TCanvas::Print>: pdf file /tmp/rootprinthkQO69.pdf has been created
lp: Error - unable to access "aeal2bw2" - No such file or directory
This is the end of ROOT -- Goodbye

Can you tell me what is your printer command ?
Thanks.

Hi, I am told that Linux system today have an “lp” command that interfaces to CUPS.

By experimenting, I guessed that the command sent by ROOT is probably

“lp aeal2bw2 file.pdf” instead of “lp -d aeal2bw2 file.pdf”

that is, the option characters “-d” are missing and “lp” thinks that aeal2bw2 is a file
to be printed. If I enter “lp -d” as a command, then I can print from the grey box.

Thanks for your help! AC.