ReadonlyacroformsAcroForm fields.
ReadonlyattachmentsFile attachments.
Optional ReadonlyauthorDocument author.
ReadonlybookmarksBookmarks/outlines tree.
ReadonlybookmarksNumber of bookmarks.
Optional ReadonlycreateDocument creation date.
Optional ReadonlycreatorApplication that created the document.
Optional ReadonlyfontsDocument and system fonts.
ReadonlyhasTrue if redo is available.
ReadonlyhasTrue if undo is available.
ReadonlyidUnique identifier for this document instance.
ReadonlyisWhether the document has unsaved changes.
ReadonlyisWhether the document is in read-only mode (no editing allowed).
ReadonlyisWhether the document has digital signatures.
ReadonlykeywordsDocument keywords.
ReadonlylayersOptional content layers.
Optional ReadonlymodifyDocument last modification date.
ReadonlynameFilename of the document.
ReadonlyonFires when bookmarks change.
ReadonlyonFires after a command completes successfully.
ReadonlyonFires before a command starts executing.
ReadonlyonFires when a command fails.
ReadonlyonFires when document modification state changes.
ReadonlyonFires when a specific page is modified.
ReadonlyonFires when page structure changes (add/delete).
ReadonlyonFires when read-only state changes.
ReadonlyonFires when undo/redo state changes.
ReadonlypagePage reading direction (LTR or RTL).
Optional ReadonlypagePDF page layout (single page, continuous, etc.).
Optional ReadonlypagePDF page mode (thumbnails, outlines, etc.).
ReadonlypermissionsPermission flags as string.
Optional ReadonlyproducerPDF producer string.
ReadonlysecurityDocument security settings (encryption, passwords).
ReadonlysignaturesDigital signatures.
ReadonlysizeFile size in bytes.
Optional ReadonlysubjectDocument subject.
Optional ReadonlytitleDocument title.
ReadonlyundoUndo/redo history state.
Compresses the document by optimizing images and removing unnecessary data. Requires owner password authorization if the document has owner-level restrictions.
The compression quality mode
Promise resolving to compressed document as Uint8Array
Converts all pages of the document to PNG images and packages them into a ZIP file. Requires owner password authorization if the document has owner-level restrictions.
Optionaldpi: numberScaling factor for image resolution (default: 1). - 1 = standard resolution (96 DPI equivalent) - 2 = high resolution (192 DPI equivalent, retina displays) - 3 = very high resolution (288 DPI equivalent) Higher values produce sharper images but larger file sizes.
Promise resolving to a File object containing a ZIP archive with all page images named as {documentName}_Page_{N}.png
Extracts all text content from the document and returns it as a plain text file. Text is extracted from all pages with proper spacing and page separators. Requires owner password authorization if the document has owner-level restrictions.
OptionalpageSeparator: stringOptional separator string between pages (default: '------------------------------')
Promise resolving to a File object containing all extracted text as {documentName}.txt
Extracts a single image from the document. Requires owner password authorization if the document has owner-level restrictions.
Image extraction parameters
Promise resolving to extracted image data
Extracts multiple images from the document. Requires owner password authorization if the document has owner-level restrictions.
Image extraction parameters
Promise resolving to extracted images data
Extracts specific pages from the document as a new PDF. Requires owner password authorization if the document has owner-level restrictions.
Page extraction parameters
Promise resolving to extracted pages data
Sanitizes the document by removing hidden content, metadata, attachments, and other sensitive data. Requires owner password authorization if the document has owner-level restrictions.
Promise resolving to sanitized document as Uint8Array
Sets the document to read-only mode, preventing all editing operations.
Represents an open PDF document and provides methods for manipulation.
Extends
IDocumentCommandsBasewhich contains all command methods (addPage, deletePage, etc.).Example