Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Print of pdf file to network printer fails

Print of pdf file to network printer fails

Scheduled Pinned Locked Moved Visual Basic
csharpgraphicssysadminhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nick De Decker
    wrote on last edited by
    #1

    Hello all, Heard some great stuff about the code project so I decided to join the community and hope to be able to help others in the future as well. Not yet there though since i'm fairly new to vb.net Anyway: I need to print PDF files that are on disk to a network printer. I searched for some printing code on the net and found several similar approaches. However printing only seems to work to local printers, not network printers. Even on local printers it sometimes fails. I used the following code: Dim PD As New System.Drawing.Printing.PrintDocument Dim DefPrint As String = PD.DefaultPageSettings.PrinterSettings.PrinterName PD.DefaultPageSettings.PrinterSettings.PrinterName = .PrinterNaam Dim NP As New Process() NP.StartInfo.FileName = "c:\test.pdf" NP.StartInfo.WindowStyle = ProcessWindowStyle.Hidden NP.StartInfo.Verb = "Print" NP.Start() NP.WaitForExit(9000) If Not NP.HasExited Then NP.Kill() End If PD.DefaultPageSettings.PrinterSettings.PrinterName = DefPrint any way to improve this piece of code ? it launches the print command to acrobat, but maybe there is a better trick to do the printing. How comes this doesn't work for network printers ? Thanks in advance, Nick

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups