How to install cups-pdf?
I've tested instructions provided at Bitbucket, but doesn't seem to work on High Sierra as per:


  This package is incompatible with this version of macOS and may fail to install.


See: OSX 10.11 (El Capitan) Package Installation Failed.

So instead, I've followed the instructions at farmerswife article and installed PDFwriter instead:


Download and install the Lisanet PDFwriter installer as per instructions
After installing the PDFWriter package, go back and Show Package Contents.
From the installer, uncompress Archive.pax.gz and copy PDFwriter.ppd file into /Library/Printers/PPDs/Contents/Resources.
Now go to the Printers dialog and add the printer, choosing the Lisanet driver as explained in the documentation.


Source: PDF printing results in "empty" or "zero bytes size" PDF.