User Tools

Site Tools


ubuntu:pdf:print_to_pdf

Ubuntu - PDF - Print to pdf

Print to pdf from the command line.

1. Install cups and cups-pdf.

apt-get install cups cups-pdf

2. Check which printer is available:

lpstat -p -d 
 
printer Cups-PDF is idle.  enabled since Wed 10 Jul 2013 09:30:05 AM EST
 
no system default destination

where:

  • lpstat is to show cups status information.
  • -p is to tell lpstat to list all printers available.
  • -d is to show the current default destination. In this case, this system has one printer installed, which is Cups-PDF.

3. To print, the lpr command is needed:

echo "Printing some characters to a pdf file" | lpr -P Cups-PDF -J print01.pdf

where

  • -P is to specify the printer name that you want to use.
  • -J is for the output file name.

The file will be saved in ~/Desktop, but this can be changed in /etc/cups/cups-pdf.conf.

ubuntu/pdf/print_to_pdf.txt · Last modified: 2020/07/15 10:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki