Printing PDF on a specific printer without human action... How?

T

ThunderMusic

Hi,
I must print a PDF report from a windows service (so without human
action). The pdf is located in a specific place on hard drive that is
accessible to the application. Until now, I've only been able to open the
pdf file and the press on the "Print" button in acrobat. But that exactly
what I must avoid. The service must load the document and print it (well,
maybe not load it, but at least print it) all by itself. And the document
can be sent on different printers depending on the settings of the service
(actually, it can be sent to 3 printers), so I just can't send to the
default printer.

Is there a way to do it in .NET or will I have to buy some third party
component (which I would like to avoid too)

thanks

ThunderMusic
 
R

Rik Hemsley

ThunderMusic said:
Hi,
I must print a PDF report from a windows service (so without human
action). The pdf is located in a specific place on hard drive that is
accessible to the application. Until now, I've only been able to open the
pdf file and the press on the "Print" button in acrobat. But that exactly
what I must avoid. The service must load the document and print it (well,
maybe not load it, but at least print it) all by itself. And the document
can be sent on different printers depending on the settings of the service
(actually, it can be sent to 3 printers), so I just can't send to the
default printer.

Is there a way to do it in .NET or will I have to buy some third party
component (which I would like to avoid too)

You will have to buy a third party component. I'm using PDFNet, which is
IME excellent, though expensive. I don't know of any other way to print
PDFs (reliably!) from a service (or in my case, from an ASP.NET
application). If anyone else does, please speak up!

Cheers,
Rik
 
T

ThunderMusic

ok, I found the Acrobat ActiveX object, and I'm able to display the pdf and
even print it from code, but it always prints on the default printer. I
don't think there is a setting to change the printer it prints on beside
printing with dialog which is not what I want.

So, is it possible to change the default printer very quickly so I can print
the same document on 3 different printers? will I have to insert a delay
between the default printer changes?

Does someone have any sample code on how to change the default printer in
..net?

Thanks
 

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