Posts

Showing posts from May, 2025

How to batch convert PDFs to Non OCR Pdfs

 I had a niche case where we were providing documents to an entity and wanted to ensure they were non ocr. For this we use Ghostscript and powershell to make this happen. Key takes: You need to ensure your path to ghostscript is set. Mine is C:\Program Files\gs\gs10.05.1\bin\gswin64c.exe. Ghostscript download: https://ghostscript.com/releases/gsdnld.html  The script will prompt you for the input folder and the destination folder as well. Save it in notepad as a .ps1 file to the destination of your choice.  Run the script and enjoy! Code: Add-Type -AssemblyName System.Windows.Forms # Prompt for source folder $sourceDialog = New-Object System.Windows.Forms.FolderBrowserDialog $sourceDialog.Description = "Select the folder with original PDFs" $null = $sourceDialog.ShowDialog() $sourceFolder = $sourceDialog.SelectedPath # Prompt for destination folder $destDialog = New-Object System.Windows.Forms.FolderBrowserDialog $destDialog.Description = "Select the folder to...