ByteScout PDF Suite - VB.NET - Create tables in pdf with pdf sdk - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF Suite – VB.NET – Create tables in pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – VB.NET – Create tables in pdf with pdf sdk

How to create tables in pdf with pdf sdk in VB.NET and ByteScout PDF Suite

Learning is essential in computer world and the tutorial below will demonstrate how to create tables in pdf with pdf sdk in VB.NET

Source code documentation samples give simple and easy method to install a needed feature into your application. ByteScout PDF Suite: the bundle that provides six different SDK libraries 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. It can create tables in pdf with pdf sdk in VB.NET.

Want to save time? You will save a lot of time on writing and testing code as you may just take the VB.NET code from ByteScout PDF Suite for create tables in pdf with pdf sdk below and use it in your 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 create tables in pdf with pdf sdk.

If you want to try other source code samples then the free trial version of ByteScout PDF Suite is available for download from our website. Just try other source code samples for VB.NET.

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

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

Program.vb
      
Imports Bytescout.PDF ''' <summary> ''' This example demonstrates how to create tables. ''' </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 lightGrayColor = New ColorGray(200) Dim whiteColor = New ColorGray(255) Dim lightBlueColor = New ColorRGB(200, 200, 250) Dim lightRedColor = New ColorRGB(255, 200, 200) ' Create a table and set default background color Dim table = New Table() table.BackgroundColor = lightGrayColor ' Add row headers column and set its color table.Columns.Add(New TableColumn("RowHeaders")) table.Columns(0).BackgroundColor = lightGrayColor ' Add columns A, B, C, ... For c As Integer = 0 To 9 Dim columnName = Convert.ToChar(65 + c).ToString() table.Columns.Add(New TableColumn(columnName, columnName)) Next ' Add rows For r As Integer = 0 To 9 ' Create new row and set its background color Dim row = table.NewRow() row.BackgroundColor = whiteColor ' Set row header text row("RowHeaders").Text = (r + 1).ToString() ' Set cell text For c As Integer = 0 To 9 Dim columnName As String = Convert.ToChar(65 + c).ToString() row(columnName).Text = columnName + (r + 1).ToString() Next ' Add the row to the table table.Rows.Add(row) Next ' Decorate the table table.Rows(1)("B").BackgroundColor = lightRedColor table.Columns(2).BackgroundColor = lightBlueColor table.Rows(1).BackgroundColor = lightBlueColor table.Rows(1)("RowHeaders").BackgroundColor = lightBlueColor ' Draw the table on canvas page.Canvas.DrawTable(table, 20, 20) ' 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

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