473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Printing Problem

102 64KB
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
0 1139

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

Similar topics

0
by: Rami | last post by:
Hello All, We have a java application including applets, servlets and ejbs. Users can get reports and print them directly from applets. Our print methods uses PrinterJob and Graphics2d, imports...
5
by: rd | last post by:
Has anyone else noticed a problem when printing html with fieldsets in them? Whenever I print even the simplest document with a fieldset, the amount of data sent to the printer jumps from a few K...
0
by: Programatix | last post by:
Hi, I am working on the PrintDocument, PrintDialog, PageSetupDialog and PrintPreviewControl components of Visual Studio .NET 2003. My developement machine is running Windows XP. There are...
1
by: DCraig | last post by:
I'm having problems printing to a line printer from both Crystal Reports and SQL Server reporting services using dotnet. When I try and print a report from an application with Crystal I get the...
2
by: Sukh | last post by:
Hi I am stuck with a problem Can anyone help me out from this... I am printing a report on pre-printed continue paper using dot-matrix printer using vb.net. Data is printing on all the...
0
by: Sukh | last post by:
Hi I am stuck with a problem Can anyone help me out from this... I am printing a report on pre-printed continue paper using dot-matrix printer using vb.net. Data is printing on all the...
1
by: benfly08 | last post by:
Hi, I got a printing problem for my C# program. I need to pull out records from database and format them and then print them out. I used PrintDocument class and PrintPageEventHandler function...
1
monirul arfin
by: monirul arfin | last post by:
Hi all, can i ask a printing problem in this forum. monirul
0
by: GiftX | last post by:
VB 6.0 And Spreadsheet - Printing problem Good morning West. After much research, I found this code. It scans the spreadsheet and returns up to the last used cell. ...
6
by: babaidebnath | last post by:
Hello all, I am presently having a problem with printing in C#. The problem is my customer provided me a pre printed paper and I need to print value into some specific positions. But problem is C#...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.