cancel
Showing results for 
Search instead for 
Did you mean: 

acroread command line

John Talaga
Advisor

acroread command line

Hello all,

I am attempting to use acroread to print PDF files via the command line on my 11.23 installation. I have acrobat reader 7.0.9 installed and operational, but whenever I try to execute acroread from the command line I get an "Cannot open display" error. I am using PuTTY to connect, so there is no display to open.

# acroread -help

(acroread:15331): Gtk-WARNING **: cannot open display:
#
# acroread

(acroread:15358): Gtk-WARNING **: cannot open display:
#


I have successfully used acroread from an X emulator, but my ultimate goal here is to use acroread from the command line and script something that will run in cron to print PDF's automatically.

Any help or ideas are greatly appreciated.

Thanks,

--John
4 REPLIES
Michal Kapalka (mikap)
Honored Contributor

Re: acroread command line

hi,

to run the acroread, you need GUI, or exported Display to some Xserver.

acroread reuired GUI.

mikap
VK2COT
Honored Contributor

Re: acroread command line

Hello,

Did you try something like this:

# acroread -toPostScript
-size a4 myfile.pdf | lp -dmyprinter

The alternative is to try to use
Ghostscript.

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Steven Schweda
Honored Contributor

Re: acroread command line

For interactive (-looking) use, it may demand
an X display (even if it doesn't really need
one). I know nothing, but I gather that for
(very) non-interactive use (like, say,
"-toPostScript"), it may be less demanding.
John Talaga
Advisor

Re: acroread command line

Hello all,

It appears mikap is correct in that the GUI is required.

Using VK2COT's suggestion:

# acroread -toPostScript mydocument.pdf | lp -diss

(acroread:29368): Gtk-WARNING **: cannot open display:
lp: standard input is empty
lp: request not accepted
#

I missed whatever document said that an X server was required for acroread, so I am just wondering... with Ghostscript will I be able to print pdf's automatically with a Bourne shell script via cron?

Thanks all,

--John