Any alternative to my Text2PDF convertion rule?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

For years I've had a Hazel rule that uses Phil Smith's free Text2PDF app to convert spool files from an old Unix server to PDF and it's worked flawlessly. These spool files have different line lengths, so I tweak the rule depending on the specific spool file to allow the print to be as large as I can (some reported are pretty wide & need a smaller font to fit on the line).

The issue I now have is that under MacOS Ventura the outputted PDF appears to be blank, but isn't. I can highlight the invisible text, then copy & paste it into a text editor so it's still there. If I try to display the PDF with Preview, FineReader or NitroPDF(PDFPen) it appears blank on Ventura, but that same file displays correctly on on older MacOS versions, and on Windows PCs.

I've replicated this problem on another Ventura PC, so it's not down to any corruption in my install.

Having researched the issue it appears many people have similar problems displaying some PDFs on Ventura, so I'm looking for an alternative script to achieve the same result. PDFs generated by MS Word & by my Fujitsu scanner display just fine on Ventura by the way.

Does anyone have a script to convert a .txt file to PDF where you can specify font, size, line spacing etc?


Heres my original script:
Code: Select all
# Remove the file extension .spl.stripped
# If the extension changes, change it accordingly
fileNoExt="${1%.spl}"
inputFile="$1"
tempFile="$fileNoExt.stripped"
outputFile="$fileNoExt.pdf"

tr -d '\000' < "$inputFile" > "$tempFile"
truncate -s -3 "$tempFile"

fontSize=8
args="-fCourierNewPSMT -L -A4 -c250 -s$fontSize -v8"

# $args left intentionally unquoted so the individual globs expand
/usr/local/bin/text2pdf.app $args "$tempFile" > "$outputFile"

rm "$inputFile" "$tempFile"

The early lines simply remove characters in the spool file I don't want to print. The outputted PDF file looks fine on earlier MacOS & Windows.

Thank you in advance for any help.
MacOCD
 
Posts: 44
Joined: Fri Sep 26, 2014 11:02 am

Return to Support

cron