Skip to main content
Version: Version 5 beta

Interface: Document

Groups all the API actions related to document handling.

Properties

annotations

annotations: DocumentAnnotationsInterface

Groups all the API actions related to annotations.


deleteAnnotation()

deleteAnnotation: (annotation) => Promise<void>

Deletes the specified annotation from the document.

Parameters

annotation: Annotation

The annotation to be deleted.

Returns

Promise<void>

Example

await viewer.document.deleteAnnotation(annotation);


download()

download: (fileName, options?) => Promise<void>

Downloads the current document.

Parameters

fileName: string

The name of the file to be downloaded (default is ‘download.pdf’).

options?: DocumentSaveOptions

Document save options

Returns

Promise<void>

A promise that resolves when the document is downloaded.

Example

await viewer.document.download();


print()

print: (options?) => Promise<void>

Prints the current document.

Parameters

options?: DocumentPrintOptions

Document print options.

Returns

Promise<void>

A promise that resolves when the print dialog is closed.

Example

await viewer.document.print({ pageNumbers: [1, 2], dpi: 300 });


save()

save: (options?) => Promise<Blob>

Saves the current document.

Parameters

options?: DocumentSaveOptions

Document save options

Returns

Promise<Blob>

A promise that resolves to a Blob representing the saved document.

Example

await viewer.document.save();


tools

tools: DocumentToolsInterface

Groups all the API actions related to document tools.


updateAnnotation()

updateAnnotation: (annotation) => Promise<void>

Updates the specified annotation in the document.

Parameters

annotation: Annotation

The annotation to be updated.

Returns

Promise<void>

A promise that resolves when the annotation is updated.

Example

await viewer.document.updateAnnotation(annotation);