ByteScout PDF SDK - VB.NET - Set Word Spacing for Text in PDF - ByteScout

ByteScout PDF SDK – VB.NET – Set Word Spacing for Text in PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VB.NET – Set Word Spacing for Text in PDF

How to set word spacing for text in PDF in VB.NET using ByteScout PDF SDK

How to set word spacing for text in PDF in VB.NET

Source code documentation samples provide quick and easy way to add a required functionality into your application. ByteScout PDF SDK is the component to help programmers in generating new pdf files, modifying and updating existing pdf documents or pdf forms. Provides support for auto-filling pdf forms, adding text with adjustable font, style, size, font family, new form fields, vector and raster drawings. It can be used to set word spacing for text in PDF using VB.NET.

The SDK samples like this one below explain how to quickly make your application do set word spacing for text in PDF in VB.NET with the help of ByteScout PDF SDK. Follow the instructions from the scratch to work and copy the VB.NET code. Test VB.NET sample code examples whether they respond your needs and requirements for the project.

Our website provides trial version of ByteScout PDF SDK for free. It also includes documentation and source code samples.

Try ByteScout PDF SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

Program.vb
      
Imports Bytescout.PDF ''' <summary> ''' This example demonstrates how to change the word spacing. ''' </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 canvas = page.Canvas Dim font = New Font("Arial", 16) Dim brush = New SolidBrush() Dim stringFormat = New StringFormat() ' Standard word spacing stringFormat.WordSpacing = 0.0F canvas.DrawString("Standard word spacing 0.0", font, brush, 20, 20, stringFormat) ' Increased word spacing stringFormat.WordSpacing = 5.0F canvas.DrawString("Increased word spacing 5.0", font, brush, 20, 50, stringFormat) ' Reduced word spacing stringFormat.WordSpacing = -2.5F canvas.DrawString("Reduced word spacing -2.5", font, brush, 20, 80, stringFormat) ' 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

Try ByteScout PDF SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

VIDEO

ON-PREMISE VERSION INFORMATION

Get 60 Day Free Trial or Visit ByteScout PDF SDK Home Page

Explore ByteScout PDF SDK Documentation

Get ByteScout PDF SDK Free Training

WEB API

Get Your Free API Key

Explore Web API Documentation

Tutorials:

prev
next