How can I help you?
PdfMargins
6 Feb 20262 minutes to read
A class representing PDF page margins.
// 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 bottom number
Get the bottom margin value of the page.
Set bottom void
Sets the bottom margin value of the page.
| Parameter | Type | Description |
|---|---|---|
| value | number |
Bottom margin. |
Get left number
Gets the left margin value of the page.
Set left void
Sets the left margin value of the page.
| Parameter | Type | Description |
|---|---|---|
| value | number |
Left margin. |
Get right number
Gets the right margin value of the page.
Set right void
Sets the right margin value of the page.
| Parameter | Type | Description |
|---|---|---|
| value | number |
Right margin. |
Get top number
Gets the top margin value of the page.
Set top void
Sets the top margin value of the page.
| Parameter | Type | Description |
|---|---|---|
| value | number |
Top margin. |