Print into a file ( instead of physical printer ) in VBNet
Copy link to clipboard
Copied
Hello,
Trying to print a pdf file into a file using this code in VBnet ... which doesn't work
Dim pathToExecutable As String = "AcroRd32.exe"
Dim sReport = "F:\my_pdf_inputfile.pdf"
Dim SPrinter = "F:\my_pdf_outputfile.txt"
Dim starter As New ProcessStartInfo(pathToExecutable, " /t " + sReport + " " + SPrinter + "")
Dim Process As New Process()
Process.StartInfo = starter
Process.Start()
Process.Close()
Process.Dispose()
But, even if no error, nothing is creating in my output file and also I would like to avoid the opening of the
AdoveAcrobatReader DC screen.
Any guidelines please.
Thank you
Regards
Pierre
Copy link to clipboard
Copied
Check the documentation /t does not take two file names. A printer name is not a file name.
Copy link to clipboard
Copied
Thanks
Not easy to find the list of parameters ... only incomplete data on the web ... maybe my way to search !!
OK I see this
AcroRd32.exe /t path "printername" "drivername" "portname" — Initiates Adobe Reader and prints a file, whose path must be fully specified, while suppressing the Print dialog box.
The four parameters of the /t option evaluate to path, printername, drivername, and portname (all strings).
and evaluate also other options /n /s /o /h /p
but none of these corresponds to what I would like to perform.
So possible ( and I continue to search ) or impossible ( and I am stuck 🙂 ) ?
Thanks Regards Pierre

