borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (How to print a report between 2 dates?)Next Topic (DOS PRINTING) New Topic New Poll Post Reply
AndreaVB Forum : Printing : Printing size different from actual setting
Poster Message
rainbow
Level: Trainee

Registered: 01-03-2005
Posts: 1

icon Printing size different from actual setting

Private Sub cmdPrint_Click()
On Error GoTo err
Dim W_Printer As String
Dim Rtn
Dim w As Single
Dim h As Single
Dim x As Integer
Dim i As Integer

If txtMasterAccount.Text >= 0 Then
    Rtn = vbYes 'max
'    Rtn = MsgBox("Do you wish to print your message on " & StrConv(Printer.DeviceName, vbUpperCase) & " Printer", vbInformation + vbYesNo)
    If Rtn = vbYes Then
        Set_Printer
        MsgBox Printer.DeviceName
        If MsgBox("Have you choosen the correct printer?", vbQuestion + vbYesNo, "Printer Details") = vbNo Then
        Printer.KillDoc
        Else
            Printer.Font.Size = 11
            Printer.FontBold = True
        
            CommonDialog1.Copies = 1
            CommonDialog1.PrinterDefault = True
            CommonDialog1.Orientation = cdlPortrait
            CommonDialog1.ShowPrinter
        
            For i = 0 To dgCount - 1
            DataGrid1.Row = i
            'MsgBox DataGrid1.Columns("Usercode").Value
            'MsgBox DataGrid1.Columns("Accesskey").Value
            Printer.PaperSize = vbPRPSStatement
            Printer.CurrentY = 6000
            Printer.CurrentX = 1200
            Printer.CurrentY = 2000
            Printer.Print txtPIC.Text
            Printer.CurrentX = 1200
            Printer.Print txtCompanyName.Text
            Printer.CurrentX = 1200
            Printer.Print txtAddr.Text
            Printer.CurrentX = 1200
            Printer.Print txtAddr1.Text
            Printer.CurrentX = 1200
            Printer.Print txtAddr2.Text
            Printer.CurrentX = 8000
            Printer.CurrentY = 3700
            Printer.Print DataGrid1.Columns("Usercode").Value
            Printer.CurrentX = 8000
            Printer.CurrentY = 4500
            Printer.Print DataGrid1.Columns("Accesskey").Value
            Printer.EndDoc
            Next
        
            DataGrid1.Row = 0
    Exit Sub
    End If
err:
    MsgBox err.Description
    MsgBox "Printer Site Error"

    End If
Else
    MsgBox "Select the printer and then try", vbCritical
End If
End Sub
      
i wish to print a paper size with height = 5.5 inches
and width = 9.5inches.Thus, i have selected the vbPRPSStatement. But the output size is different from 5.5 X 8.5...
May i know how?? 5.5 X 8.5 is height X width or reversely?
The output i get is height 8.5.
Thanks.

01-03-2005 at 05:01 AM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Printing size different from actual setting

It's width x height, like A4 = 210*297 mm

____________________________
If you find the answer helpful, please mark this topic as solved.

01-03-2005 at 04:29 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Printing : Printing size different from actual setting
Previous Topic (How to print a report between 2 dates?)Next Topic (DOS PRINTING) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder