The sample source code below will teach you how to create new pdf document with pdf sdk in VBScript. What is ByteScout Premium Suite? It is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording. It can help you to create new pdf document with pdf sdk in your VBScript application.
This prolific sample source code in VBScript for ByteScout Premium Suite contains various functions and other necessary options you should do calling the API to create new pdf document with pdf sdk. Just copy and paste the code into your VBScript application’s code and follow the instructions. This basic programming language sample code for VBScript will do the whole work for you to create new pdf document with pdf sdk.
Trial version of ByteScout Premium Suite is available for free. Source code samples are included to help you with your VBScript app.
' This example demonstrates how to create a document and save it to file. ' 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) ' Add sample content Set timesFont = comHelpers.CreateStandardFont(comHelpers.STANDARDFONTS_TIMES, 24) Set blackBrush = comHelpers.CreateSolidBrush(comHelpers.CreateColorGray(0)) page1.Canvas.DrawString "Hello world!", (timesFont), (blackBrush), 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