[]
GcDocs PDF Viewer options class.
allowedTools: object;
Use this option to enable annotation tools from the form editor or field tools from the annotation editor.
optional annotationEditor: string[] | "all" | "annotations" | "fields";
optional formEditor: string[] | "all" | "annotations" | "fields";
optional viewer: string[] | "all" | "annotations" | "fields";
{
annotationEditor: 'annotations',
formEditor: 'fields'
}
viewer.options.allowedTools = { formEditor: 'all' };
optional allowModificationDateEdit: boolean;
Specifies whether the modification date of an annotation can be edited in the UI.
false
If set to true
, the modification date field in the property grid UI will be editable.
By default, it is set to false
, making the modification date read-only.
// Configure the Viewer to allow editing of the Modification Date in the Annotation Editor UI
var viewer = new DsPdfViewer(selector, {
allowModificationDateEdit: true
});
optional annotationDateTimeFormat: string;
Allows you to specify a custom format for displaying the date and time of annotations. By default, it uses a locale-based format. You can set your own format string (e.g., 'YYYY-MM-DD HH:mm:ss') to suit your preferences.
undefined
// Example: set a custom date and time format:
var viewer = new DsPdfViewer("#root", { annotationDateTimeFormat: 'YYYY-MM-DD HH:mm:ss' });
optional baseUrl: string;
Used by form submission and for theme urls.
var viewer = new DsPdfViewer("#root", { baseUrl: "http://localhost/mysite/" });
optional caret:
| boolean
| {
allowForPan: boolean;
caretBlinkTime: number;
caretStopBlinkTime: number;
color: string;
width: number;
};
Text selection cursor settings.
Settings description:
caretBlinkTime - milliseconds, caret blink period
caretStopBlinkTime - milliseconds, stop caret blink time, 0 - don't stop
color - The caret color
width - The caret width
allowForPan - Allow to move caret using keys even when pan tool activated.
// Hide the caret:
var viewer = new DsPdfViewer("#root", { caret: false } );
// Change the caret color and width:
var viewer = new DsPdfViewer("#root", { caret: {"color": "#ff0000", "width": 2} } );
optional cMapPacked: boolean;
Indicates if the viewer should look for a compressed version of the CMap file with the extension '.bin'.
true
var viewer = new DsPdfViewer("#root", { cMapPacked: false } );
optional cMapUrl: string;
The URI to a folder where the external font CMap tables are stored.
'resources/bcmaps/'
var viewer = new DsPdfViewer("#root", { cMapUrl: "../data/cmaps/" } );
optional coordinatesOrigin: "TopLeft" | "BottomLeft";
Origin coordinates for the PDF page. The option is used for a properties panel of the Annotation and Form editor.
TopLeft
// Change the coordinates origin to bottom/left point:
var viewer = new DsPdfViewer("#root", { coordinatesOrigin: "BottomLeft" } );
coordinatesPrecision: number;
Annotation coordinates round precision. Used by the Annotation and Form editor.
1
// Change the default rounding precision to 0.001:
var viewer = new DsPdfViewer("#root", { coordinatesPrecision: 0.001 } );
optional customIcons: object;
Use this option to change the default SVG icons to custom ones. Available icon keys: 'undo2', 'font-bold', 'font-italic', 'checkbox-checked', 'checkbox-unchecked', 'close', 'aspect-ratio', 'search', 'chevron', 'chevron-accent', 'animated-spinner', 'drag-handle', 'download', 'keyboard', 'brush', 'image', 'image-list', 'save', 'theme-change', 'single-page', 'continuous-view', 'view-mode', 'show-view-tools', 'show-edit-tools', 'show-form-editor', 'toggle-annotation-properties', 'toggle-form-properties', 'edit-converted-to-content', 'edit-free-text', 'edit-ink', 'edit-text', 'edit-square', 'edit-line', 'edit-link', 'edit-circle', 'edit-stamp', 'add-stamp-accent', 'edit-sign-tool', 'edit-file-attachment', 'edit-sound', 'edit-polyline', 'edit-polygon', 'edit-popup', 'edit-redact', 'edit-redact-apply', 'edit-redact-applied', 'edit-unknown-type', 'edit-widget-signature', 'edit-widget-tx-field', 'edit-widget-tx-text-area', 'edit-widget-tx-comb', 'edit-widget-tx-password', 'edit-widget-btn-checkbox', 'edit-widget-btn-radio', 'edit-widget-btn-push', 'edit-widget-btn-submit', 'edit-widget-btn-reset', 'edit-widget-ch-combo', 'edit-widget-ch-list-box', 'edit-widget-unknown-type', 'edit-undo', 'edit-redo', 'remove-attachment', 'edit-select', 'edit-erase', 'form-filler', 'field-invalid', 'new-document', 'new-page', 'delete-page', 'print', 'rotate', 'confirm-ok', 'confirm-cancel', 'open', 'open-pdf', 'text-selection', 'hide-annotations', 'pan', 'bookmarks', 'structure-tree', 'layers', 'thumbnails', 'articles', 'attachments', 'documents-list', 'share', 'shared-documents-list', 'view-mode-on', 'view-mode-off', 'edit-mode-on', 'edit-mode-off', 'remove-user', 'doc-properties', 'about', 'pdf-doc-title', 'close-icon-sm', 'menu-dots', 'comments-status-accepted', 'comments-status-cancelled', 'comments-status-completed', 'comments-status-rejected', 'context-copy', 'context-paste', 'context-cut', 'context-delete', 'move-to-top-page', 'move-to-bottom-page', 'arrow-expand-horizontal', 'arrow-expand-all', 'magnify-minus-outline', 'magnify-plus-outline', 'magnify', 'text-tools', 'draw-tools', 'attachment-tools', 'form-tools', 'page-tools', 'resize-handle-h'.
[iconKey: string]: string | Element
var viewer = new DsPdfViewer(selector, {
customIcons: {
'open': '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M9.516 14.016q1.875 0 3.188-1.313t1.313-3.188-1.313-3.188-3.188-1.313-3.188 1.313-1.313 3.188 1.313 3.188 3.188 1.313zM15.516 14.016l4.969 4.969-1.5 1.5-4.969-4.969v-0.797l-0.281-0.281q-1.781 1.547-4.219 1.547-2.719 0-4.617-1.875t-1.898-4.594 1.898-4.617 4.617-1.898 4.594 1.898 1.875 4.617q0 0.984-0.469 2.227t-1.078 1.992l0.281 0.281h0.797z"></path></svg>',
'search': '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M9.516 14.016q1.875 0 3.188-1.313t1.313-3.188-1.313-3.188-3.188-1.313-3.188 1.313-1.313 3.188 1.313 3.188 3.188 1.313zM15.516 14.016l4.969 4.969-1.5 1.5-4.969-4.969v-0.797l-0.281-0.281q-1.781 1.547-4.219 1.547-2.719 0-4.617-1.875t-1.898-4.594 1.898-4.617 4.617-1.898 4.594 1.898 1.875 4.617q0 0.984-0.469 2.227t-1.078 1.992l0.281 0.281h0.797z"></path></svg>'
}
});
optional disableFeatures: ViewerFeatureName[];
Use the disableFeatures option to disable certain features of the DsPdfViewer depending on your company security policy. Note, you can specify the disableFeatures option only during the DsPdfViewer initialization.
// Disable DragAndDrop operations, JavaScript actions, File and Sound attachments:
var viewer = new DsPdfViewer("#root", { disableFeatures: ['DragAndDrop', 'JavaScript', 'AllAttachments'] } );
// Disable DragAndDrop for the DsPdfViewer:
var viewer = new DsPdfViewer(selector, {
disableFeatures: ['DragAndDrop']
});
disableHistory: boolean;
If set to true, disables browser history during navigation inside PDF document.
var viewer = new DsPdfViewer(selector, {
disableHistory: true
});
optional disablePageLabels: boolean;
Set this option to true if you wish to disable page labels.
var viewer = new DsPdfViewer("#root", { disablePageLabels: true } );
documentListUrl: string | DocumentListItem[];
URL to document list service used by DocumentListPanel (see addDocumentListPanel method). The service should return JSON string with available documents array, e.g.: [{"path": "doc1.pdf"}, {"path": "doc2.pdf", "name": "Hello doc 2", "title": "title 2"}] or ["pdf1.pdf", "pdf2.pdf"]
"/documents"
// Load document list from external service:
var viewer = new DsPdfViewer("#root", { documentListUrl: "documents.json" } );
Here is the content of the documents.json file:
[
{
"path": "/sample1.pdf",
"name": "Simple text",
"title": "Sample 1"
},
{
"path": "/sample2.pdf",
"previewContent": "<b>Preview HTML content</b> goes here.",
"title": "Sample 2"
},
{
"path": "/sample3.pdf",
"name": "Open sample3.pdf",
"title": "Sample 3"
}
]
// Load document list using DATA URI:
var viewer = new DsPdfViewer("#root", { documentListUrl: 'data:,[{"path": "doc1.pdf"}, {"path": "doc2.pdf", "name": "Hello doc 2", "title": "title 2"}]' } );
// Use predefined document list:
var options = {};
options.documentListUrl = [
{
path: "/sample1.pdf",
name: "Open sample1.pdf",
title: "Sample 1"
},
{
path: "/sample2.pdf",
name: "Open sample2.pdf",
title: "Sample 2"
},
{
path: "/sample3.pdf",
name: "Open sample3.pdf",
title: "Sample 3"
}
];
var viewer = new DsPdfViewer("#root", options);
// Use predefined document list with custom preview content:
var options = {};
options.documentListUrl = [
{
path: "/sample1.pdf",
title: "Sample 1",
previewContent: `<div class="card" style="position: relative;">
<h2 class="header" style="line-height: 30px;height: 30px;display: block;text-align: center;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="24" height="24" viewBox="0 0 17 24" style="position: absolute;top: 3px;left: 0px;"><path class="gc-icon-color--text" d="M15.429 3.429h-13.714v16.634l6.857-6.576 1.192 1.138 5.665 5.438v-16.634zM15.589 1.714c0.201 0 0.402 0.040 0.589 0.121 0.589 0.228 0.964 0.777 0.964 1.379v17.263c0 0.603-0.375 1.152-0.964 1.379-0.188 0.080-0.388 0.107-0.589 0.107-0.415 0-0.804-0.147-1.112-0.429l-5.906-5.679-5.906 5.679c-0.308 0.281-0.696 0.442-1.112 0.442-0.201 0-0.402-0.040-0.589-0.121-0.589-0.228-0.964-0.777-0.964-1.379v-17.263c0-0.603 0.375-1.152 0.964-1.379 0.188-0.080 0.388-0.121 0.589-0.121h14.036z"></path></svg><span style="padding-left: 10px; width: 100%; text-align: center;">Sample 1</span>
</h2>
<div class="container">
<p>Long sample 1 description goes here.</p><div style="width: 100%;text-align: center;"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50" style="
border: 1px dashed #cccccc; padding: 10px; width: 100px; height: 100px; display: inline-block; fill: #999999;
">
<title>eye</title>
<path d="M25 9.375c-10.904 0-20.356 6.35-25 15.625 4.644 9.275 14.096 15.625 25 15.625s20.355-6.35 25-15.625c-4.644-9.275-14.096-15.625-25-15.625zM37.327 17.661c2.938 1.874 5.427 4.383 7.297 7.339-1.87 2.955-4.359 5.465-7.297 7.339-3.691 2.354-7.954 3.599-12.327 3.599s-8.636-1.244-12.327-3.599c-2.937-1.874-5.427-4.383-7.296-7.339 1.87-2.955 4.359-5.465 7.297-7.339 0.191-0.122 0.385-0.24 0.579-0.356-0.486 1.334-0.752 2.775-0.752 4.277 0 6.903 5.596 12.5 12.5 12.5s12.5-5.597 12.5-12.5c0-1.503-0.266-2.943-0.752-4.277 0.194 0.116 0.388 0.234 0.579 0.357v0zM25 20.313c0 2.589-2.099 4.688-4.688 4.688s-4.688-2.099-4.688-4.688 2.099-4.688 4.688-4.688 4.688 2.099 4.688 4.688z"></path>
</svg>
<p></p></div>
</div>
</div>`
},
{
path: "/sample2.pdf",
title: "Sample 2",
previewContent: `<div class="card" style="position: relative;">
<h2 class="header" style="line-height: 30px;height: 30px;display: block;text-align: center;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="24" height="24" viewBox="0 0 17 24" style="position: absolute;top: 3px;left: 0px;"><path class="gc-icon-color--text" d="M15.429 3.429h-13.714v16.634l6.857-6.576 1.192 1.138 5.665 5.438v-16.634zM15.589 1.714c0.201 0 0.402 0.040 0.589 0.121 0.589 0.228 0.964 0.777 0.964 1.379v17.263c0 0.603-0.375 1.152-0.964 1.379-0.188 0.080-0.388 0.107-0.589 0.107-0.415 0-0.804-0.147-1.112-0.429l-5.906-5.679-5.906 5.679c-0.308 0.281-0.696 0.442-1.112 0.442-0.201 0-0.402-0.040-0.589-0.121-0.589-0.228-0.964-0.777-0.964-1.379v-17.263c0-0.603 0.375-1.152 0.964-1.379 0.188-0.080 0.388-0.121 0.589-0.121h14.036z"></path></svg><span style="padding-left: 10px;width: 100%;text-align: center;">Sample 2</span>
</h2>
<div class="container">
<p>Long sample 2 description goes here.</p><div style="width: 100%;text-align: center;"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50" style="
border: 1px dashed #cccccc; padding: 10px; width: 100px; height: 100px; display: inline-block; fill: #999999;">
<title>eye</title>
<path d="M25 9.375c-10.904 0-20.356 6.35-25 15.625 4.644 9.275 14.096 15.625 25 15.625s20.355-6.35 25-15.625c-4.644-9.275-14.096-15.625-25-15.625zM37.327 17.661c2.938 1.874 5.427 4.383 7.297 7.339-1.87 2.955-4.359 5.465-7.297 7.339-3.691 2.354-7.954 3.599-12.327 3.599s-8.636-1.244-12.327-3.599c-2.937-1.874-5.427-4.383-7.296-7.339 1.87-2.955 4.359-5.465 7.297-7.339 0.191-0.122 0.385-0.24 0.579-0.356-0.486 1.334-0.752 2.775-0.752 4.277 0 6.903 5.596 12.5 12.5 12.5s12.5-5.597 12.5-12.5c0-1.503-0.266-2.943-0.752-4.277 0.194 0.116 0.388 0.234 0.579 0.357v0zM25 20.313c0 2.589-2.099 4.688-4.688 4.688s-4.688-2.099-4.688-4.688 2.099-4.688 4.688-4.688 4.688 2.099 4.688 4.688z"></path>
</svg>
<p></p></div>
</div>
</div>`
},
{
path: "/sample3.pdf",
name: "Open sample3.pdf",
title: "Sample 3 without custom preview content"
}
];
var viewer = new DsPdfViewer("#root", options);
viewer.addDefaultPanels();
const documentListPanelHandle = viewer.addDocumentListPanel();
viewer.onAfterOpen.register(function() {
viewer.leftSidebar.menu.panels.open(documentListPanelHandle.id);
});
editorDefaults: object;
Contains default values for a new annotations and fields.
optional checkBoxButton: Partial<ButtonWidget>;
Default properties for CheckBox button widget.
optional circleAnnotation: Partial<CircleAnnotation>;
Default properties for Circle annotation.
optional comboChoice: Partial<ChoiceWidget>;
Default properties for Combo choice widget.
optional combTextField: Partial<TextWidget>;
Default properties for Comb Text field widget.
optional dotHandleSize: number;
Dot handle size in pixels. Used for callout points.
8
var viewer = new DsPdfViewer("#root", {
editorDefaults: {
dotHandleSize: 20
},
supportApi: { apiUrl: 'support-api/gc-pdf-viewer', webSocketUrl: false }
});
optional fileAttachmentAnnotation: Partial<FileAttachmentAnnotation>;
Default properties for FileAttachment annotation.
optional fontNames: object[];
Array of the available font names.
[
{ value: 'Helv', name: 'Helvetica' }, { value: 'HelveticaRegular', name: 'Helvetica-Oblique' }, { value: 'HelveticaBold', name: 'Helvetica-Bold' }, { value: 'HelveticaBoldItalic', name: 'Helvetica-BoldOblique' },
{ value: 'TimesRegular', name: 'Times-Roman' }, { value: 'TimesItalic', name: 'Times-Italic' }, { value: 'TimesBold', name: 'Times-Bold' }, { value: 'TimesBoldItalic', name: 'Times-BoldItalic' },
{ value: 'CourierRegular', name: 'Courier' }, { value: 'CourierItalic', name: 'Courier-Oblique' }, { value: 'CourierBold', name: 'Courier-Bold' }, { value: 'CourierBoldItalic', name: 'Courier-BoldOblique' },
{ value: 'Symbol', name: 'Symbol' }
]
var viewer = new DsPdfViewer("#root", {
editorDefaults: { fontNames: [{value: 'Arial', name: 'Arial'}, {value: 'Verdana', name: 'Verdana'}] },
supportApi: { apiUrl: 'support-api/gc-pdf-viewer', webSocketUrl: false }
});
optional freeTextAnnotation: Partial<FreeTextAnnotation>;
Default properties for FreeText annotation.
optional hideFloatingBar: boolean;
Set this setting to true if you do not want to display an additional floating bar for editor mode.
var viewer = new DsPdfViewer("#root", {
editorDefaults: { hideFloatingBar: true },
supportApi: { apiUrl: 'support-api/gc-pdf-viewer', webSocketUrl: false }
});
optional highlightAnnotation: Partial<HighlightAnnotation>;
Default properties for Highlight annotation.
optional inkAnnotation: Partial<InkAnnotation>;
Default properties for Ink annotation.
optional lastValueKeys: string[];
Last values keys.
["appearanceColor", "borderStyle", "color", "interiorColor", "backgroundColor", "borderColor", "opacity", "textAlignment", "printableFlag", "open",
"lineStart", "lineEnd", "markBorderColor", "markFillColor", "overlayFillColor", "overlayText", "overlayTextJustification", "newWindow", "calloutLineEnd", "fontSize",
"fontName", "name", "readOnly", "required", "hasEditFlag"]
// Remember only the borderStyle property:
var viewer = new DsPdfViewer("#root", { editorDefaults: { rememberLastValues: true, lastValueKeys: ["borderStyle"] } });
optional lineAnnotation: Partial<LineAnnotation>;
Default properties for Line annotation.
optional linkAnnotation: Partial<LinkAnnotation>;
Default properties for Link annotation.
optional listBoxChoice: Partial<ChoiceWidget>;
Default properties for ListBox choice widget.
optional moveHandleSize: number;
Move handle size in pixels.
14
var viewer = new DsPdfViewer("#root", {
editorDefaults: {
moveHandleSize: 40
},
supportApi: { apiUrl: 'support-api/gc-pdf-viewer', webSocketUrl: false }
});
optional passwordField: Partial<TextWidget>;
Default properties for Password field widget.
optional polygonAnnotation: Partial<PolygonAnnotation>;
Default properties for Polygon annotation.
optional polyLineAnnotation: Partial<PolyLineAnnotation>;
Default properties for PolyLine annotation.
optional popupAnnotation: Partial<PopupAnnotation>;
Default properties for Popup annotation.
optional printResolution: number;
The printResolution
option specifies the resolution (in dots per inch - DPI) used for printing PDF documents.
It determines the quality and detail of the rendered images during the printing process. Higher DPI values
produce sharper and more detailed printed output but may also increase memory usage and rendering time.
150 - If not specified, the default resolution is 150 DPI.
// Example: Set the print resolution to 300 DPI
var viewer = new DsPdfViewer("#root", {
printResolution: 300
});
optional printSingleJobMode: boolean;
The printSingleJobMode
option controls whether all pages are printed as a single print job,
regardless of their individual orientation. When set to true
, the viewer sends all pages as a single
print task, which may cause pages with different orientations to be printed incorrectly. When set to false
(the default), pages with different orientations are printed separately to preserve their intended layout.
false
// Example: Enable single print job mode to force all pages to be printed together
var viewer = new DsPdfViewer("#root", {
printSingleJobMode: true
});
optional pushButton: Partial<ButtonWidget>;
Default properties for Push button widget.
optional radioButton: Partial<ButtonWidget>;
Default properties for Radio button widget.
optional redactAnnotation: Partial<RedactAnnotation>;
Default properties for Redact annotation.
optional rememberLastValues: boolean;
When the rememberLastValues setting is set to true (or undefined), the last used property values will be used as default values for new annotations.
undefined
// Do not use the last used property values as defaults:
var viewer = new DsPdfViewer("#root", { editorDefaults: { rememberLastValues: false } });
optional resetButton: Partial<ButtonWidget>;
Default properties for Reset button widget.
optional resizeHandleSize: number;
Resize handle size in pixels.
8
var viewer = new DsPdfViewer("#root", {
editorDefaults: {
resizeHandleSize: 20,
moveHandleSize: 40
},
supportApi: { apiUrl: 'support-api/gc-pdf-viewer', webSocketUrl: false }
});
optional richMediaAnnotation: Partial<RichMediaAnnotation>;
Default properties for Rich Media annotation.
optional signatureField: Partial<SignatureAnnotation>;
Default properties for Signature field widget.
optional soundAnnotation: Partial<SoundAnnotation>;
Default properties for Sound annotation.
optional squareAnnotation: Partial<SquareAnnotation>;
Default properties for Square annotation.
optional squigglyAnnotation: Partial<SquigglyAnnotation>;
Default properties for Squiggly annotation.
optional stampAnnotation: Partial<StampAnnotation>;
Default properties for Stamp annotation.
optional standardFontDataUrl: string;
The URL where the standard font files are located. Include the trailing slash.
// Example with relative URL:
var viewer = new DsPdfViewer("#root", { standardFontDataUrl: "resources/standard_fonts/" });
// Example with absolute URL:
var viewer = new DsPdfViewer("#root", { standardFontDataUrl: "http://localhost:8080/resources/standard_fonts/" });
optional stickyNote: object;
Default properties for Sticky note.
optional color: string;
optional contents: string;
optional strikeOutAnnotation: Partial<StrikeOutAnnotation>;
Default properties for StrikeOut annotation.
optional submitButton: Partial<ButtonWidget>;
Default properties for Submit button widget.
optional textAnnotation: Partial<TextAnnotation>;
Default properties for Text annotation.
optional textArea: Partial<TextWidget>;
Default properties for TextArea widget.
optional textField: Partial<TextWidget>;
Default properties for Text field widget.
optional underlineAnnotation: Partial<UnderlineAnnotation>;
Default properties for Underline annotation.
// Change the default sticky note and text annotation color to Red:
var viewer = new DsPdfViewer("#root", {
editorDefaults: {
stickyNote: { color: "#ff0000" },
textAnnotation: {color: "#ff0000" }
},
supportApi: 'api/pdf-viewer'
});
// Change the default square annotation appearance:
var viewer = new DsPdfViewer("#root", {
editorDefaults: {
squareAnnotation: {
annotationType: 5, // AnnotationTypeCode.SQUARE
subtype: "Square",
borderStyle: { width: 5, style: 1, horizontalCornerRadius: 0, verticalCornerRadius: 0 },
color: [0, 0, 0],
interiorColor: [255, 0, 0],
}
},
supportApi: 'api/pdf-viewer'
});
optional enableXfa: boolean;
Render dynamic Xfa forms if any.
The default value is true.
// Turn off XFA forms rendering.
var viewer = new DsPdfViewer(selector, { enableXfa: false });
optional externalLinkTarget: "none" | "top" | "blank" | "self" | "parent";
The externalLinkTarget option sets the value of the target attribute of a link annotation. The externalLinkTarget option specifies where to open the linked document. Possible values are: 'blank', 'self', 'parent', 'top', 'none'.
'none'
var viewer = new DsPdfViewer("#root", { externalLinkTarget: "blank" } );
fieldsAppearance: object;
Form fields appearance rendering settings. Use this option to customize a specific rendering type for the appearance of form fields. Available appearance rendering types:
optional checkBoxButton: FieldAppearanceRenderingType;
Check-box button appearance rendering type.
optional pushButton: FieldAppearanceRenderingType;
Push button appearance rendering type.
optional radioButton: FieldAppearanceRenderingType;
Radio button appearance rendering type.
// Use standard form field appearance using platform-native styling for radio and checkbox buttons.
var viewer = new DsPdfViewer("#root", { fieldsAppearance: { radioButton: "Web", checkBoxButton: "Web" } });
// Use predefined appearance stream from PDF when available:
var viewer = new DsPdfViewer("#root", { fieldsAppearance: { radioButton: "Predefined", checkBoxButton: "Predefined" } });
optional file: any;
Specifies the PDF file name, URL, or binary data to be loaded in the Viewer.
var viewer = new DsPdfViewer("#root", { file: 'GcPdf.pdf' } );
optional formFiller: FormFillerSettings;
Form filler dialog settings.
var formFiller = {
mapping: {
'UserNameField1': {
title: 'User Name',
displayname: 'username',
placeholder: 'Enter here...',
validateoninput: true,
validator: function(fieldValue, field) {
if(fieldValue.length >= 3)
return true;
else
return 'username must be at least 3 characters';
}
},
'fld2': { hidden: true },
'Country Combo Box': {
displayname: 'Country',
required: true
},
'fld3': { displayName: 'First name!',
title: 'Please enter your first name.',
rowCustomCSS: 'given-name-row'
}
}
};
var viewer = new DsPdfViewer('#root', { formFiller: formFiller });
viewer.addDefaultPanels();
var viewer = new DsPdfViewer(selector, {
renderInteractiveForms: true,
formFiller: {
validator: function(val) {return (val ? null : 'The field cannot be empty'); }
}
});
optional friendlyFileName: string;
Used when file name not available.
viewer.options.friendlyFileName = "myFileName.pdf";
viewer.applyOptions();
optional hideAnnotationPopups:
| boolean
| "None"
| "All"
| AnnotationTypeName;
Use this option if you want to hide annotation popups. Possible values are:
undefined
// Example: hide popups for all annotations
var viewer = new DsPdfViewer("#root", { hideAnnotationPopups: true });
// Example: hide popups for specific annotation types (Redact, Circle, and Square)
var viewer = new DsPdfViewer("#root", { hideAnnotationPopups: ["Redact", "Circle", "Square"] });
// Example: show all annotation popups
var viewer = new DsPdfViewer("#root", { hideAnnotationPopups: 'None' });
optional hideAnnotationTypes:
| boolean
| "None"
| "All"
| AnnotationTypeName[];
Specifies annotation types which will be hidden when 'hide-annotations' button is checked. Possible values are: ['Text', 'Link', 'FreeText', 'Line', 'Square', 'Circle', 'Polygon', 'PolyLine', 'Ink', 'Popup', 'FileAttachment', 'Sound', 'ThreadBead', 'RadioButton', 'Checkbox', 'PushButton', 'Choice', 'TextWidget', 'Redact', 'Stamp', 'Highlight', 'Underline', 'Squiggly', 'StrikeOut'] or true or 'All' (true and 'All' have the same behavior).
['Text', 'FreeText', 'Line', 'Square', 'Circle', 'Polygon', 'PolyLine', 'Ink', 'Popup', 'Sound', 'Polygon', 'RadioButton', 'Checkbox', 'PushButton', 'Choice', 'TextWidget', 'Redact', 'Stamp', 'Highlight', 'Underline', 'Squiggly', 'StrikeOut'];
// Hide all possible annotations.
let options = { hideAnnotationTypes: 'All' };
// Hide Push button and Redact annotations only.
let options = { hideAnnotationTypes: ['PushButton', 'Redact'] };
optional hidePopupTimestamp: boolean;
Set this option to hide the timestamp in annotation popups.
false
// Example: hide timestamps in annotation popups
var viewer = new DsPdfViewer("#root", { hidePopupTimestamp: true });
optional ignoreInitialView: boolean;
Set this option to true if you wish to disable initial view settings specified in a PDF document.
false
var viewer = new DsPdfViewer("#root", { ignoreInitialView: true } );
optional jsExecutionConfig: JsExecutionConfig;
Optional JS actions execution configuration.
Execute long operation before JS execution and repaint visible pages after JS execution.
viewer.options.jsExecutionConfig = {
before: function() {
// Returned promise will be awaited before further JS execution.
return new Promise(function(resolve) {
setTimeout(resolve, 1000);
});
},
after: function() {
viewer.repaint();
}
}
Adjust jsCode before execution
viewer.options.jsExecutionConfig = {
before: function(args) {
args.jsCode = args.jsCode.replace("app.alert", "app.showMessage");
},
}
Cancel JS execution
viewer.options.jsExecutionConfig = {
before: function(args) {
args.cancel = true;
},
}
keepFileData: boolean;
Set this option to true if you want to use the fileData property even if the document cannot be parsed as a valid PDF document.
// Below is an example of how to display invalid file data when an error occurs:
var viewer = new DsPdfViewer('#root', { keepFileData: true });
viewer.onError.register(function(eventArgs) {
var message = eventArgs.message;
if (message.indexOf("Invalid PDF structure") !== -1) {
console.log('Unable to load pdf document, pdf document is broken.');
console.log("File data:");
// Output file data to console:
console.log(viewer.fileData);
} else {
console.log('Unexpected error: ' + message);
}
});
viewer.open('sample.pdf');
optional language: string;
User interface language. Note, in order to use the language option, you must specify the language option value during the viewer initialization phase.
// Set UI language to Japanese:
var viewer = new DsPdfViewer(selector, { language: 'ja' });
viewer.addDefaultPanels();
function loadPdfViewer(selector) {
// Define custom translations:
var myTranslations = {
"toolbar": {
"open-document": "Open MY document",
"pan": "My Pan tool",
}
};
// Initialize translations:
DsPdfViewer.i18n.init({
resources: { myLang: { translation: myTranslations } }
}).then(function(t) {
// Translations initialized and ready to go.
// Now create PDF viewer:
var viewer = new DsPdfViewer(selector, { language: 'myLang' });
viewer.addDefaultPanels();
//viewer.open("sample.pdf");
});
}
loadPdfViewer('#root');
lockOpenTimeout: number;
Lock open timeout period in milliseconds. The user will not be able to open another document using the "open" method during the period specified by the lockOpenTimeout option or until the previous document is loaded.
20000
// Change lock open timeout to 5 sec:
var viewer = new DsPdfViewer("#root", { lockOpenTimeout: 5000 );
viewer.open("doc1.pdf");
// The next time the open method is called, the viewer will
// wait a maximum of 5 seconds for the previous document to open.
viewer.open("doc2.pdf");
optional logLevel: LogLevel;
The logging level used for persistent connections using signalr client. Note that the ASP .NET version of the signalr client supports only 'Trace' log level.
Turn on logging.
var viewer = new DsPdfViewer('#root', { logLevel: 'Trace' } );
optional maxCanvasPixels: number;
The maximum supported canvas size in total pixels, i.e. width * height. When the canvas scaling exceeds the maxCanvasPixels option, the CSS scaling will be used instead of re-rendering page to the canvas.
The default value for PC/Mac is 4096 * 4096 = 16777216 (16 mega-pixels).
The default value for iOS/Android is 2560 x 2048 = 5242880 (5 mega-pixels).
optional newDocumentFileName: string;
Specifies the default file name to be used when creating a new document within the viewer.
This option is different from friendlyFileName
as it specifically sets the name for newly created documents,
rather than naming an existing document.
"new-document.pdf"
// Initialize the viewer with a custom file name for new documents
var viewer = new DsPdfViewer("#root", { newDocumentFileName: "sample.pdf" });
optional onBeforeCloseContextMenu: Function;
This function will be called when context menu is about to be hidden. Return false if you want to prevent close context menu action.
undefined
viewer.options.onBeforeCloseContextMenu = function(e) {
console.log("The context menu will be closed soon.");
return true;
};
viewer.options.onBeforeCloseContextMenu = function(e) {
if(!confirm("Do you want to close context menu?")) {
console.log("The context menu will not be closed.");
return false;
}
console.log("The context menu will be closed.");
return true;
};
undefined
optional onBeforeOpenContextMenu: Function;
This function will be called when context menu is about to be shown. You can use this function to customize context menu. Return false if you want to prevent open context menu action.
undefined
// This code shows how to modify the context menu and
// add search using Google and Bing search engines:
viewer.options.onBeforeOpenContextMenu = function (items, mousePosition, viewer) {
var selectedText = viewer.getSelectedText();
if (selectedText) {
// Remove existent items:
items.splice(0, items.length);
// Add own menu items:
items.push({
type: 'button',
text: 'Search using Google',
onClick: function () {
window.open('http://www.google.com/search?q=' + encodeURI(selectedText), '_blank');
}
});
items.push({
type: 'button',
text: 'Search using Bing',
onClick: function () {
window.open('https://www.bing.com/search?q=' + encodeURI(selectedText), '_blank');
}
});
}
return true;
};
optional onInitialized: (viewer) => void;
The onInitialized handler will be called immediately after the viewer is instantiated.
any
void
var viewer = new DsPdfViewer("#root", {
onInitialized: (viewer)=> {
// put viewer initialization code here.
}
});
optional openParameters: OpenParameters;
Parameters object used by the "open" method.
// Include Basic Authentication headers:
var viewer = new DsPdfViewer('#root', {
openParameters: {
headers: {
"Authorization": "Basic " + btoa(unescape(encodeURIComponent("USERNAME:PASSWORD"))),
"CustomHeader": "Custom header value"
}
}
});
optional pageDisplay: PageDisplayType;
Page display type.
// Example: Switch the page display mode to "TwoPage".
var viewer = new DsPdfViewer("#root", {
pageDisplay: "TwoPage"
});
password: string;
A predefined password for protected pdf documents.
viewer.options.password = "abc123";
viewer.open("protected.pdf");
renderer: "canvas" | "svg";
PDF document renderer type - canvas or svg.
var viewer = new DsPdfViewer("#root", { renderer: "svg" } );
renderInteractiveForms: boolean;
Render interactive form elements.
// Do not render interactive form:
var viewer = new DsPdfViewer("#root", { renderInteractiveForms: false } );
optional replyTool: ReplyToolSettings;
The Reply Tool settings.
Default settings are:
// Prevent changing or deleting another user's comments:
var viewer = new DsPdfViewer('#root', { replyTool: { allowChangeOtherUser: false,
allowDeleteOtherUser: false },
userName: 'John', supportApi: 'api/pdf-viewer' });
viewer.addReplyTool('expanded');
// Disallow change author name (allowChangeUserName is false)
// and disallow add changes to comments of other users (allowChangeOtherUser is false):
var viewer = new DsPdfViewer('#root', { replyTool: { allowChangeOtherUser: false,
allowChangeUserName: false },
userName: 'John', supportApi: 'api/pdf-viewer' });
viewer.addReplyTool('expanded');
// Add read-only reply tool:
var viewer = new DsPdfViewer('#root', {
replyTool: { readOnly: true },
userName: 'John',
supportApi: 'api/pdf-viewer' });
viewer.addReplyTool('expanded');
// Hide "Add Sticky Note" item from context menu:
var viewer = new DsPdfViewer('#root', { replyTool: { allowAddNote: false },
userName: 'John', supportApi: 'api/pdf-viewer' });
viewer.addReplyTool();
optional requireTheme:
| "light"
| "dark"
| "viewer"
| "light-blue"
| "themes/dark-yellow"
| "gc-blue";
Use the requireTheme option to apply built-in CSS theme, the option will inject theme styles directly into the page head. Note, only known built-in theme can be specified, otherwise the viewer will fail. Available built-in themes: "viewer", "dark", "dark-yellow", "gc-blue", "light", "light-blue". This option takes precedence over the "theme" option which can be used to specify custom theme.
var viewer = new DsPdfViewer(selector, {
* requireTheme: "light"
});
optional restoreViewStateOnLoad:
| boolean
| {
trackFile: boolean;
trackFullScreen: boolean;
trackMouseMode: boolean;
trackPageRotation: boolean;
trackScale: boolean;
trackSidebar: boolean;
trackSidebarWidth: boolean;
trackTheme: boolean;
trackViewMode: boolean;
};
Track view changes and restore previous state on next page load. Note for trackFile - we are tracking opened file only when you open document using URI, not binary data.
{
trackViewMode: true, trackMouseMode: true, trackScale: true, trackSidebar: true, trackSidebarWidth: true,
trackPageRotation: false, trackFullScreen: false, trackTheme: false, trackFile: false,
};
// disable tracking view changes:
var viewer = new DsPdfViewer("#root", { restoreViewStateOnLoad: false } );
// Track only scale (zoom):
var viewer = new DsPdfViewer("#root", { restoreViewStateOnLoad: { trackScale: true } });
optional saveAsOptions: SaveAsOptions | SaveAsFormat;
"Save As" dropdown button options.
// Limit the save as options available in the dropdown menu to "PDF" and "PNG".
var viewer = new DsPdfViewer("#root", { saveAsOptions: { availableFormats: ["PDF", "PNG"] } });
// Show the "Save As" button dropdown with default available formats.
var viewer = new DsPdfViewer("#root", { saveAsOptions: { showSaveAsButton: true } });
// Hide the "Save As" dropdown button.
var viewer = new DsPdfViewer("#root", { saveAsOptions: { showSaveAsButton: false } });
saveSettings: SaveSettings;
Default viewer's save settings, used when user clicks the Save button.
// Save the document in PDF format with a custom progress message.
var viewer = new DsPdfViewer("#root", { saveSettings: { format: "PDF", progressMessage: "Saving PDF..." } });
// Save only the first three pages of the document in PNG format.
var viewer = new DsPdfViewer("#root", { saveSettings: { format: "PNG", pages: "0-2" } });
// Save the document with a signature and reload it in the viewer.
var viewer = new DsPdfViewer("#root", { saveSettings: { sign: { ...signatureDetails }, reload: true } });
// Save the document with a zoom factor of 2.0 when saving as PNG.
var viewer = new DsPdfViewer("#root", { saveSettings: { format: "PNG", zoomFactor: 2.0 } });
// Save the document in linearized PDF format for fast web viewing.
var viewer = new DsPdfViewer("#root", { saveSettings: { format: "PDF", saveMode: "Linearized" } });
optional secondToolbar: object;
Second toolbar options.
optional render: (toolbarKey) => any[];
Handler method which can be used to render custom second toolbar controls. The method should return array of the JSX.Element controls or null.
string
any
[]
// Create custom second toolbar with key "custom-toolbar-key":
var React = viewer.getType("React");
var toolbarControls =[React.createElement("label", null, "Custom toolbar"),
React.createElement("button", { onClick: () => { alert("Execute action."); }, title: "Action title" }, "Action")];
// Register custom second toolbar for key "custom-toolbar-key":
viewer.options.secondToolbar = {
render: function(toolbarKey) {
if(toolbarKey === "custom-toolbar-key")
return toolbarControls;
return null;
}
};
// Show custom second toolbar:
viewer.showSecondToolbar("custom-toolbar-key");
optional sharing: object;
Document's sharing settings. The sharing is used only when the document is open in collaboration mode using the Share dialog box or from the Shared documents panel.
optional disallowUnknownUsers: boolean;
Prevent sharing the document with users which are not known by the Server Api or not specified in the knownUserNames setting.
false
optional knownUserNames: string[];
Known user names. If specified, these user names will appear as suggestions in the Sharing dialog, otherwise the Sharing dialog will display the user names loaded from the Support Api.
optional presenceColors: object;
If specified, these colors will be used as color for presence indicators. key - user name, value = color.
[userName: string]: string
var viewer = new DsPdfViewer("#root", {
sharing: {
knownUserNames: ['Jame Smith', 'Lisa'],
presenceColors: { 'Anonymous': '#999999', 'Jame Smith': 'red', 'Lisa': 'blue' }
},
supportApi: "api/pdf-viewer"
});
presenceMode: boolean | "on" | "others" | "off";
Determines the type of presence for collaboration users.
'on'
// Change presence mode to 'others':
var viewer = new DsPdfViewer("#root", {
sharing: {
presenceMode: 'others'
},
supportApi: "api/pdf-viewer"
});
// Turn off presence indicators:
var viewer = new DsPdfViewer("#root", {
sharing: {
presenceMode: 'off'
},
supportApi: "api/pdf-viewer"
});
// Disallow user names unknown to the server:
var viewer = new DsPdfViewer("#root", { sharing: { disallowUnknownUsers: true }, supportApi: "api/pdf-viewer" } );
// Specify known user names, and disallow other user names:
var viewer = new DsPdfViewer("#root", {
sharing: {
knownUserNames: ["Jaime Smith", "Jane Smith"],
disallowUnknownUsers: true,
},
supportApi: "api/pdf-viewer"
});
shortcuts: object;
Keyboard shortcut definitions. Available built-in action tools: "zoomin" | "zoomout" | "zoom_pagesize" | "zoom_clientsize" | "select_all" | "rotate" | "pan" | "holdToPan" | "selection" | "open" | "search" | "print" | "move_caret_left" | "move_caret_right" | "move_caret_up" | "move_caret_down" | "move_caret_document_start" | "move_caret_document_end" | "move_caret_sequence_start" | "move_caret_sequence_end" | "confirm-ok" | "confirm-cancel" | "scrollUp" | "scrollDown".
[keyCode: string]:
| KeyboardShortcutDefinition
| KeyboardShortcutDefinition[]
Override keyboard shortcut "Ctrl +"
var viewer = new DsPdfViewer("#root", {
shortcuts: {
107: {
ctrl: true,
tool: function(event) {
DsPdfViewer.findControl("#root").zoomValue += 10;
event.preventDefault();
}
}
}
});
Remove all default shortcuts
var viewer = new DsPdfViewer("#root");
viewer.options.shortcuts = {};
Disable grab when space is pressed
viewer.options.shortcuts["32"] = () => { };
Redefine and disable Ctrl+Z. Ctrl+Y
var viewer = new DsPdfViewer("#viewer", {
shortcuts: {
"Z": {
ctrl: true,
tool: function(e) { }
},
"Y": {
ctrl: true,
tool: function(e) { }
}
}
});
Bind the "P" shortcut to the holdToPan action, leave the Ctrl+P shortcut for the "print" action
viewer.options.shortcuts["P"] = [{ ctrl: true, tool: "print" }, { tool: "holdToPan" }];
Create custom shortcut
viewer.options.shortcuts["E"] = {
ctrl: true,
alt: true,
tool: function(e) { alert("Ctrl+Alt+E pressed."); }
};
optional showContextMenuOnSelection: boolean | "Auto" | "On" | "Off";
Controls the display of the context menu when text is selected.
// Configure the viewer to always show the context menu when text is selected
var viewer = new DsPdfViewer(selector, {
showContextMenuOnSelection: "On"
});
// Configure the viewer to never show the context menu when text is selected
var viewer = new DsPdfViewer(selector, {
showContextMenuOnSelection: "Off"
});
optional signTool: SignToolSettings;
Configuration options for the signature tool. Allows customizing the appearance and behavior of the signing tool.
var viewer = new DsPdfViewer(selector, {
signTool: {
title: 'Sign document', // Custom title for the signature tool
penColor: '#ff0000', // Color of the signature pen
penWidth: 5 // Thickness of the signature stroke
}
});
snapAlignment:
| boolean
| {
center: | boolean
| {
horizontal: boolean;
vertical: boolean;
};
margin: | number
| boolean
| {
horizontal: number | boolean;
vertical: number | boolean;
};
tolerance: | number
| {
horizontal: number | false;
vertical: number | false;
};
};
The Snap Alignment feature customization settings. The tolerance setting is the distance between the edges of two objects within which the object that is being moved or resized snaps to the other object. Margin is the extra space before or after the edge of a field or page. The margin setting is the distance from the target object to which the edge of the object being moved or resized snaps. The center setting allows to snap objects to centers of other objects (in addition to edges).
{ snapAlignment: true }
By default, snap tolerance is 5pt,
snap margin between objects and page edges is 10pt,
snap to center is true.
// Enable vertical snap margin:
var viewer = new DsPdfViewer("#root", { snapAlignment: { margin: { vertical: 10, horizontal: false} }, supportApi: 'api/pdf-viewer'});
// Change tolerance and snap margins:
viewer.options.snapAlignment = { tolerance: 5, margin: 20 };
stamp: object;
Use the stamp option to configure Stamp button settings.
optional dpi: number;
Optional. Default image resolution(DPI) for stamp images without DPI.
optional selectedImageUrl: string;
Optional. Selected image url.
optional stampCategories: boolean | StampCategory[];
Stamp categories.
undefined
// Specify your own set of predefined stamps.
var viewer = new DsPdfViewer("#root", {
stamp: {
stampCategories: [
{ name: 'Nature', stampImageUrls: ['http://localhost:8080/150/160/nature.png', 'http://localhost:8080/250/140/nature.png', 'http://localhost:8080/250/150/nature.png'] },
{ name: 'Nature 2', stampImageUrls: ['http://localhost:8080/170/150/nature.png', 'http://localhost:8080/210/130/nature.png', 'http://localhost:8080/250/120/nature.png'] }
]
}
});
// Disable predefined stamps drop-down.
var viewer = new DsPdfViewer("#root", {
stamp: {
stampCategories: false
}
});
optional supportApi: string | SupportApiSettings;
URL to an external Web API service which will be used to enable PDF editing features.
var viewer = new DsPdfViewer('#root', { supportApi: 'api/pdf-viewer' } );
Turn on debug logging for persistent connections.
var viewer = new DsPdfViewer('#root', { supportApi: 'api/pdf-viewer', logLevel: 'Debug' } );
optional tableDataExtraction: TableDataExtractionSettings;
Configuration settings for table data extraction. Defines options for extraction behavior, UI customization, and export formats.
optional textMarkupContextMenu:
| false
| TextMarkupContextMenuSettings;
Configuration options for the text markup context sub-menu.
// Disable the text markup context sub-menu:
var viewer = new DsPdfViewer(selector, {
textMarkupContextMenu: false
});
// Customize the available colors in the text markup context menu:
var viewer = new DsPdfViewer(selector, {
textMarkupContextMenu: {
colors: [
{ value: "#ff0000", displayName: "Red" },
{ value: "#000000", displayName: "Black" }
]
}
});
// Define different colors for specific text markup types:
var viewer = new DsPdfViewer(selector, {
textMarkupContextMenu: {
colors: {
highlight: [
{ value: "#ff0000", displayName: "Red" },
{ value: "#000000", displayName: "Black" }
],
underline: [
{ value: "#ff0000", displayName: "Red" }
]
}
}
});
// Hide all color options in the text markup context menu:
var viewer = new DsPdfViewer(selector, {
textMarkupContextMenu: { colors: [] }
});
theme: string | false;
Use theme option to change default viewer theme. Set this option to false if you want to disable the loading of the built-in theme - this can be useful when you are already has theme css reference.
// Load dark-yellow theme:
var viewer = new DsPdfViewer("#root", { theme: "dark-yellow.css", themes: ["themes/viewer", "themes/light-blue", "themes/dark-yellow"] } );
// <link href="~/Content/light-blue.css" rel="stylesheet" />
// Don't load built-in theme:
var viewer = new DsPdfViewer("#root", { theme: false } );
themes: string[];
Available viewer themes.
var viewer = new DsPdfViewer("#root", { themes: ["themes/viewer", "themes/light-blue", "themes/dark-yellow"] } );
optional undo: false | UndoStorageOptions;
Undo state storage options.
// Disable undo storage:
var viewer = new DsPdfViewer(selector, {
undo: false
});
// Do not track "Open" and "Close" commands:
var viewer = new DsPdfViewer(selector, {
undo: { skipCommands: "Open" }
});
useCanvasForSelection: any;
Color settings for text selection and for active / inactive search result highlight.
var options = {
useCanvasForSelection: {
selectionColor: "rgba(0, 0, 0, 0.25)",
highlightColor: "rgba(255, 94, 255, 0.35)",
inactiveHighlightColor: "rgba(125, 30, 176, 0.35)"
}
};
var viewer = new DsPdfViewer("#root", options );
viewer.addSearchPanel();
viewer.open("sample.pdf");
useFloatingSearchBar: boolean;
Enable a floating search bar instead of the sidebar search panel.
Default value is true.
var viewer = new DsPdfViewer("#root", { useFloatingSearchBar: false });
useNativeContextMenu: boolean;
By default, the viewer uses its own context menu. Set this option to true if you want to use the browser context menu. Please, note, if you set this option to true, some functions of the context menu will not be available (for example, actions of the Editor and Reply tool).
false
// Enable native browser context menu:
var viewer = new DsPdfViewer("#root", { useNativeContextMenu: true } );
userData: any;
Arbitrary data associated with the viewer. This data is sent to the server when the document is saved.
var viewer = new DsPdfViewer('#root', { supportApi: 'api/pdf-viewer' } );
viewer.options.userData = { secretNumber: 5, innerData: { innerContent: 'content' } };
viewer.applyOptions();
viewer.open('sample.pdf');
optional userName: string;
Author's user name. This option is used by the Annotation Editor and Reply Tool as the default for the Author field.
var viewer = new DsPdfViewer('#root', { userName: 'John', supportApi: 'api/pdf-viewer' });
workerSrc: string;
URL to the Web Worker script. The Web Worker script runs in the background and is used to load and render PDF documents in a parallel background thread. Please, note, that rendering a PDF on the main thread (without a Web Worker script) can slow down the performance of the PDF viewer when loading large PDF files.
var viewer = new DsPdfViewer("#root", { workerSrc: "http://localhost:5000/dspdfviewer.worker.js" } );
zoomByMouseWheel: object;
Zoom by mouse wheel settings.
always: boolean;
ctrlKey: boolean;
metaKey: boolean;
// Enable zoom with the mouse wheel without pressing the Control or Meta keys:
var viewer = new DsPdfViewer("#root", { zoomByMouseWheel: { always: true } } );
optional zoomOptions: object;
Zoom control options.
optional dropdownZoomFactorValues: number[];
Defines zoom factor array to show in Zoom Control Dropdown in Toolbar
[0.5, 1, 1.5, 2, 3]
optional maxZoom: number;
Defines max zoom factor
3 (300%)
optional minZoom: number;
Defines min zoom factor
0.25 (25%)
var viewer = new DsPdfViewer("#root", {
zoomOptions: {
minZoom: 0.5,
maxZoom: 1.5,
dropdownZoomFactorValues: [0.5, 0.7, 1, 1.5]
}
});