PDF generation from command line

On Mac — I would advide in checking out Keyboard Maestro, which could help automate things that are not easily accessible for automation. It would invoke the GUI, and there will be significant overhead compared to a command line option (which I am not aware of) but it will work given some time setting up the macro.