Results 1 to 9 of 9

Thread: Printing Copies [Resolved]

  1. #1

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195

    Printing Copies [Resolved]

    I am just angry

    I have been looking all over **** for the correct way to do this, and found NOTHING!!

    Please help!

    This is my code:

    Code:
       Private Sub printboards()
            AddHandler pd1.PrintPage, AddressOf pd1_PrintPage
            pd1.PrinterSettings.Copies = PrintDialog1.PrinterSettings.Copies
            pd1.Print()
        End Sub
    
        Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
            PrintDialog1.Document = pd1
            If PrintDialog1.ShowDialog = DialogResult.OK Then
                printboards()
            End If
        End Sub
    
        Private Sub pd1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles pd1.PrintPage
            e.Graphics.Clear(Color.White)
            Dim x1 As Integer
            Dim y1 As Integer
            Dim x2 As Integer
            Dim y2 As Integer
    
            Dim left As Integer
            Dim horz As Integer
            Dim top1 As Integer = 200
            Dim vert As Integer
    
            For vert = 0 To 2
                For horz = 0 To 1
                    e.Graphics.DrawString("Week " & week + 1, New Font("Arial", 12, FontStyle.Bold), Brushes.Red, 70 + left, top1)
                    Dim ctl As Control
                    For Each ctl In Me.Controls
                        If TypeOf ctl Is Label Then
                            Dim lbl As Label = ctl
                            e.Graphics.DrawString(lbl.Text, New Font("Arial", 8, FontStyle.Regular), Brushes.Black, lbl.Left + 50 + left, lbl.Top + top1)
                        End If
                    Next
                    For Each ctl In Me.Controls
                        If TypeOf ctl Is TextBox Then
                            Dim txt As TextBox = ctl
                            e.Graphics.DrawString(txt.Text, New Font("Arial", 9, FontStyle.Bold), Brushes.Blue, txt.Left + 55 + left, txt.Top + top1)
                        End If
                    Next
                    week = week + 1
                    Me.btnRegen.PerformClick()
                    left = left + 400
                Next
                left = 0
                Me.btnRegen.PerformClick()
                top1 = top1 + 300
                pagecount += 1
            Next
            If pagecount = 3 Then
                e.HasMorePages = True
            ElseIf pagecount = 6 Then
                e.HasMorePages = True
            Else
                e.HasMorePages = False
                week = 0
                pagecount = 0
            End If
        End Sub

    What am I missing in order to print multiple copies?


    Any Help Would Be Greatly Appriciated
    Last edited by Hole-In-One; Jan 28th, 2004 at 08:32 AM.

  2. #2

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    Nevermind.


    I just figured it out!


    The problem is not in the code, but the piece of **** hp printer I'm using that doesn't allow multiple copies!

    I tried using notepad to print a couple of copies of a text document and it only printed one.

  3. #3
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    How does a specific printer not allow multiple pages? It just sends the print command for the page extra times.....

    I've never seen a printer not allow multiple copies, even my old Panasonic dot matris printer did it, and that was from like 1994!

  4. #4
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148
    To find out if your printer can cope with multiple copes use the DeviceCapabilities API call with the index DC_COPIES. If this returns 1 then you will need to implement the multiple copies functionality yourself.

  5. #5

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    If this returns 1 then you will need to implement the multiple copies functionality yourself.
    And how do I do that?

  6. #6
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by Hole-In-One
    And how do I do that?
    Print it more than once

  7. #7

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    Yeah but then it brings up that stupid "print document" screen that many times!

    (Looks like **** )


    You wouldn't happen to know a way to lose that screen would ya?

  8. #8
    Lively Member nokia8210's Avatar
    Join Date
    Dec 2002
    Location
    Coventry
    Posts
    92
    if you set the background printing on then it doesn't show
    my system prints several doc's one after the other but the user never sees the print dialog box.

  9. #9

    Thread Starter
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    Thanks for all the feedback.

    I have resolved this problem. I upgraded to 2003 and it works wonderful.

    The framework 1.0 has a bug in it, obviously the framework 1.1 doesn't.

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