Print PDF document from C#

S

Soumya Kar

Hi All,

My requirement is to be able to print a pdf document without
the printer dialog being invoked. This I have achieved by using the
shell and passing the verb = "Print". But a part of the requirement is
also that before the document is sent for printing, the network printer
will have to be configured by C# code. The printer settings will have to
be modified in terms of page size, orientaion, default tray selection,
so on. Can anyone give me any idea on how to achieve this using C# code.

Thanks.
 
N

Nicholas Paldino [.NET/C# MVP]

Soumya,

You might want to get a third party PDF control for this. When you send
the command verb Print, the os sends that to the program registered to
handle the command (most likely adobe). I don't know what other command
verbs they accept, or if they have an automation interface, but it is
unlikely that it would be that simple to set the print parameters.

I would check to see if Acrobat has an interface you can use (through
API calls or COM), or use a third party component.

Hope this helps.
 

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