Print pdf document from vb .net application

S

Sameer Parekh

Hello everyone,

We are automating a paper based process and hence need to print certain
pdf documents through our VB .Net Application. Any ideas how that can be
done?

Thanks
 
H

Herfried K. Wagner [MVP]

Sameer Parekh said:
We are automating a paper based process and hence need to print certain
pdf documents through our VB .Net Application.

Simple solution (this solution doesn't give you much control about
printing):

Printing files of various types without user interaction
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=printinganyfile&lang=en>

In addition to that, you may want to take a closer look at Adobe Acrobat,
Adobe Reader and the PDF library:

Adobe PDF Library SDK
<URL:http://partners.adobe.com/public/developer/pdf/library/>
 
S

Sameer Parekh

I tried running this with a series of documents and it only prints out
the first one. It runs through the code, but does not print out
subsequent documents.
Any ideas?
Thanks
 
H

Herfried K. Wagner [MVP]

Sameer Parekh said:
I tried running this with a series of documents and it only prints out
the first one. It runs through the code, but does not print out
subsequent documents.
Any ideas?


You can try to wait until the first document has been sent to the printer
(untested!):

\\\
Dim p As Process = Process.Start(...)
p.WaitForExit()

' Print next document...
///
 
S

Sameer Parekh

Well, I did try the same yesterday, but when there are 2 pdf documents,
it prints the first one and then the program just seems to be waiting.
At that point the adobe application is running, and if I close it out,
then it prints the subsequent document. Any ideas?
Thanks
 
R

Rob Nicholson

We are automating a paper based process and hence need to print certain
pdf documents through our VB .Net Application. Any ideas how that can be
done?

Not much help but I can say that we found printing PDF documents in our
previous VB6 application to be a real problem. Whilst Acrobat does have an
API, there were some glaring omissions like the inability to specify
different paper trays for page 1 than for page 2 - a typical requirement in
printing on letter head and continuation paper. In the end we had to try and
battle with the Word API to print complex documents.

I dare say there are solutions to this but they were a real overkill of our
simple requirement.

Good luck!

Cheers, Rob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top