ByteScout PDF SDK - VBScript and VB6 - Set Inter-Character Spacing for Text in PDF - ByteScout

ByteScout PDF SDK – VBScript and VB6 – Set Inter-Character Spacing for Text in PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VBScript and VB6 – Set Inter-Character Spacing for Text in PDF

How to set inter character spacing for text in PDF in VBScript and VB6 and ByteScout PDF SDK

This code in VBScript and VB6 shows how to set inter character spacing for text in PDF with this how to tutorial

Set inter character spacing for text in PDF is easy to implement in VBScript and VB6 if you use these source codes below. ByteScout PDF SDK is the pdf library that can create, update and modify PDF files. Supports text with fonts and style selections, layers, form fields, drawing lines and objects, automatic tables, images. Can be used to create and fill pdf forms. It can be used to set inter character spacing for text in PDF using VBScript and VB6.

This code snippet below for ByteScout PDF SDK works best when you need to quickly set inter character spacing for text in PDF in your VBScript and VB6 application. Follow the instructions from the scratch to work and copy the VBScript and VB6 code. This basic programming language sample code for VBScript and VB6 will do the whole work for you to set inter character spacing for text in PDF.

ByteScout PDF SDK free trial version is available on our website. VBScript and VB6 and other programming languages are supported.

Try it today: Get 60 Day Free Trial or sign up for Web API

IntercharacterSpacing.vbs
      
' This example demonstrates how to change the intercharacter spacing. ' 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 Set font = comHelpers.CreateSystemFont("Arial", 16) Set brush = comHelpers.CreateSolidBrush(comHelpers.CreateColorGray(0)) Set stringFormat = comHelpers.CreateStringFormat() ' Standard spacing stringFormat.CharacterSpacing = 0.0 canvas.DrawString_4 "Standard intercharacter spacing 0.0", (font), (brush), 20, 20, (stringFormat) ' Increased spacing stringFormat.CharacterSpacing = 1.0 canvas.DrawString_4 "Increased intercharacter spacing 1.0", (font), (brush), 20, 50, (stringFormat) ' Reduced spacing stringFormat.CharacterSpacing = -0.75 canvas.DrawString_4 "Reduced intercharacter spacing -0.75", (font), (brush), 20, 80, (stringFormat) ' 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

Try it today: Get 60 Day Free Trial or sign up for Web API

MORE INFORMATION

Get 60 Day Free Trial or Visit ByteScout PDF SDK page

Explore ByteScout PDF SDK documentation

WEB API VERSION

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next