ByteScout PDF Suite - VBScript - Draw tables in pdf with pdf sdk - ByteScout

ByteScout PDF Suite – VBScript – Draw tables in pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – VBScript – Draw tables in pdf with pdf sdk

How to draw tables in pdf with pdf sdk in VBScript and ByteScout PDF Suite

Learning is essential in computer world and the tutorial below will demonstrate how to draw tables in pdf with pdf sdk in VBScript

Source code documentation samples give simple and easy method to install a needed feature into your application. Want to draw tables in pdf with pdf sdk in your VBScript app? ByteScout PDF Suite is designed for it. 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 SDK samples given below describe how to quickly make your application do draw tables in pdf with pdf sdk in VBScript with the help of ByteScout PDF Suite. IF you want to implement the functionality, just copy and paste this code for VBScript below into your code editor with your app, compile and run your application. Complete and detailed tutorials and documentation are available along with installed ByteScout PDF Suite if you’d like to learn more about the topic and the details of the API.

The trial version of ByteScout PDF Suite can be downloaded for free from our website. It also includes source code samples for VBScript and other programming languages.

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

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

Tables.vbs
      
' This example demonstrates how to create tables. ' 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 lightGrayColor = comHelpers.CreateColorGray(200) Set whiteColor = comHelpers.CreateColorGray(255) Set lightBlueColor = comHelpers.CreateColorRGB(200, 200, 250) Set lightRedColor = comHelpers.CreateColorRGB(255, 200, 200) ' Create a table and set default background color Set table = comHelpers.CreateTable() table.BackgroundColor = lightGrayColor ' Add row headers column and set its color table.Columns.Add(comHelpers.CreateTableColumn("RowHeaders", "")) table.Columns.Item(0).BackgroundColor = lightGrayColor ' Add columns A, B, C, ... For c = 0 To 9 columnName = Chr(65 + c) table.Columns.Add(comHelpers.CreateTableColumn(columnName, columnName)) Next ' Add rows For r = 0 To 9 ' Create new row and set its background color Set row = table.NewRow() row.BackgroundColor = whiteColor ' Set row header text row("RowHeaders").Text = CStr(r + 1) ' Set cell text For c = 0 To 9 columnName = Chr(65 + c) row(columnName).Text = columnName + CStr(r + 1) Next ' Add the row to the table table.Rows.Add(row) Next ' Decorate the table table.Rows.Item(1)("B").BackgroundColor = lightRedColor table.Columns.Item(2).BackgroundColor = lightBlueColor table.Rows.Item(1).BackgroundColor = lightBlueColor table.Rows.Item(1)("RowHeaders").BackgroundColor = lightBlueColor ' Draw the table on canvas page1.Canvas.DrawTable (table), 20, 20 ' 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 PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF 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 PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next