Thanks for your help.

I’ve been trying to run the command-line pd4ml class but whatever I do I get:
java.io.IOException: Cannot run program “/Applications/Preview.app”: error=13, Permission denied

I’ve created a folder with completely open permissions to everyone, and I run the pd4ml class from there.
I also changed the permissions for the Mac preview app so that it has permissions to be run by any user.

The pd4ml class will open and show my simple html file when I press GO.
But will not create a .pdf when I press PDF – for the reason shown above.