The jQuery plugin namespace.
Methods
-
<static> pccViewer(options) → {PCCViewer.Viewer}
-
Creates and embeds a new viewer in the first element of the set of matched elements.
Each call to this method will create and return a unique ViewerControl object. This will call PCCViewer.Viewer#destroy on any existing viewer embedded in the selected element.
If plugin options are provided, then a new viewer is created in the selected element and a PCCViewer.Viewer object is returned. This will call PCCViewer.Viewer#destroy on any viewer that already existed in the selected element.
If plugin options are not provided, then a viewer is not created. Instead, the PCCViewer.Viewer object associated with an existing viewer is returned.
Parameters:
Name Type Argument Description optionsjQuery.fn.pccViewer~Options <optional> Plugin options.
Returns:
- Type
- PCCViewer.Viewer
Example
//Note: these are already included in the PCC Samples var pluginOptions = { documentID: viewingSessionId, // documentID is a required property language: languageItems // language is a required property }; $(document).ready(function () { // Creates a new viewer in the div with id="viewer1" var viewer = $("#viewer1").pccViewer(pluginOptions); // Can also access the returned object through the plugin. var viewerA = $("#viewer1").pccViewer(); // Does not create a new viewer. viewerA === viewer; // true });
Type Definitions
-
pccViewer~DateFormat
-
The format to use when displaying a date. The table below outlines the supported date format tokens and provides example output.
Token Output Month M 1 2 ... 11 12 MM 01 02 ... 11 12 Day D 1 2 ... 30 31 DD 01 02 ... 30 31 Year YY 70 71 ... 29 30 YYYY 1970 1971 ... 2029 2030 Hour H 0 1 ... 22 23 HH 00 01 ... 22 23 h 1 2 ... 11 12 hh 01 02 ... 11 12 Minute m 0 1 ... 58 59 mm 00 01 ... 58 59 AM/PM A AM PM a am pm Type:
- String
-
pccViewer~LanguageOptions
-
This object is the contents of the
language.jsonfile present in all of the HTML5 viewer samples. This file is generally read server-side and passed into the jQuery plugin. It is strongly encouraged to keep a copy of the original file before doing any edits or translations. This object is required by the viewer UI.For more information on this language file or localization, please consult the help section titled "Localizing the Viewer".
Type:
- Object
-
pccViewer~Options
-
The options object used for the HTML5 viewer jQuery Plugin, jQuery.fn.pccViewer. This object is a superset of the main ViewerControl options, PCCViewer.ViewerControl~ViewerControlOptions. All available options for the ViewerControl are also valid here, and will be passed as-is to the ViewerControl during initialization. The following will only include options specific to the jQuery plugin and the Viewer UI functionality inside the
viewer.jsfile.Type:
- Object
-
Properties:
-
Name Type Argument Default Description documentIDstring The ID of the document to load. This option is a part of the PCCViewer.ViewerControl~ViewerControlOptions options object.
imageHandlerUrlstring <optional> "../pcc.ashx" The end point of the web tier services that support the viewer. Unless specified, viewer.js will assume it is running in the default .NET sample. This option is a part of the PCCViewer.ViewerControl~ViewerControlOptions options object.
languagejQuery.fn.pccViewer~LanguageOptions Specifies the language to use for the text in the ViewerControl. Use this option to localize the viewer.
annotationIDstring <optional> Specifies the annotation file to be used within the viewer.
autoLoadAnnotationboolean <optional> false If set to true, the specified annotation file will be loaded when the viewer launches.
immediateActionMenuModestring <optional> "off" Sets the mode of the immediate action menu. The following options are available:
- "on": The menu will appear after creating a mark or selecting text, close to the mouse cursor, allowing the user to take quick actions.
- "hover": In supported browsers, an icon will appear after creating a mark or selecting test. When hovering over this icon, the full menu will appear. On mobile viewports and in IE8, this will be the same as "on".
- "off": The menu will not appear.
templateObject This objects holds the various templates that the viewer UI needs. The templates correspond to HTML files available in all samples -- the filenames use the same name as the template names here, appending "Template.html" to the end -- for example, the template
fileNamewould correspond to afileNameTemplate.htmlfile.Properties
Name Type Description viewerstring This is the main viewer template. It contains partial HTML, and is parsed using Underscore to complete template variables.
contextMenustring This is the template for the floating menu used to edit annotations. It contains partial HTML, and is parsed using Underscore to complete template variables.
overwriteOverlaystring This is the template used for the overlay menu when the Viewer detects that the user is saving markup using a name that already exists. It contains partial HTML, and is parsed using Underscore to complete template variables.
unsavedChangesOverlaystring This is the template used for the overlay menu when the Viewer detects that the user is opening a markup file while having unsaved markup already loaded in the viewer. It contains partial HTML, and is parsed using Underscore to complete template variables.
printOverlaystring This is the template used for the overlay menu displayed when the user selects to print the document. It contains partial HTML, and is parsed using Underscore to complete template variables.
printstring This is the template used to enable the viewer to print. This template contains a full HTML page. Variables are parsed using curly brackets. This template is part of the main ViewerControl options, PCCViewer.ViewerControl~ViewerControlOptions.
downloadOverlaystring This is the template used for the overlay menu displayed when the user selects to download the document. It contains partial HTML, and is parsed using Underscore to complete template variables.
esignOverlaystring This is the template used for the overlay menu displayed when the user selects to manage e-signatures. It contains partial HTML, and is parsed using Underscore to complete template variables.
commentstring This is the template for comments displayed in the ViewerControl comments panel. It contains partial HTML, and is parsed using Underscore to complete template variables.
uiElementsObject <optional> This object contains directives to easily hide or disable default UI elements in the viewer. This option is an alternative to removing the elements entirely from the
viewerTemplate.htmlfile, and are available for convenience. For more specific configuration of elements, theviewerTemplate.htmlfile can be edited directly.Properties
Name Type Argument Default Description annotateTabboolean <optional> true Show or hide the Annotate Tab.
redactTabboolean <optional> true Show or hide the Redact Tab.
searchTabboolean <optional> true Show or hide the Search Tab.
viewTabboolean <optional> true Show or hide the View Tab.
esignTabboolean <optional> true Show or hide the E-Sign Tab.
copyPasteboolean <optional> true Show or hide the Text Select Tool.
downloadboolean <optional> true Show or hide the Download Button.
printingboolean <optional> true Show or hide the Print Button.
advancedSearchboolean <optional> false Enables the advanced search features, including searching through marks and comments.
fullScreenOnInitboolean <optional> false Specifies whether the viewer will fill the browser window when initialized. If this is not defined or set to false the viewer will use the width and height set in viewer.css.
signatureCategoriesstring <optional> Specifies the categories of eSignature to add to the UI. This is a comma separated string containing the types of signatures that the application expects. When no value is passed in, the UI to select categories will be disabled.
Example:
"Full Signature,Initials,Name,Title"commentDateFormatjQuery.fn.pccViewer~DateFormat <optional> "MM/DD/YYYY h:mma" Specifies the date format to use to display comment dates.
signatureDateFormatjQuery.fn.pccViewer~DateFormat <optional> "MM/DD/YYYY" Specifies the date format to use to display date signatures.
predefinedSearchObject <optional> Specifies options so that the viewer can prepopulate the document with search terms. An example of this is defined in the
predefinedSearch.jsonfile available in all HTML5 viewer samples.Properties
Name Type Argument Description highlightColorstring <optional> The default highlight color of the search terms. This is overridden by the term-level parameter. This must be in 6 digit hexadecimal format preceded by a #.
Example:
"#ee3a8c"searchOnInitboolean <optional> Whether to run the search when the viewer is initialized. Only search terms that use
selected: truewill be searched for when this property is enabled.globalOptionsObject <optional> termsArray.<jQuery.fn.pccViewer~Options~predefinedSearch~term> <optional> An array of search terms to populate predefined search. Each Object in the array has the following options for properties:
-
-
pccViewer~Options~predefinedSearch~term
-
The following are options available for the Objects used in the
predefinedSearch.termsArray. Any options not specified on the individual search term Object will use the defined property on thepredefinedSearchObject, or a viewer default if one does not exist.-
Properties:
-
Name Type Argument Default Description searchTermstring The term to use for search. If used along with
userDefinedRegex, this becomes the name of the Regular Expression, while the Regular Expression is used to perform the search.highlightColorstring <optional> The color to use when highlighting results from this particular search.
optionsObject <optional> This is the same
optionsobject, overriding the settings inglobalOptionsfor this specific term.userDefinedRegexstring <optional> A regular expression that will be searched in place of searchTerm. The first and last forward slashes, as well as the flags, are stripped from the string. For example, "/Pa(\w+)/ig" will become "Pa(\w+)".
When special characters (ex: backslash) are used in the "userDefinedRegex" field, they need to be properly escaped. For example, for searching words that begins with "Pa", the regular expression will be "Pa(\w+)", this regular expression should be properly escaped like this "Pa(\w+)".
All patterns use the Global (g) flag.
selectedboolean <optional> false Whether or not this term is selected in the Patterns menu by default. This property must be set to true if you expect to use this search terms along with
searchOnInit: true.
-
-