views:

109

answers:

1

I'd like to print some data to specific area on A4 paper. Are there any easy way to do like that? It's very difficult for me to find coordinate of X and Y. Below is my sample code in VB.NET to print the data.

Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage    
        e.Graphics.DrawString("My text", f_en, Brushes.Black, 410, 942)
        ...
End Sub

Thank you.

A: 

If you have the location you want to draw on in milimeters you may try this:

e.Graphics.PageUnit =  GraphicsUnit.Millimeter;
arul