ByteScout PDF SDK - VB.NET - Draw Lines and Curves in PDF - ByteScout

ByteScout PDF SDK – VB.NET – Draw Lines and Curves in PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VB.NET – Draw Lines and Curves in PDF

How to draw lines and curves in PDF in VB.NET and ByteScout PDF SDK

This code in VB.NET shows how to draw lines and curves in PDF with this how to tutorial

The documentation is designed to help you to implement the features on your side. What is ByteScout PDF SDK? It is the SDK for pdf documents generation, modification and updates. Can also generate and fill PDF forms. Provides support for text (fonts, style, size, font family), layers, pdf form fields, vector and raster drawings. It can help you to draw lines and curves in PDF in your VB.NET application.

Fast application programming interfaces of ByteScout PDF SDK for VB.NET plus the instruction and the code below will help you quickly learn how to draw lines and curves in PDF. This VB.NET sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Enjoy writing a code with ready-to-use sample VB.NET codes.

Free trial version of ByteScout PDF SDK is available for download from our website. Get it to try other source code samples for VB.NET.

Try ByteScout PDF SDK today: Get 60 Day Free Trial or sign up for Web API

Program.vb
      
Imports Bytescout.PDF ''' <summary> ''' This example demonstrates how to draw lines and curves. ''' </summary> Class Program Shared Sub Main() ' Create new document Dim pdfDocument = New Document() pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" ' Add page Dim page = New Page(PaperFormat.A4) pdfDocument.Pages.Add(page) Dim canvas = page.Canvas Dim solidPen = New SolidPen() Dim dashedPen = New SolidPen() dashedPen.DashPattern = New DashPattern(New Single() {2, 2}) ' Draw dashed lines canvas.DrawLine(dashedPen, 100, 100, 200, 100) canvas.DrawLine(dashedPen, 200, 100, 200, 200) canvas.DrawLine(dashedPen, 200, 200, 100, 200) ' Draw besier curve by the same points canvas.DrawCurve(solidPen, 100, 100, 200, 100, 200, 200, 100, 200) ' Save document to file pdfDocument.Save("result.pdf") ' Cleanup pdfDocument.Dispose() ' Open document in default PDF viewer app Process.Start("result.pdf") End Sub End Class

Try ByteScout PDF SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout PDF SDK page

Explore ByteScout PDF SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next