This is very curious. A long standing problem that has me stumped. When drawing simple lines, they show up perfectly on-screen in Adobe Reader 9. But when the PDF is printed to paper, the lines are not there. However, if I go into Advanced tab on Printer Settings and change Printer Features / Graphics Mode: Send Graphics as Vector to instead be Send Graphics as Raster, they print just fine. This is printing to an HP Color LaserJet 4700 under Windows 7, 64-bit.
I can not determine if the issue is in 1) how I am calling PDFNet V 5.7.0.0 2) Adobe Reader or 3) the HP print driver.
My VB.NET routine for drawing horizontal lines is part of a larger render library, and is as follows. All passed parameters are in inches, so some values are converted with the HItoPT and VItoPT routines. Some small displacements of a half line are made to help make the corners match up better when this is combined with vertical line drawing.
Public Overrides Sub HLine( _
ByVal HorizontalPosition1 As Single, _
ByVal HorizontalPosition2 As Single, _
ByVal VerticalPosition As Single, _
ByVal Thickness As Single)
CreateTextEnd()
Dim elm As Element
Dim gstate As GState
mOut.mWriter.WriteElement(mOut.mEB.CreateGroupBegin())
mOut.mEB.PathBegin()
mOut.mEB.MoveTo(HItoPt(HorizontalPosition1 - (Thickness / 2)), VItoPt(VerticalPosition))
mOut.mEB.LineTo(HItoPt(HorizontalPosition2 + (Thickness / 2)), VItoPt(VerticalPosition))
mOut.mEB.ClosePath()
elm = mOut.mEB.PathEnd
elm.SetPathStroke(True)
elm.SetPathFill(False)
gstate = elm.GetGState
If Color = Drawing.Color.Black Then
gstate.SetStrokeColorSpace(ColorSpace.CreateDeviceRGB)
gstate.SetStrokeColor(New ColorPt(0, 0, 0))
Else
gstate.SetStrokeColorSpace(ColorSpace.CreateDeviceRGB)
gstate.SetStrokeColor(New ColorPt(Color.R / 255.0, Color.G / 255.0, Color.B / 255.0))
End If
elm.SetPathStroke(True)
gstate.SetLineWidth(Thickness * 72.0)
mOut.mWriter.WriteElement(elm)
mOut.mWriter.WriteElement(mOut.mEB.CreateGroupEnd())
CurrentHorizontalPosition = HorizontalPosition1
CurrentVerticalPosition = VerticalPosition
End Sub
I really hope there is an issue with the way I am calling PDFNet. Thanks for your help.
--
Lee Gillie, CCP
Online Data Processing, Inc.