How can I help you?
PdfPageSettings
6 Feb 20262 minutes to read
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 = {width: 595, height: 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
Get margins PdfMargins
Gets the margin value of the page.
Set margins void
Sets the margin value of the page.
| Parameter | Type | Description |
|---|---|---|
| value | PdfMargins |
PDF margins |
Get orientation PdfPageOrientation
Gets the orientation of the page.
Set orientation void
Sets the orientation of the page.
| Parameter | Type | Description |
|---|---|---|
| value | PdfPageOrientation |
The orientation. |
Get rotation PdfRotationAngle
Gets the rotation angle of the PDF page.
Set rotation void
Sets the rotation angle of the PDF page.
| Parameter | Type | Description |
|---|---|---|
| value | PdfRotationAngle |
PDF rotation angle |
Get size Size
Gets the size of the page.
Set size void
Sets the width and height of the page.
| Parameter | Type | Description |
|---|---|---|
| value | Size |
The width and height of the page as number array. |