DrawLine

Draw a line for the given height and width at the specifiy location.

DrawLine(StartX As Single, StartY As Single, EndX As Single, EndY As Single, LineHeight As Single,
         LineColor As Color, Optional LineCapStyle As pdf.LineCapStyle = pdf.LineCapStyle.Squared)

Values passed to this procedure:

StartX, StartYThe line starting x, y coordinates.
EndX, EndYThe line ending x, y coordinates.
LineHeightThe height of the line.
LineColorThe color of the line.
LineCapStyleOptional. The line cap style specifies the shape to be used at the end of each line that makes up the box. The three types are:

Squared - the stroke is squared off at the endpoint of the path. There is no projection beyond the end of the path.

Round - a semicircular arc with a diameter equal to the line width is drawn around the endpoint and filled in.

ProjectingSquare - The stroke continues beyond the endpoint of the path for a distance equal to half the line width and is squared off.

The default is Squared.

Example

With cPDF

..

  .StartPage()
  .DrawLine(0.25, 10, 8.25, 10, 0.01, Color.DarkOliveGreen, pdf.LineCapStyle.Round)

  .DrawLine(1, 9.5, 7.5, 9.5, 0.05, Color.Red, pdf.LineCapStyle.Round)

  .DrawLine(2, 9, .PageWidthInInch - 2, 9, 0.1, Color.Tomato, pdf.LineCapStyle.ProjectingSquare)

  .DrawLine(1.5, 8.5, 1.5, 1, 0.2, Color.Blue, pdf.LineCapStyle.Squared)

  .DrawLine(3, 7, 3, 3, 0.3, Color.Green, pdf.LineCapStyle.Round)

  .DrawLine(4.5, 7, 7, 4.5, 0.3, Color.DarkMagenta, pdf.LineCapStyle.Round)
  .DrawLine(4.5, 4.5, 7, 7, 0.3, Color.DarkMagenta, pdf.LineCapStyle.Round)

  .EndPage()

Sample lines