Web lists-archives.com

Re: How to create a PDF-Printer from the command line

On Sat 06 Jan 2018 at 21:02:15 +0000, Curt wrote:

> On 2018-01-06, Brian <ad44@xxxxxxxxxxxxxxx> wrote:
> > On Sat 06 Jan 2018 at 05:54:00 +0100, john doe wrote:
> >
> >> On 1/6/2018 4:06 AM, Jason wrote:
> >> > On a RasperryPi with Raspbian, I would like to create a PDF Printer to
> >> > print files to. I only know how to do this with the GUI program
> >> > system-config-printer but I don't want to install that on this
> >> > Pi. What shell command do I need to create a PDF printer on the Pi (or
> >> > on any Debian, for that matter)?
> >> > 
> >> 
> >> Why do you want to"print" if you can convert to pdf using the command line?
> >> Based on the original file extension you simply search for a utility that
> >> will convert your original file to pdf.
> >
> > How does one convert a text file to a PDF using the command line?
> >
>  unoconv -f pdf text.txt

50+ megabytes of the libreoffice stack to install, But yes, that will
do it. A sledgehammer to crack a nut.

>  cupsfilter text.txt > text.pdf

I think you mean /usr/sbin/cupsfilter, unless you are assuming a user
has to be root. I like this one; unlike unoconv, it will probably be
on the system already and the command is flexible. Unfortunately, the
output doesn't have searchable or extractable text, desirable features
in a PDF. You pays your money and ....... .

>  enscript text.txt -o - | ps2pdf - text.pdf

If UTF-8 doesn't matter to you, why indeed not use enscript?
> The above works here.

They all work here, too. As does printer-driver-cups-pdf, the OP's
target software.