Tuesday, May 11, 2021

#1 2021-04-18 06:15:54 am

ldicroce
Member
Registered: 2017-11-25
Posts: 235

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.
Thanks!
L

Applescript:

on processFile(thePOSIXFileName)
   try
       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

Offline

 

#2 2021-04-18 01:48:28 pm

KniazidisR
Member
From:: Greece
Registered: 2019-03-03
Posts: 1797

Re: Converting rtf file into PDF

ldicroce wrote:

Any suggestion that does not imply using UI is appreciated.


See post #6 from Shane Stanley -

HERE (clickable reference)

Last edited by KniazidisR (2021-04-18 01:49:44 pm)


Model: MacBook Pro
OS X: Catalina 10.15.4
Web Browser: Safari 14.1
Ram: 4 GB

Offline

 

#3 2021-04-19 05:30:57 am

ldicroce
Member
Registered: 2017-11-25
Posts: 235

Re: Converting rtf file into PDF

KniazidisR wrote:

nSee post #6 from Shane Stanley -
HERE (clickable reference)

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

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)