How to convert html to pdf with automator

Viewed 187

I'm trying to batch convert html files to pdf on mac. I do not want to use wkhtmltopdf, because the pdf's look horrible. For the start I tried to use a script in automator I've found to convert the PDF's from the finder.

Run shell script:

for theFileToProcess in "$@"
do
cupsfilter "$theFileToProcess" > "${theFileToProcess%.*}.pdf"
done

When I run it on a html file in Finder, I get the error:

The action "Run Shell Script" encountered an error: "cupsfilter: No filter to convert from text/html to application/pdf."

What does it mean and how to fix this?

UPDATE:

I found out the CUPS-PDF ist no longer supported in Catalina. I've installed RWTS PDFwriter as the new printing driver. But how can I activate it in the automator script?

0 Answers
Related