/ PDF / PdfPageSettings
Search results

PdfPageSettings API in JavaScript PDF API control

The class provides various settings related to PDF pages.

// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Create a new PDF page settings instance
let pageSettings: PdfPageSettings = new PdfPageSettings();
// Sets the margins
pageSettings.margins = new PdfMargins(40);
// Sets the page size
pageSettings.size = [595, 842];
// Sets the page orientation
pageSettings.orientation = PdfPageOrientation.landscape;
// Add a new PDF page with page settings
page = document.addPage(pageSettings);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();

Properties

margins PdfMargins

Gets the margin value of the page.

orientation PdfPageOrientation

Gets the orientation of the page.

rotation PdfRotationAngle

Gets the rotation angle of the PDF page.

size number[]

Gets the size of the page.