/ PDF / PdfStringFormat
Search results

PdfStringFormat API in JavaScript PDF API control

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 = new PdfStandardFont(PdfFontFamily.Helvetica, 10);
// Create a new PDF string format
let format: PdfStringFormat = new PdfStringFormat(PdfTextAlignment.right, PdfVerticalAlignment.bottom);
// Draw the text
page.graphics.drawString('Helvetica', font, [0, 180, page.size[0], 40], undefined, new PdfBrush([0, 0, 255]), format);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();

Properties

paragraphIndent number

Gets the paragraph indent from string format.

subSuperScript PdfSubSuperScript

Gets the subscript or superscript mode from string format.