|
Using VB.NET PDF SDK
VB.NET PDF Builder: How to draw, add a start shape to PDF file
VB.NET Demo Code to create, draw, add a start graph to pdf document
Draw a start on PDF context using vb.net
...
Dim ctx As PDFContext = New PDFContext()
' set figure size: width 600 pixels; height 200 pixels
ctx.SetWidth(New RELength(600, Units.PX))
ctx.SetHeight(New RELength(200, Units.PX))
' draw a star
Dim path As REPath = New REPath()
path.AddLine(100, 70, 300, 70)
Path.AddLine(300, 70, 130, 170)
Path.AddLine(130, 170, 200, 10)
Path.AddLine(200, 10, 270, 170)
Path.AddLine(270, 170, 100, 70)
Path.CloseAllPath()
ctx.DrawPath(New REPen(New REColor(255, 0, 0), 5.0F), Path)
Dim figure As Figure = New Figure(ctx)
...
Add context to PDF document in vb.net
Dim outputFilePath As String = "C:\Sample25.pdf"
Dim document As Document = New Document()
PDFBuildHandler.Create(document, outputFilePath)
' open document
document.Open()
' create Figure
Dim ctx As PDFContext = New PDFContext()
...
...
Dim figure As Figure = New Figure(ctx)
document.Add(figure)
' close document and save to the output file
document.Close()
Let's see the result of adding a start on PDF using vb.net:
|