Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Print into a file ( instead of physical printer ) in VBNet

New Here ,
Nov 04, 2021 Nov 04, 2021

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

TOPICS
Edit and convert PDFs
290
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 04, 2021 Nov 04, 2021

Check the documentation /t does not take two file names. A printer name is not a file name. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 04, 2021 Nov 04, 2021
LATEST

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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines