Skip to content

modern-pdf-lib


modern-pdf-lib / resizePage

Function: resizePage()

resizePage(doc, index, size): void

Defined in: src/core/pageManipulation.ts:324

Resize a page by setting its media box.

Note: This changes the page dimensions but does not scale existing content. Content that was drawn at coordinates beyond the new dimensions may be clipped.

Parameters

doc

PdfDocument

The PdfDocument to modify.

index

number

Zero-based page index.

size

PageSize

New page size.

Returns

void

Released under the MIT License.