Converting rtf file into PDF

Dear all,

a quick question: How can I convert a rtf file into PDF?
I tried to use the script provided by Apple (see below) but it fails in Big Sur, most likely because the “convert” has been moved somewhere else. I checked at “/System/Library/Printers/Libraries/./convert” but I don’t see any ‘convert’ Unix Executable File.

Any suggestion that does not imply using UI is appreciated.

on processFile(thePOSIXFileName)
		set terminalCommand to ""
		set convertCommand to "/System/Library/Printers/Libraries/./convert "
		set newFileName to thePOSIXFileName & ".pdf"
		set terminalCommand to convertCommand & "-f " & "\"" & thePOSIXFileName & "\"" & " -o " & "\"" & newFileName & "\"" & " -j \"application/pdf\""
		do shell script terminalCommand
	end try
end processFile

See post #6 from Shane Stanley -

HERE (clickable reference)

Thanks Robert.
I was hoping for something simper, but this routine from Shane provides more flexibility.