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

Printing Problem

100+
P: 102
This code should print a three page PDF document but instead prints a one page blank document. I do not have much experience in printing. What is wrong?


Expand|Select|Wrap|Line Numbers
  1.  Private Sub P(ByVal strPDF_Path As String)
  2.  
  3.         Dim Printdocument1 As New System.Drawing.Printing.PrintDocument
  4.         Dim ppd As New PrintPreviewDialog
  5.         Dim PrintDialog1 As New System.Windows.Forms.PrintDialog
  6.         Dim Printer_selected As String
  7.         Dim StreamToPrint As System.IO.StreamReader
  8.  
  9.         StreamToPrint = New System.IO.StreamReader(strPDF_Path)
  10.         Printdocument1.DocumentName = "Document"
  11.         Printdocument1.PrinterSettings.PrintFileName = strPDF_Path
  12.         ppd.Document = Printdocument1
  13.         ppd.ShowDialog()
  14.         PrintDialog1.Document = Printdocument1
  15.         PrintDialog1.PrinterSettings = Printdocument1.PrinterSettings
  16.         If PrintDialog1.ShowDialog = DialogResult.OK Then
  17.             Printdocument1.PrinterSettings = PrintDialog1.PrinterSettings
  18.             Printer_selected = Printdocument1.PrinterSettings.PrinterName
  19.             Printdocument1.Print()
  20.         End If
  21.     End Sub
  22.  
Apr 21 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.