printing PDF from a command line on Linux

2004-12-07 Thread softkol
Hi,

  Is there a way to print a PDF file to printer queue from a command line?

Best Regards,

Israel Shikler

Softkol Software Services

Phone  :  972-3-5348938
Mobile :  972-52-8885100
Fax:  972-3-5348967

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word unsubscribe in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: printing PDF from a command line on Linux

2004-12-07 Thread Jason Friedman
Hi,

I use the following small script to print a PDF from the command line
(requires that Acrobat reader (acroread) is installed).

acroread has a -toPostScript option to create a .ps file without opening
the graphical interface. I believe you can do the same thing with xpdf
using the -ps command line switch.

#!/usr/bin/tcsh
set fn = `perl -e '$_ = $ARGV[0];s/\.pdf$//;print' $1`
acroread -toPostScript $fn.pdf /tmp
lpr /tmp/$fn.ps
rm /tmp/$fn.ps

Jason

 Hi,
 
 Is there a way to print a PDF file to printer queue from a command line?
 
   Best Regards,
 
 Israel Shikler
 
 Softkol Software Services
 
 Phone:  972-3-5348938
 Mobile :972-52-8885100
 Fax  :  972-3-5348967
 
 =
 To unsubscribe, send mail to [EMAIL PROTECTED] with
 the word unsubscribe in the message body, e.g., run the command
 echo unsubscribe | mail [EMAIL PROTECTED]
 

--
Jason Friedman
Ph.D. Student
Department of Computer Science and Applied Mathematics
Weizmann Institute of Science, Rehovot, Israel.
Home page: http://www.wisdom.weizmann.ac.il/~jason



=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word unsubscribe in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: printing PDF from a command line on Linux

2004-12-07 Thread Josh Zlatin-Amishav
On Tue, 7 Dec 2004, softkol wrote:
Hi,
 Is there a way to print a PDF file to printer queue from a command line?
Hi Israel,
pdftops or pdftotext should help.
--
  - josh
GPG: 445F 7FB3 3D99 EE8C 99A4  4313 352D FFD4 02B2 C7F3
=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word unsubscribe in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]


Re: printing PDF from a command line on Linux

2004-12-07 Thread Oleg Goldshmidt
softkol [EMAIL PROTECTED] writes:

 Hi,
 
   Is there a way to print a PDF file to printer queue from a command
   line?


Have you tried 

pdf2ps file.pdf - | lpr

?

Your problem will be that the filename will not appear in the printer
queue. So write a script that does pdf2ps, lpr, and removed the ps
silently.

-- 
Oleg Goldshmidt | [EMAIL PROTECTED]

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word unsubscribe in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



RE: printing PDF from a command line on Linux

2004-12-07 Thread softkol
Oleg thanks, but I forgot to mention only one little insignificant fact: All my 
printers are PCL.

 So you suggestion will not work.

 Any other idea to make this work?

Best Regards,

Israel Shikler

Softkol Software Services

Phone  :  972-3-5348938
Mobile :  972-52-8885100
Fax:  972-3-5348967

-Original Message-
From: Oleg Goldshmidt [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 07, 2004 2:37 PM
To: softkol
Cc: [EMAIL PROTECTED]
Subject: Re: printing PDF from a command line on Linux


softkol [EMAIL PROTECTED] writes:

 Hi,
 
   Is there a way to print a PDF file to printer queue from a command
   line?


Have you tried 

pdf2ps file.pdf - | lpr

?

Your problem will be that the filename will not appear in the printer
queue. So write a script that does pdf2ps, lpr, and removed the ps
silently.

-- 
Oleg Goldshmidt | [EMAIL PROTECTED]

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word unsubscribe in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: printing PDF from a command line on Linux

2004-12-07 Thread Tzafrir Cohen
On Tue, Dec 07, 2004 at 12:36:34PM +, Oleg Goldshmidt wrote:
 softkol [EMAIL PROTECTED] writes:
 
  Hi,
  
Is there a way to print a PDF file to printer queue from a command
line?
 
 
 Have you tried 
 
 pdf2ps file.pdf - | lpr

pdftops, pdf2ps: one of them is from gs, the other is from xpdf..
Basically have the same functionality. You can also pay a bunch to Adobe
for a similar functionality in distiller.

 Your problem will be that the filename will not appear in the printer
 queue. So write a script that does pdf2ps, lpr, and removed the ps
 silently.

How about 'lpr file.pdf'? Doesn't it have print filters in place?

-- 
Tzafrir Cohen   +---+
http://www.technion.ac.il/~tzafrir/ |vim is a mutt's best friend|
mailto:[EMAIL PROTECTED]   +---+

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word unsubscribe in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: printing PDF from a command line on Linux

2004-12-07 Thread Oleg Goldshmidt
softkol [EMAIL PROTECTED] writes:

 Oleg thanks, but I forgot to mention only one little insignificant
 fact: All my printers are PCL.
 
  So you suggestion will not work.

Will not work or does not work?

I will not pretend that I am an expert on printing. Can you explain 
why this won't work? If your printer works, and if you can print on it
with lpr, then what is the problem? The idiosyncrasies of your printer
should be handled and the driver level, and the command line should
still work.

-- 
Oleg Goldshmidt | [EMAIL PROTECTED]

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word unsubscribe in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: printing PDF from a command line on Linux

2004-12-07 Thread Haggai Eran
With CUPS, lpr will convert most formats to the printer format, so you
can just use:

lpr file.pdf

About printers being pcl: usually the lpr program is configured to
convert postscript input files to whatever the printer uses, that's
why 'pdf2ps file.pdf - | lpr' should always work ok, if the printer is
configured correctly.

Haggai

On 07 Dec 2004 13:19:55 +, Oleg Goldshmidt [EMAIL PROTECTED] wrote:
 softkol [EMAIL PROTECTED] writes:
 
  Oleg thanks, but I forgot to mention only one little insignificant
  fact: All my printers are PCL.
 
   So you suggestion will not work.
 
 Will not work or does not work?
 
 I will not pretend that I am an expert on printing. Can you explain
 why this won't work? If your printer works, and if you can print on it
 with lpr, then what is the problem? The idiosyncrasies of your printer
 should be handled and the driver level, and the command line should
 still work.
 
 
 
 --
 Oleg Goldshmidt | [EMAIL PROTECTED]
 
 =
 To unsubscribe, send mail to [EMAIL PROTECTED] with
 the word unsubscribe in the message body, e.g., run the command
 echo unsubscribe | mail [EMAIL PROTECTED]
 
 


-- 
Haggai Eran

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word unsubscribe in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: printing PDF from a command line on Linux

2004-12-07 Thread Haggai Eran
Actually, I meant that cups' lpr would run pdftops for you.
It is still up to pdftops to do the translation to postscript, and
then it is up to the configured printer filter to convert the
postscript to the printer's format. You say this doesn't work, what
exactly is the error? How is your system configured? What printer do
you use?


On Tue, 07 Dec 2004 18:05:05 +0200, softkol [EMAIL PROTECTED] wrote:
 Hagai,
   Thanks but it just does not work.
 
   The pdf file I am trying to print is not just plain text , it has tt fonts 
 in Hebrew and GRAPHICS.
 
   Are you sure cups can handle it.
 
 
 
 
 Best Regards,
 
 Israel Shikler
 
 Softkol Software Services
 
 Phone  :  972-3-5348938
 Mobile :  972-52-8885100
 Fax:  972-3-5348967
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Haggai Eran
 Sent: Tuesday, December 07, 2004 5:34 PM
 To: [EMAIL PROTECTED]
 Subject: Re: printing PDF from a command line on Linux
 
 With CUPS, lpr will convert most formats to the printer format, so you
 can just use:
 
 lpr file.pdf
 
 About printers being pcl: usually the lpr program is configured to
 convert postscript input files to whatever the printer uses, that's
 why 'pdf2ps file.pdf - | lpr' should always work ok, if the printer is
 configured correctly.
 
 Haggai
 
 On 07 Dec 2004 13:19:55 +, Oleg Goldshmidt [EMAIL PROTECTED] wrote:
  softkol [EMAIL PROTECTED] writes:
 
   Oleg thanks, but I forgot to mention only one little insignificant
   fact: All my printers are PCL.
  
So you suggestion will not work.
 
  Will not work or does not work?
 
  I will not pretend that I am an expert on printing. Can you explain
  why this won't work? If your printer works, and if you can print on it
  with lpr, then what is the problem? The idiosyncrasies of your printer
  should be handled and the driver level, and the command line should
  still work.
 
 
 
  --
  Oleg Goldshmidt | [EMAIL PROTECTED]
 
  =
  To unsubscribe, send mail to [EMAIL PROTECTED] with
  the word unsubscribe in the message body, e.g., run the command
  echo unsubscribe | mail [EMAIL PROTECTED]
 
 
 
 --
 Haggai Eran
 
 =
 
 
 To unsubscribe, send mail to [EMAIL PROTECTED] with
 the word unsubscribe in the message body, e.g., run the command
 echo unsubscribe | mail [EMAIL PROTECTED]
 


-- 
Haggai Eran

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word unsubscribe in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]