By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,536 Members | 1,504 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,536 IT Pros & Developers. It's quick & easy.

Print PDF document from C#

P: n/a
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.


*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Soumya Kar" <so****@rebaca.com> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl...
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.


*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #2

P: n/a
See "Setting Windows default printer" from in articles of March 2005 at
http://pages.videotron.com/emoreau/

It should gives you some starting points.
--
HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
(http://aspnet2.com/mvp.ashx?EricMoreau)
Conseiller Principal / Senior Consultant
Concept S2i inc. (www.s2i.com)
http://pages.videotron.com/emoreau/

"Soumya Kar" <so****@rebaca.com> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl...
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.


*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.