ByteScout PDF SDK - VBScript and VB6 - Enable Superscript or Subscript for Text in PDF - ByteScout

ByteScout PDF SDK – VBScript and VB6 – Enable Superscript or Subscript for Text in PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VBScript and VB6 – Enable Superscript or Subscript for Text in PDF

enable superscript or subscript for text in PDF in VBScript and VB6 and ByteScout PDF SDK

enable superscript or subscript for text in PDF in VBScript and VB6

Writing of the code to enable superscript or subscript for text in PDF in VBScript and VB6 can be done by developers of any level using ByteScout PDF SDK. ByteScout PDF SDK helps with enable superscript or subscript for text in PDF in VBScript and VB6. 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.

You will save a lot of time on writing and testing code as you may just take the code below and use it in your application. VBScript and VB6 sample code is all you need: copy and paste the code to your VBScript and VB6 application’s code editor, add a reference to ByteScout PDF SDK (if you haven’t added yet) and you are ready to go! Use of ByteScout PDF SDK in VBScript and VB6 is also explained in the documentation included along with the product.

On our website you may get trial version of ByteScout PDF SDK for free. Source code samples are included to help you with your VBScript and VB6 application.

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

SuperscripAndSubscript.vbs
      
' This example demonstrates how to create a document and save it to file. ' 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 font = comHelpers.CreateSystemFont("Arial", 16) Set brush = comHelpers.CreateSolidBrush(comHelpers.CreateColorGray(0)) Set stringFormat = comHelpers.CreateStringFormat() xPosition = 20 ' Draw normal string page1.Canvas.DrawString_4 "Normal text ", (font), (brush), xPosition, 50, (stringFormat) xPosition = xPosition + font.GetTextWidth("Normal text ") ' Draw subscript string stringFormat.Rise = -5 page1.Canvas.DrawString_4 "Subscript", (font), (brush), xPosition, 50, (stringFormat) xPosition = xPosition + font.GetTextWidth("Subscript") ' draw superscript string stringFormat.Rise = +5 page1.Canvas.DrawString_4 "Superscript", (font), (brush), xPosition, 50, (stringFormat) xPosition = xPosition + font.GetTextWidth("Superscript") ' Draw the baseline Set pen = comHelpers.CreateSolidPen(comHelpers.CreateColorRGB(0, 0, 255), 1.0) pen.Opacity = 50 page1.Canvas.DrawLine (pen), 20, 50 + font.Size, xPosition, 50 + font.Size ' 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 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