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.