HelpBot Assistant

How can I help you?

PdfStringFormat

6 Feb 20261 minute to read

Represents the text layout information.

// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Gets the first page
let page: PdfPage = document.getPage(0) as PdfPage;
// Create a new PDF standard font
let font: PdfStandardFont = document.embedFont(PdfFontFamily.helvetica, 10, PdfFontStyle.regular);
// Create a new PDF string format
let format: PdfStringFormat = new PdfStringFormat(PdfTextAlignment.right, PdfVerticalAlignment.bottom);
// Draw the text
page.graphics.drawString('Helvetica', font, {x: 0, y: 180, width: page.size.width, height: 40}, new PdfBrush({r: 0, g: 0, b: 255}), format);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();

Properties

Get paragraphIndent number

Gets the paragraph indent from string format.

Set paragraphIndent void

Sets the paragraph indent to string format.

Parameter Type Description
value number Paragraph indent.

Get subSuperScript PdfSubSuperScript

Gets the subscript or superscript mode from string format.

Set subSuperScript void

Sets the subscript or superscript mode to string format.

Parameter Type Description
value PdfSubSuperScript Subscript or superscript mode.