ByteScout Premium Suite - VBScript - Draw rectangles in pdf with pdf sdk - ByteScout

ByteScout Premium Suite – VBScript – Draw rectangles in pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – VBScript – Draw rectangles in pdf with pdf sdk

How to draw rectangles in pdf with pdf sdk in VBScript using ByteScout Premium Suite

Continuous learning is a crucial part of computer science and this tutorial shows how to draw rectangles in pdf with pdf sdk in VBScript

On this page you will learn from code samples for programming in VBScript.Writing of the code to draw rectangles in pdf with pdf sdk in VBScript can be executed by programmers of any level using ByteScout Premium Suite. ByteScout Premium Suite is the set that includes 12 SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording and you can use it to draw rectangles in pdf with pdf sdk with VBScript.

These VBScript code samples for VBScript guide developers to speed up coding of the application when using ByteScout Premium Suite. Follow the instructions from scratch to work and copy the VBScript code. If you want to use these VBScript sample examples in one or many applications then they can be used easily.

You can download free trial version of ByteScout Premium Suite from our website to see and try many others source code samples for VBScript.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Rectangles.vbs
      
' This example demonstrates how to draw rectangles. ' Create Bytescout.PDF.Document object Set pdfDocument = CreateObject("Bytescout.PDF.Document") pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" Set comHelpers = pdfDocument.ComHelpers ' Add page Set page1 = comHelpers.CreatePage(comHelpers.PAPERFORMAT_A4) pdfDocument.Pages.Add(page1) Set canvas = page1.Canvas ' Prepare pens and brushes Set borderPen = comHelpers.CreateSolidPen(comHelpers.CreateColorGray(128), 2.0) Set brush1 = comHelpers.CreateSolidBrush(comHelpers.CreateColorRGB(255, 0, 0)) Set brush2 = comHelpers.CreateSolidBrush(comHelpers.CreateColorRGB(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_3 (borderPen), (brush1), 250, 100, 100, 50, 10 ' Draw rectangle as polygon Set pointsArray = comHelpers.CreatePointsArray(Array(Array(400, 100), Array(500, 100), Array(500, 150), Array(400, 150))) canvas.DrawPolygon_3 (borderPen), (brush2), (pointsArray) ' Save document to file pdfDocument.Save("result.pdf") ' Open document in default PDF viewer app Set shell = CreateObject("WScript.Shell") shell.Run "result.pdf", 1, false

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next