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. Using printdocumnet and printdialog

Using printdocumnet and printdialog

Scheduled Pinned Locked Moved Visual Basic
help
2 Posts 2 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.
  • J Offline
    J Offline
    johnjsm
    wrote on last edited by
    #1

    Hi, I am trying to print a pdf using the printdocument and printdialog by passing a file name using the opendialog. This is my code im c1 As OpenFileDialog = New OpenFileDialog c1.InitialDirectory = "c:\" c1.Filter = "PDF Files (*.pdf)|*.pdf" If (c1.ShowDialog() = DialogResult.OK) Then lblFileName.Text = c1.FileName file = lblFileName.Text End If PrintDocument1.DocumentName = file PrintDialog1.ShowDialog() PrintDocument1.Print() Anytime I try this it does not print anything. Can anyone help please

    C 1 Reply Last reply
    0
    • J johnjsm

      Hi, I am trying to print a pdf using the printdocument and printdialog by passing a file name using the opendialog. This is my code im c1 As OpenFileDialog = New OpenFileDialog c1.InitialDirectory = "c:\" c1.Filter = "PDF Files (*.pdf)|*.pdf" If (c1.ShowDialog() = DialogResult.OK) Then lblFileName.Text = c1.FileName file = lblFileName.Text End If PrintDocument1.DocumentName = file PrintDialog1.ShowDialog() PrintDocument1.Print() Anytime I try this it does not print anything. Can anyone help please

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      There is no PDF support in .NET. You need to buy a third party library for that. The print dialog DocumentName in general, does not magically print a document for you in any case. You need to impliment printing in all cases. Perhaps you should try reading some documentation ?

      Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

      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