|
-
Feb 18th, 2010, 06:48 AM
#1
Thread Starter
Fanatic Member
send straight to printer
Hi All
I was just wondering how the hell you send documents of different type directly to the printer without a preview.
At first I thought this would be easy but so far I have had no joy at all.
Thanks In Advance
-
Feb 18th, 2010, 07:10 AM
#2
Re: send straight to printer
Please mark you thread resolved using the Thread Tools as shown
-
Feb 18th, 2010, 09:18 AM
#3
Re: send straight to printer
If you are to do the printing yourself using the PrintDocument class, you just call the Print method of the PrintDocument instance. However, I don't think this is what you are after since you want to print different document types and it will be very much impossible to code the PrintDocument.PrintPage event handler to handles every types of documents.
The easiest way is to use a webbrowser control to load the document and call its Print method. You don't have much control using this way, but as long as Internet Explorer can open that file type, you can print it.
The next option is to use Process class and ProcessStartInfo class to start the application of that document type you want to print. For example, if it's a pdf, you start Adobe reader; if it's a doc, you start MS Word; if it's an xls, you start MS Excel... and setting the Verb. You will have a fair amount of control this way, but it requires that:
1. The application supports command line args.
2. You need to look up the the available command line switches for each application so that you can use them correctly.
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Feb 18th, 2010, 10:22 AM
#4
Thread Starter
Fanatic Member
Re: send straight to printer
I use the Process Startinfo to PrintPreview docs.
I have been told that I need to send selected documents to the print que directly without opening any application at all.
Bit of a pain really.
-
Feb 18th, 2010, 10:32 AM
#5
Re: send straight to printer
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Feb 18th, 2010, 07:05 PM
#6
Thread Starter
Fanatic Member
Re: send straight to printer
Thanks Koolsid but the link is a dead end.
-
Feb 19th, 2010, 12:49 AM
#7
Re: send straight to printer
Try it again, I just loaded it and it was fine.
-
Feb 19th, 2010, 01:19 AM
#8
Frenzied Member
Re: send straight to printer
<Off topic>
Printing can also be obtained by transfering th entire data into an excel sheet and calling the print()......but its limitation is it needs the excel version to be installed in the clients machine......
</Off topic>
-
Apr 18th, 2010, 09:51 AM
#9
Thread Starter
Fanatic Member
Re: send straight to printer
 Originally Posted by koolsid
An interesting bit of code koolsid but you need the PCL codes for all the printers which aint to practical.
It amazes me how difficult sending files directly to the printer can be. Are there any third party controls that do this sort of thing ?
Last edited by venerable bede; Apr 18th, 2010 at 09:57 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|