Heath Church
Heath Church

Reputation: 23

Modifying Line Thickness in PdfSharp vb.net

I am writing a program in vb.net using the PdfSharp dll library to generate a pdf based upon user-entered values.

I am trying to adjust the look & feel of the pdf and one thing I noticed is that PdfSharp does not seem to offer a way of adjusting line thickness. This is especially frustrating since the default line thickness is quite heavy and looks overly bold. Example of Default Line Thickness

Here is the code I am currently using. Does anyone know of a way to fix the line thickness?

        'Outter Left Line
        gfx.DrawLine(XPens.Black, 290, 85, 290, 145)
        'Outter Right Line
        gfx.DrawLine(XPens.Black, 530, 85, 530, 145)
        'Line Dividing Fields
        gfx.DrawLine(XPens.Black, 388, 85, 388, 145)

        'Rows 1-2 Outline
        gfx.DrawLine(XPens.Black, 290, 85, 530, 85)
        gfx.DrawLine(XPens.Black, 290, 97, 530, 97)
        'Rows 2-3 Outline
        gfx.DrawLine(XPens.Black, 290, 109, 530, 109)
        gfx.DrawLine(XPens.Black, 290, 121, 530, 121)
        'Rows 3-4 Outline
        gfx.DrawLine(XPens.Black, 290, 133, 530, 133)
        gfx.DrawLine(XPens.Black, 290, 145, 530, 145)

Thanks.

Upvotes: 2

Views: 823

Answers (1)

OneFineDay
OneFineDay

Reputation: 9024

Define the pen.

Dim myColorPen As New XPen(XColors.Black, 2)
g.DrawLine(myColorPen, New XPoint, New XPoint)

Upvotes: 2

Related Questions