An easy to understand sample source code to learn how to draw rectangles in pdf with pdf sdk in VB.NET ByteScout PDF Suite can draw rectangles in pdf with pdf sdk. It can be applied from VB.NET. ByteScout PDF Suite is the set that includes 6 SDK products to work with PDF from generating rich PDF reports to extracting data from PDF documents and converting them to HTML. This bundle includes PDF (Generator) SDK, PDF Renderer SDK, PDF Extractor SDK, PDF to HTML SDK, PDF Viewer SDK and PDF Generator SDK for Javascript.
The following code snippet for ByteScout PDF Suite works best when you need to quickly draw rectangles in pdf with pdf sdk in your VB.NET application. 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! This basic programming language sample code for VB.NET will do the whole work for you to draw rectangles in pdf with pdf sdk.
Our website gives trial version of ByteScout PDF Suite for free. It also includes documentation and source code samples.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
Imports System.Drawing Imports Bytescout.PDF ''' <summary> ''' This example demonstrates how to draw rectangles. ''' </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 ' Prepare pens and brushes Dim borderPen = New SolidPen(New ColorGray(128), 2.0F) Dim brush1 = New Bytescout.PDF.SolidBrush(New ColorRGB(255, 0, 0)) Dim brush2 = New Bytescout.PDF.SolidBrush(New ColorRGB(0, 255, 255)) ' Draw transparent rectangle with border only canvas.DrawRectangle(borderPen, 100, 100, 100, 50) ' Draw rounded rectangle with broder and filling canvas.DrawRoundedRectangle(borderPen, brush1, 250, 100, 100, 50, 10) ' Draw rectangle as polygon canvas.DrawPolygon(borderPen, brush2, New PointF() {New PointF(400, 100), New PointF(500, 100), New PointF(500, 150), New PointF(400, 150)}) ' 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
60 Day Free Trial or Visit ByteScout PDF Suite Home Page
Explore ByteScout PDF Suite Documentation
Explore Samples
Sign Up for ByteScout PDF Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout PDF Suite Home Page
Explore ByteScout PDF Suite Documentation
Explore Samples
Sign Up for ByteScout PDF Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: