Results 1 to 9 of 9

Thread: send straight to printer

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    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

    Parksie

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: send straight to printer

    Post Your code
    Please mark you thread resolved using the Thread Tools as shown

  3. #3
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    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 -

  4. #4

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    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.

    Parksie

  5. #5
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    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

  6. #6

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Re: send straight to printer

    Thanks Koolsid but the link is a dead end.

    Parksie

  7. #7

    Re: send straight to printer

    Try it again, I just loaded it and it was fine.

  8. #8
    Frenzied Member
    Join Date
    Jul 2009
    Posts
    1,103

    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>

  9. #9

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Re: send straight to printer

    Quote Originally Posted by koolsid View Post
    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.

    Parksie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width