|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Wrong Margins - How To ?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 Antonio Paglia wrote:
Show quoteHide quote > On VS2005: In my experience, it never prints EXACTLY the way it's told. I usually> > 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 find the printing is off by +/- 2 cm. Maybe it's the printer (I only have 1 to experiment with). What happens when you print on a different printer?
SQL UPDATE query help please
How to get a form's property value from a class? Russian text output Help needed in using FSO's, TextStreams, etc. --- Code Review and Advice requested How to identiy numerics in a string? Why must I cast when I put type safe generic objects in the combo box? Exception handling, Retry, Resume Next ListView ListItems - can they be hidden? How to uniquely identify a process? adding listbox selected items |
|||||||||||||||||||||||