Hi,
i have a problem when printing on a standard Adobe Pdf logical printer: when i use Bold or Italic font the text on the created document does not start at the given x and y position.
When I choose a normal printer it works fine.
If I use Normal Font it works fine.
(I have Acrobat 6)
Here is a code example :
' tb1 and tb2 are textboxes, pdg1 is a printdialog
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pd As PrintDocument = New PrintDocument
AddHandler pd.PrintPage, New System.Drawing.Printing.PrintPageEventHandler(AddressOf Me.pd_PrintPage)
pdg1.Document = pd
pdg1.ShowDialog()
pd.Print()
End Sub
Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As System.Drawing.Printing.PrintPageEventArgs)
ev.Graphics.DrawString("Test Normal Font", tb1.Font, Brushes.Black, 30, 50)
ev.Graphics.DrawString("Test Bold Font", tb2.Font, Brushes.Black, 120, 50)
ev.HasMorePages = False
End Sub
Can anyone help me ?
Thanks
i have a problem when printing on a standard Adobe Pdf logical printer: when i use Bold or Italic font the text on the created document does not start at the given x and y position.
When I choose a normal printer it works fine.
If I use Normal Font it works fine.
(I have Acrobat 6)
Here is a code example :
' tb1 and tb2 are textboxes, pdg1 is a printdialog
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pd As PrintDocument = New PrintDocument
AddHandler pd.PrintPage, New System.Drawing.Printing.PrintPageEventHandler(AddressOf Me.pd_PrintPage)
pdg1.Document = pd
pdg1.ShowDialog()
pd.Print()
End Sub
Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As System.Drawing.Printing.PrintPageEventArgs)
ev.Graphics.DrawString("Test Normal Font", tb1.Font, Brushes.Black, 30, 50)
ev.Graphics.DrawString("Test Bold Font", tb2.Font, Brushes.Black, 120, 50)
ev.HasMorePages = False
End Sub
Can anyone help me ?
Thanks