ByteScout PDF SDK - VB.NET - Set Superscript and Subscript for Text in PDF - ByteScout

ByteScout PDF SDK – VB.NET – Set Superscript and Subscript for Text in PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VB.NET – Set Superscript and Subscript for Text in PDF

How to set superscript and subscript for text in PDF in VB.NET with ByteScout PDF SDK

This code in VB.NET shows how to set superscript and subscript for text in PDF with this how to tutorial

Learn how to set superscript and subscript for text in PDF in VB.NET with this source code sample. ByteScout PDF SDK: 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. It can set superscript and subscript for text in PDF in VB.NET.

The SDK samples like this one below explain how to quickly make your application do set superscript and subscript for text in PDF in VB.NET with the help of ByteScout PDF SDK. Just copy and paste the code into your VB.NET application’s code and follow the instruction. Use of ByteScout PDF SDK in VB.NET is also explained in the documentation included along with the product.

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

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 a document and save it to file. ''' </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 font = New Font("Arial", 16) Dim brush = New SolidBrush() Dim stringFormat = New StringFormat() Dim xPosition As Single = 20 ' Draw normal string page.Canvas.DrawString("Normal text ", font, brush, xPosition, 50, stringFormat) xPosition += font.GetTextWidth("Normal text ") ' Draw subscript string stringFormat.Rise = -5 page.Canvas.DrawString("Subscript", font, brush, xPosition, 50, stringFormat) xPosition += font.GetTextWidth("Subscript") ' draw superscript string stringFormat.Rise = +5 page.Canvas.DrawString("Superscript", font, brush, xPosition, 50, stringFormat) xPosition += font.GetTextWidth("Superscript") ' Draw the baseline Dim pen = New SolidPen(New ColorRGB(0, 0, 255)) pen.Opacity = 50 page.Canvas.DrawLine(pen, 20, 50 + font.Size, xPosition, 50 + font.Size) ' 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 SDK Home Page

Explore ByteScout PDF SDK Documentation

Explore Samples

Sign Up for ByteScout PDF SDK 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 SDK Home Page

Explore ByteScout PDF SDK Documentation

Explore Samples

Sign Up for ByteScout PDF SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next