Print PDF from any Linux program

The CUPS PDF program saves printed PDFs to the ~/PDF directory from any program.

apt install cups-pdf

The output directory can be configured by editing the “Out” directory in /etc/cups/cups-pdf.conf

Matlab/GNU Octave figure save PDF

  • if you already have Matlab open, just restart Matlab to make the PDF printer available.
  • Workaround for Java bug stopping Matlab from printing in color–this will create a color PDF test.pdf in your current directory.


Matplotlib figure save PDF

This can be accomplished by either

  • save to PDF from the Matplotlib figure GUI
  • use figure.savefig() to save to PDF from Matplotlib. Example:

    from matplotlib.pyplot import figure
    fg = figure()
    ax = fg.gca()