Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ViewerOptions

GcDocs PDF Viewer options class.

Hierarchy

  • ViewerOptions

Index

Properties

Optional baseUrl

baseUrl: undefined | string = ""

Used by form submission and for theme urls.

example
var viewer = new GcPdfViewer("#root", { baseUrl: "http://localhost/mysite/" });

Optional cMapPacked

cMapPacked: undefined | false | true

Indicates if the viewer should look for a compressed version of the CMap file with the extension '.bin'.

default

true

example
var viewer = new GcPdfViewer("#root", { cMapPacked: false } );

Optional cMapUrl

cMapUrl: undefined | string

The URI to a folder where the external font CMap tables are stored.

default

'resources/bcmaps/'

example
var viewer = new GcPdfViewer("#root", { cMapUrl: "../data/cmaps/" } );

Optional coordinatesOrigin

coordinatesOrigin: "TopLeft" | "BottomLeft" = "TopLeft"

Origin coordinates for the PDF page. The option is used for a properties panel of the Annotation and Form editor.

default

TopLeft

example
// Change the coordinates origin to bottom/left point:
var viewer = new GcPdfViewer("#root", { coordinatesOrigin: "BottomLeft" } );

coordinatesPrecision

coordinatesPrecision: number

Annotation coordinates round precision. Used by the Annotation and Form editor.

default

1

example
// Change the default rounding precision to 0.001:
var viewer = new GcPdfViewer("#root", { coordinatesPrecision: 0.001 } );

Optional disablePageLabels

disablePageLabels: undefined | false | true = false

Set this options to true if you wish to disable page labels.

example
var viewer = new GcPdfViewer("#root", { disablePageLabels: true } );

documentListUrl

documentListUrl: string = "/documents"

URL to document list service used by DocumentListPanel (see addDocumentListPanel method). The service should return JSON string with available documents array, e.g.: ["pdf1.pdf", "pdf2.pdf"]

default

"/documents"

example
// Load document list from external service:
var viewer = new GcPdfViewer("#root", { documentListUrl: "documents.json" } );
example
// Load document list using DATA URI:
var viewer = new GcPdfViewer("#root", { documentListUrl: 'data:,[{"path": "doc1.pdf"}, {"path": "doc2.pdf", "name": "Hello doc 2", "title": "title 2"}]' } );

Optional enableXfa

enableXfa: undefined | false | true = true

Render dynamic Xfa forms if any.

default

The default value is true.

example
// Turn off XFA forms rendering.
var viewer = new GcPdfViewer(selector, { enableXfa: false });

Optional externalLinkTarget

externalLinkTarget: "blank" | "self" | "parent" | "top" | "none"

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'.

default

'none'

example
var viewer = new GcPdfViewer("#root", { externalLinkTarget: "blank" } );

Optional file

file: string | any = ""

Specifies the PDF file name, URL, or binary data to be loaded in the Viewer.

example
var viewer = new GcPdfViewer("#root", { file: 'GcPdf.pdf' } );

Optional formFiller

formFiller: FormFillerSettings

Form filler settings.

example
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 GcPdfViewer('#root', { formFiller: formFiller });
viewer.addDefaultPanels();
example
var viewer = new GcPdfViewer(selector, {
     renderInteractiveForms: true,
     formFiller: {
         validator: function(val) {return (val ? null : 'The field cannot be empty'); }
     }
});

Optional friendlyFileName

friendlyFileName: undefined | string = ""

Used when file name not available.

example
viewer.options.friendlyFileName = "myFileName.pdf";
viewer.applyOptions();

Optional hideAnnotationTypes

hideAnnotationTypes: ("Text" | "Link" | "FreeText" | "Line" | "Square" | "Circle" | "Polygon" | "Stamp" | "Ink" | "Popup" | "FileAttachment" | "Sound" | "Redact" | "Signature" | "ThreadBead" | "RadioButton" | "Checkbox" | "PushButton" | "Choice" | "TextWidget" | "Polyline")[] | "All" | "None" = ['Text', 'FreeText', 'Line', 'Square', 'Circle', 'Polygon', 'Polyline', 'Ink', 'Popup','Sound', 'Polygon', 'RadioButton', 'Checkbox', 'PushButton', 'Choice', 'TextWidget', 'Redact', 'FileAttachment', 'Signature', 'Stamp']

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'] or 'All' or 'None'

default

['Text', 'FreeText', 'Line', 'Square', 'Circle', 'Polygon', 'Polyline', 'Ink', 'Popup', 'Sound', 'Polygon', 'RadioButton', 'Checkbox', 'PushButton', 'Choice', 'TextWidget', 'Redact', 'Stamp'];

example
// Hide all possible annotations.
let options = { hideAnnotationTypes: 'All' };
example
// Hide Push button and Redact annotations only.
let options = { hideAnnotationTypes: ['PushButton', 'Redact'] };

keepFileData

keepFileData: boolean = false

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.

example
// Below is an example of how to display invalid file data when an error occurs:
var viewer = new GcPdfViewer('#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

language: "en" | string

User interface language. Note, in order to use the language option, you must specify the language option value during the viewer initialization phase.

example
// Set UI language to Japanese:
var viewer = new GcPdfViewer(selector, { language: 'ja' });
viewer.addDefaultPanels();
example
function loadPdfViewer(selector) {
  // Define custom translations:
  var myTranslations = {
        "toolbar": {
            "open-document": "Open MY document",
            "pan": "My Pan tool",
        }
   };
   // Initialize translations:
   GcPdfViewer.i18n.init({
     resources: { myLang: { translation: myTranslations } }
   }).then(function(t) {
     // Translations initialized and ready to go.
     // Now create PDF viewer:
     var viewer = new GcPdfViewer(selector, { language: 'myLang' });
     viewer.addDefaultPanels();
     //viewer.open("sample.pdf");
   });
}
loadPdfViewer('#root');

Optional logLevel

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.

Optional maxCanvasPixels

maxCanvasPixels: undefined | 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.

default

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 onBeforeCloseContextMenu

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.

default

undefined

example
viewer.options.onBeforeCloseContextMenu = function(e) {
  console.log("The context menu will be closed soon.");
  return true;
};
default

undefined

example
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;
};

Optional onBeforeOpenContextMenu

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.

default

undefined

example
 // 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

onInitialized: undefined | ((viewer: any) => void)

The onInitialized handler will be called immediately after the viewer is instantiated.

example
var viewer = new GcPdfViewer("#root", {
  onInitialized: (viewer)=> {
     // put viewer initialization code here.
  }
});

password

password: string = ""

A predefined password for protected pdf documents.

example
viewer.options.password = "abc123";
viewer.open("protected.pdf");

renderInteractiveForms

renderInteractiveForms: boolean = true

Render interactive form elements.

example
// Do not render interactive form:
var viewer = new GcPdfViewer("#root", { renderInteractiveForms: false } );

renderer

renderer: "canvas" | "svg" = "canvas"

PDF document renderer type - canvas or svg.

example
var viewer = new GcPdfViewer("#root", { renderer: "svg" } );

Optional replyTool

replyTool: undefined | { allowAddNote?: true | false; allowAddReply?: true | false; allowAddReplyOtherUser?: true | false; allowChangeOtherUser?: true | false; allowChangeUserName?: true | false; allowDelete?: true | false; allowDeleteOtherUser?: true | false; allowStatus?: true | false; allowStatusOtherUser?: true | false; readOnly?: true | false }

The Reply Tool settings.

default

Default settings are:

  • readOnly: false,
  • allowAddNote: true,
  • allowChangeUserName: true,
  • allowAddReply: true,
  • allowDelete: true,
  • allowStatus: true,
  • allowChangeOtherUser: true,
  • allowDeleteOtherUser: true,
  • allowStatusOtherUser: true,
  • allowAddReplyOtherUser: true
    // Prevent changing or deleting another user's comments:
    var viewer = new GcPdfViewer('#root', { replyTool: {  allowChangeOtherUser: false,
                                                        allowDeleteOtherUser: false },
                                          userName: 'John', supportApi: 'api/pdf-viewer' });
    viewer.addReplyTool('expanded');
example
// Disallow change author name (allowChangeUserName is false)
// and disallow add changes to comments of other users (allowChangeOtherUser is false):
var viewer = new GcPdfViewer('#root', { replyTool: { allowChangeOtherUser: false,
                                        allowChangeUserName: false },
                                        userName: 'John', supportApi: 'api/pdf-viewer' });
viewer.addReplyTool('expanded');
example
// Add read-only reply tool:
var viewer = new GcPdfViewer('#root', {
   replyTool: { readOnly: true },
   userName: 'John',
   supportApi: 'api/pdf-viewer' });
viewer.addReplyTool('expanded');
example
// Hide "Add Sticky Note" item from context menu:
var viewer = new GcPdfViewer('#root', { replyTool: {  allowAddNote: false },
                                        userName: 'John', supportApi: 'api/pdf-viewer' });
viewer.addReplyTool();

Optional requireTheme

requireTheme: "light" | "dark" | "viewer" | "light-blue" | "themes/dark-yellow" | "gc-blue" | null

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.

example
var viewer = new GcPdfViewer(selector, {
  requireTheme: "light"
});

Optional secondToolbar

secondToolbar: undefined | { render?: undefined | ((toolbarKey: string) => any[] | null) }

Second toolbar options.

example
// 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

sharing: undefined | { disallowUnknownUsers?: undefined | false | true; knownUserNames?: string[]; presenceColors?: undefined | {}; presenceMode: "on" | "others" | "off" | true | false }

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.

example
// Disallow user names unknown to the server:
var viewer = new GcPdfViewer("#root", { sharing: { disallowUnknownUsers: true }, supportApi: "api/pdf-viewer" } );
example
// Specify known user names, and disallow other user names:
var viewer = new GcPdfViewer("#root", {
     sharing: {
         knownUserNames: ["Jaime Smith", "Jane Smith"],
         disallowUnknownUsers: true,
     },
     supportApi: "api/pdf-viewer"
});

Optional signTool

Signature tool settings.

@example
```javascript
var viewer = new GcPdfViewer(selector, {
     signTool: {
         title: 'Sign document',
         penColor: '#ff0000',
         penWidth: 5
     }
});

snapAlignment

snapAlignment: true | false | { center: false | true | { horizontal: boolean; vertical: boolean }; margin: false | true | number | { 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).

default
{ snapAlignment: true }
By default, snap tolerance is 5pt,
snap margin between objects and page edges is 10pt,
snap to center is true.
example
// Enable vertical snap margin:
var viewer = new GcPdfViewer("#root", { snapAlignment: { margin: { vertical: 10, horizontal: false} }, supportApi: 'api/pdf-viewer'});
example
// Change tolerance and snap margins:
viewer.options.snapAlignment = { tolerance: 5, margin: 20  };

stamp

stamp: { dpi?: undefined | number; stampCategories?: StampCategory[] | boolean }

Use the stamp option to configure Stamp button settings.

default

undefined

example
// Specify your own set of predefined stamps.
var viewer = new GcPdfViewer("#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'] }
    ]
  }
});
example
// Disable predefined stamps drop-down.
var viewer = new GcPdfViewer("#root", {
  stamp: {
    stampCategories: false
  }
});

Type declaration

  • Optional dpi?: undefined | number

    Optional. Default image resolution(DPI) for stamp images without DPI.

  • Optional stampCategories?: StampCategory[] | boolean

    Stamp categories.

Optional supportApi

supportApi: string | { apiUrl: string; docBaseUrl?: undefined | string; reconnectInterval?: undefined | number; token?: undefined | string; webSocketUrl?: string | false }

URL to an external Web API service which will be used to enable PDF editing features.

example
var viewer = new GcPdfViewer('#root', { supportApi: 'api/pdf-viewer' } );
example

Turn on debug logging for persistent connections.

var viewer = new GcPdfViewer('#root', { supportApi: 'api/pdf-viewer', logLevel: 'Debug' } );

theme

theme: string | false = "themes/viewer"

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.

example
// Load dark-yellow theme:
var viewer = new GcPdfViewer("#root", { theme: "dark-yellow.css", themes: ["themes/viewer", "themes/light-blue", "themes/dark-yellow"] } );
example
// <link href="~/Content/light-blue.css" rel="stylesheet" />
// Don't load built-in theme:
var viewer = new GcPdfViewer("#root", { theme: false } );

themes

themes: string[] = ["themes/light", "themes/dark", "themes/viewer", "themes/light-blue", "themes/dark-yellow"]

Available viewer themes.

example
var viewer = new GcPdfViewer("#root", { themes: ["themes/viewer", "themes/light-blue", "themes/dark-yellow"] } );

useNativeContextMenu

useNativeContextMenu: boolean = false

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).

default

false

example
// Enable native browser context menu:
var viewer = new GcPdfViewer("#root", { useNativeContextMenu: true } );

userData

userData: any

Arbitrary data associated with the viewer. This data is sent to the server when the document is saved.

example
var viewer = new GcPdfViewer('#root', { supportApi: 'api/pdf-viewer' } );
viewer.options.userData = { secretNumber: 5, innerData: { innerContent: 'content' } };
viewer.applyOptions();
viewer.open('sample.pdf');

Optional userName

userName: undefined | string = ""

Author's user name. This option is used by the Annotation Editor and Reply Tool as the default for the Author field.

example
var viewer = new GcPdfViewer('#root', { userName: 'John', supportApi: 'api/pdf-viewer' });

workerSrc

workerSrc: string = "gcpdfviewer.worker.js"

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.

example
var viewer = new GcPdfViewer("#root", { workerSrc: "http://localhost:5000/gcpdfviewer.worker.js" } );

Object literals

allowedTools

allowedTools: object

Use this option to enable annotation tools from the form editor or field tools from the annotation editor.

default
{
 annotationEditor: 'annotations',
       formEditor: 'fields'
}
example
viewer.options.allowedTools = { formEditor: 'all' };

annotationEditor

annotationEditor: "annotations" = "annotations"

formEditor

formEditor: "fields" = "fields"

Optional caret

caret: object

Text selection cursor settings.

description
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.
example
// Hide the caret:
var viewer = new GcPdfViewer("#root", { caret: false } );
example
// Change the caret color and width:
var viewer = new GcPdfViewer("#root", { caret: {"color": "#ff0000", "width": 2} } );

allowForPan

allowForPan: false = false

caretBlinkTime

caretBlinkTime: number = 300

caretStopBlinkTime

caretStopBlinkTime: number = 5000

color

color: string = "#000000"

width

width: number = 1

editorDefaults

editorDefaults: object

Contains default values for a new annotations and fields.

example
// Change the default sticky note and text annotation color to Red:
var viewer = new GcPdfViewer("#root", {
     editorDefaults: {
       stickyNote: { color: "#ff0000" },
       textAnnotation: {color: "#ff0000" }
     },
     supportApi: 'api/pdf-viewer'
});
example
// Change the default square annotation appearance:
var viewer = new GcPdfViewer("#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'
});

checkBoxButton

checkBoxButton: object

rect

rect: number[] = [0, 0, 18, 18]

combTextField

combTextField: object

rect

rect: number[] = [0, 0, 140, 24]

comboChoice

comboChoice: object

rect

rect: number[] = [0, 0, 140, 24]

listBoxChoice

listBoxChoice: object

rect

rect: number[] = [0, 0, 140, 44]

passwordField

passwordField: object

rect

rect: number[] = [0, 0, 140, 24]

pushButton

pushButton: object

rect

rect: number[] = [0, 0, 140, 24]

radioButton

radioButton: object

rect

rect: number[] = [0, 0, 18, 18]

resetButton

resetButton: object

rect

rect: number[] = [0, 0, 140, 24]

stickyNote

stickyNote: object

color

color: string = "#38e5ff"

contents

contents: string = ""

submitButton

submitButton: object

rect

rect: number[] = [0, 0, 140, 24]

textAnnotation

textAnnotation: object

color

color: string = "#ffdc38"

contents

contents: string = ""

textArea

textArea: object

rect

rect: number[] = [0, 0, 140, 44]

textField

textField: object

rect

rect: number[] = [0, 0, 140, 24]

fieldsAppearance

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:

  • "Custom" - Default. The custom appearance has some improvements over the web appearance,
         for example you can specify background / border colors.
  • "Web" - Standard form field appearance using platform-native styling. See https://developer.mozilla.org/en-US/docs/Web/CSS/appearance for details.
  • "Predefined" - Predefined appearance stream from PDF when available, if appearance stream is not available, custom appearance will be used.
example
// Use standard form field appearance using platform-native styling for radio and checkbox buttons.
var viewer = new GcPdfViewer("#root", { fieldsAppearance: { radioButton: "Web", checkBoxButton: "Web" } });
example
// Use predefined appearance stream from PDF when available:
var viewer = new GcPdfViewer("#root", { fieldsAppearance: { radioButton: "Predefined", checkBoxButton: "Predefined" } });

checkBoxButton

checkBoxButton: "Custom" = "Custom"

radioButton

radioButton: "Custom" = "Custom"

Optional restoreViewStateOnLoad

restoreViewStateOnLoad: object

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.

default
{
    trackViewMode: true, trackMouseMode: true, trackScale: true, trackSidebar: true, trackSidebarWidth: true,
    trackPageRotation: false, trackFullScreen: false, trackTheme: false, trackFile: false,
};
example
// disable tracking view changes:
var viewer = new GcPdfViewer("#root", { restoreViewStateOnLoad: false } );
example
// Track only scale (zoom):
var viewer = new GcPdfViewer("#root", { restoreViewStateOnLoad: { trackScale: true } });

trackFile

trackFile: false = false

trackFullScreen

trackFullScreen: false = false

trackMouseMode

trackMouseMode: true = true

trackPageRotation

trackPageRotation: false = false

trackScale

trackScale: true = true

trackSidebar

trackSidebar: true = true

trackSidebarWidth

trackSidebarWidth: true = true

trackTheme

trackTheme: false = false

trackViewMode

trackViewMode: true = true

shortcuts

shortcuts: object

Keyboard shortcuts

13

13: { ctrl: boolean; keyCode: number; tool: string }[] = [{ keyCode: 13, tool: "confirm-ok", ctrl: true, }]

27

27: { keyCode: number; tool: string }[] = [{ keyCode: 27, tool: "confirm-cancel" }]

33

33: { tool: string }[] = [{tool: "scrollUp"}]

34

34: { tool: string }[] = [{tool: "scrollDown"}]

35

35: ({ ctrl: boolean; keyCode: number; shift: boolean; tool: string } | { ctrl: boolean; keyCode: number; tool: string } | { keyCode: number; shift: boolean; tool: string } | { keyCode: number; tool: string })[] = [{keyCode: 35,tool: "move_caret_document_end",shift: true,ctrl: true,}, {keyCode: 35,tool: "move_caret_document_end",ctrl: true,}, {keyCode: 35,tool: "move_caret_sequence_end",shift: true,}, {keyCode: 35,tool: "move_caret_sequence_end"}]

36

36: ({ ctrl: boolean; keyCode: number; shift: boolean; tool: string } | { ctrl: boolean; keyCode: number; tool: string } | { keyCode: number; shift: boolean; tool: string } | { keyCode: number; tool: string })[] = [{keyCode: 36,tool: "move_caret_document_start",shift: true,ctrl: true,}, {keyCode: 36,tool: "move_caret_document_start",ctrl: true,}, {keyCode: 36,tool: "move_caret_sequence_start",shift: true,}, {keyCode: 36,tool: "move_caret_sequence_start"}]

37

37: ({ keyCode: number; shift: boolean; tool: string } | { alt: boolean; keyCode: number; tool: string } | { keyCode: number; tool: string })[] = [{keyCode: 37,tool: "move_caret_left",shift: true,}, {keyCode: 37,tool: "history_back",alt: true,},{keyCode: 37,tool: "move_caret_left"}]

38

38: ({ keyCode: number; shift: boolean; tool: string } | { keyCode: number; tool: string })[] = [{keyCode: 38,tool: "move_caret_up",shift: true,},{keyCode: 38,tool: "move_caret_up"}]

39

39: ({ keyCode: number; shift: boolean; tool: string } | { alt: boolean; keyCode: number; tool: string } | { keyCode: number; tool: string })[] = [{keyCode: 39,shift: true,tool: "move_caret_right"},{keyCode: 39,alt: true,tool: "history_forward"}, {keyCode: 39,tool: "move_caret_right"}]

40

40: ({ keyCode: number; shift: boolean; tool: string } | { keyCode: number; tool: string })[] = [{keyCode: 40,tool: "move_caret_down",shift: true,},{keyCode: 40,tool: "move_caret_down"}]

R

R: ({ tool: string } | { shift: boolean; tool: string })[] = [{ tool: "rotate" }, { shift: true, tool: "rotate" }]

0

0: object

ctrl

ctrl: boolean = true

tool

tool: string = "zoom_pagesize"

107

107: object

ctrl

ctrl: boolean = true

tool

tool: string = "zoomin"

109

109: object

ctrl

ctrl: boolean = true

tool

tool: string = "zoomout"

187

187: object

ctrl

ctrl: boolean = true

tool

tool: string = "zoomin"

189

189: object

ctrl

ctrl: boolean = true

tool

tool: string = "zoomout"

9

9: object

ctrl

ctrl: boolean = true

tool

tool: string = "zoom_clientsize"

A

A: object

ctrl

ctrl: boolean = true

tool

tool: string = "select_all"

F

F: object

ctrl

ctrl: boolean = true

tool

tool: string = "search"

H

H: object

tool

tool: string = "pan"

O

O: object

ctrl

ctrl: boolean = true

tool

tool: string = "open"

P

P: object

ctrl

ctrl: boolean = true

tool

tool: string = "print"

S

S: object

tool

tool: string = "selection"

useCanvasForSelection

useCanvasForSelection: object

Color settings for text selection and for active / inactive search result highlight.

  • selectionColor: Changes the default color used to highlight the currently selected search result from the search results list, in the document.
  • inactiveHighlightColor: Changes the default color used to highlight all the search results in the document.
  • selectionColor: Changes the default color used to mark the selected text in the document.
example
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 GcPdfViewer("#root", options );
viewer.addSearchPanel();
viewer.open("sample.pdf");

highlightColor

highlightColor: string = "rgba(255, 94, 0, 0.35)"

Changes the default color used to highlight the currently selected search result from the search results list, in the document.

inactiveHighlightColor

inactiveHighlightColor: string = "rgba(180, 0, 170, 0.35)"

Changes the default color used to highlight all the search results in the document.

selectionColor

selectionColor: string = "rgba(0, 86, 195, 0.25)"

Changes the default color used to mark the selected text in the document.

zoomByMouseWheel

zoomByMouseWheel: object

Zoom by mouse wheel settings.

example
// Enable zoom with the mouse wheel without pressing the Control or Meta keys:
var viewer = new GcPdfViewer("#root", { zoomByMouseWheel: { always: true } } );

always

always: false = false

ctrlKey

ctrlKey: true = true

metaKey

metaKey: true = true