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

ByteScout PDF SDK – VBScript and VB6 – Set Word Spacing for Text in PDF

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

How to set word spacing for text in PDF in VBScript and VB6 with ByteScout PDF SDK

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

The sample shows steps and algorithm of how to set word spacing for text in PDF and how to make it work in your VBScript and VB6 application. ByteScout PDF SDK can set word spacing for text in PDF. It can be used from VBScript and VB6. ByteScout PDF SDK is the SDK for pdf documents generation, modification and updates. Can also generate and fill PDF forms. Provides support for text (fonts, style, size, font family), layers, pdf form fields, vector and raster drawings.

You will save a lot of time on writing and testing code as you may just take the VBScript and VB6 code from ByteScout PDF SDK for set word spacing for text in PDF below and use it in your application. In your VBScript and VB6 project or application you may simply copy & paste the code and then run your app! Enjoy writing a code with ready-to-use sample VBScript and VB6 codes.

ByteScout free trial version is available for download from our website. It includes all these programming tutorials along with source code samples.

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

WordSpacing.vbs
      
' This example demonstrates how to change the word 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 word spacing stringFormat.WordSpacing = 0.0 canvas.DrawString_4 "Standard word spacing 0.0", (font), (brush), 20, 20, (stringFormat) ' Increased word spacing stringFormat.WordSpacing = 5.0 canvas.DrawString_4 "Increased word spacing 5.0", (font), (brush), 20, 50, (stringFormat) ' Reduced word spacing stringFormat.WordSpacing = -2.5 canvas.DrawString_4 "Reduced word spacing -2.5", (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