How to Start Convert PDF Work with PDF Modules PDF Document PDF Pages Text Image Graph & Path Annotation, Markup & Drawing Redaction Security Digital Signature Forms Watermark Bookmark Link File Attachment File Metadata Printing Work with Other SDKs Barcode read Barcode create OCR Twain

Using VB.NET PDF SDK
VB.NET PDF Builder: How to draw, add a curve shape to PDF file


Visual Basic .net Demo Code to create, draw, add a curve 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 300 pixels
ctx.SetWidth(New RELength(600, Units.PX))
ctx.SetHeight(New RELength(300, Units.PX))
' draw a heart
Dim path As REPath = New REPath()
path.AddBezier(200, 110, 200, 70, 270, 60, 300, 110)
path.AddBezier(300, 110, 330, 60, 400, 70, 400, 110)
path.AddBezier(400, 110, 400, 150, 380, 200, 300, 250)
path.AddBezier(300, 250, 220, 200, 200, 150, 200, 110)
path.CloseAllPath()
ctx.FillPath(New RESolidBrush(New REColor(255, 0, 0)), path)
ctx.DrawPath(New REPen(New REColor(224, 224, 0), 3.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 curve on PDF using vb.net: