These sample source codes on this page below are displaying how to use string scaling in pdf with pdf sdk in VB.NET. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording and you can use it to use string scaling in pdf with pdf sdk with VB.NET.
These VB.NET code samples for VB.NET guide developers to speed up coding of the application when using ByteScout Premium Suite. IF you want to implement the functionality, just copy and paste this code for VB.NET below into your code editor with your app, compile and run your application. Enjoy writing a code with ready-to-use sample codes in VB.NET.
Trial version of ByteScout Premium Suite is available for free. Source code samples are included to help you with your VB.NET app.
Imports Bytescout.PDF ''' <summary> ''' This example demonstrates how to use the font scaling to expand a string. ''' </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() stringFormat.Scaling = 100.0F page.Canvas.DrawString("Normal string 100.0%", font, brush, 20, 20, stringFormat) stringFormat.Scaling = 50.0F page.Canvas.DrawString("Squeezed string 50.0%", font, brush, 20, 50, stringFormat) stringFormat.Scaling = 150.0F page.Canvas.DrawString("Expanded string 150.0%", 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