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.

Try ByteScout PDF SDK today: Get 60 Day Free Trial or sign up for Web API

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

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

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout PDF SDK page

Explore ByteScout PDF SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next