#pdftoprint.exe takes ages to process pdf files with powershell script

6 messages · Page 1 of 1 (latest)

slow pumice
#

Hi everyone
I wrote a script years ago that used pdftoprinter.exe (it was a requirement back then) but now the users are complaining about waiting time up to 10 minutes per print. Is there a native way to do this that can handle pdfs to printer a lot faster?

$Folder = "C:\Path\To\PDFs\"
$ProcessedFolder = $Folder + "Processed\"
$Files = $Folder + "*.pdf"
$AllInvoices = Get-ChildItem $Files

$AllInvoices |
    ForEach-Object {
                        # Wait parameter ensures the file is not moved before it is printed
                        Start-Process "C:\Path\To\PDFtoPrinter.exe" $_.FullName -Wait
                        Start-Sleep -Seconds 1
                        Move-Item $_.FullName -Destination $ProcessedFolder
                    } ```
sleek drift
#

not really anything native afaik.
you could try a dif util, like Sumatra
.\SumatraPDF.exe -print-to "PrinterA" "C:\Path\To.pdf

slow pumice
#

Hi Josh
Thanks for answering so quickly.
Could it be the print spoiler that takes ages to process the files? the PDFtoPrinter.exe program is on our fileserver and therefore the user runs the script and therefore traverses to our fileserver that maybe isn't performance optimized for this.

sleek drift
#

could be 100 dif things unfortunately

#

its most likely something with the printer though. You could try some different config there. No WSD port use, dif driver, etc

#

i luckily haven't had to troubleshoot printers in like 10 years so i forget a lot of it