A
Antonio Paglia
On VS2005:
I define my own print document class like this
Class MyPrintDocument
Inherits PrintDocument
Private Sub PrintDocumentPrinter_PrintPage(ByVal sender As Object, ByVal
e As System.Drawing.Printing.PrintPageEventArgs) Handles Me.PrintPage
e.Graphics.DrawRectangle(Pens.Black,
Me.DefaultPageSettings.Margins.Left, Me.DefaultPageSettings.Margins.Top,
200, 200)
e.HasMorePages = False
End Sub
End Class
Then, I want to print at top/upper corner an square of 2x2 inchs. Margins
have been configured to 1 inch
Dim pd As New MyPrintDocument
pd.DefaultPageSettings.PaperSize = New PaperSize("CustomSize", 827,
1169)
pd.DefaultPageSettings.Margins = New Margins(100, 100, 100, 100)
pd.Print()
I have notice that the rectangle is not at 1 inch from the left and top
edge, but 1.1 inch to left and 1.2 inch at top margin. I can't print exactly
at 1 inch or any other margin. Is There a way to do this ??
Please, help me
TIA
Antonio
I define my own print document class like this
Class MyPrintDocument
Inherits PrintDocument
Private Sub PrintDocumentPrinter_PrintPage(ByVal sender As Object, ByVal
e As System.Drawing.Printing.PrintPageEventArgs) Handles Me.PrintPage
e.Graphics.DrawRectangle(Pens.Black,
Me.DefaultPageSettings.Margins.Left, Me.DefaultPageSettings.Margins.Top,
200, 200)
e.HasMorePages = False
End Sub
End Class
Then, I want to print at top/upper corner an square of 2x2 inchs. Margins
have been configured to 1 inch
Dim pd As New MyPrintDocument
pd.DefaultPageSettings.PaperSize = New PaperSize("CustomSize", 827,
1169)
pd.DefaultPageSettings.Margins = New Margins(100, 100, 100, 100)
pd.Print()
I have notice that the rectangle is not at 1 inch from the left and top
edge, but 1.1 inch to left and 1.2 inch at top margin. I can't print exactly
at 1 inch or any other margin. Is There a way to do this ??
Please, help me
TIA
Antonio