Prizm Content Connect
Namespace: fn

Namespace: fn

jQuery. fn

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
options jQuery.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.json file 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.js file.

Type:
  • Object
Properties:
Name Type Argument Default Description
documentID string

The ID of the document to load. This option is a part of the PCCViewer.ViewerControl~ViewerControlOptions options object.

imageHandlerUrl string <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.

language jQuery.fn.pccViewer~LanguageOptions

Specifies the language to use for the text in the ViewerControl. Use this option to localize the viewer.

annotationID string <optional>

Specifies the annotation file to be used within the viewer.

autoLoadAnnotation boolean <optional>
false

If set to true, the specified annotation file will be loaded when the viewer launches.

immediateActionMenuMode string <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.
template Object

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 fileName would correcpond to a fileNameTemplate.html file.

Properties
Name Type Description
viewer string

This is the main viewer template. It contains partial HTML, and is parsed using Underscore to complete template variables.

contextMenu string

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.

overwriteOverlay string

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.

unsavedChangesOverlay string

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.

printOverlay string

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.

print string

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.

downloadOverlay string

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.

esignOverlay string

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.

comment string

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.

uiElements Object <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.html file, and are available for convenience. For more specific configuration of elements, the viewerTemplate.html file can be edited directly.

Properties
Name Type Argument Default Description
annotateTab boolean <optional>
true

Show or hide the Annotate Tab.

redactTab boolean <optional>
true

Show or hide the Redact Tab.

searchTab boolean <optional>
true

Show or hide the Search Tab.

viewTab boolean <optional>
true

Show or hide the View Tab.

esignTab boolean <optional>
true

Show or hide the E-Sign Tab.

copyPaste boolean <optional>
true

Show or hide the Text Select Tool.

download boolean <optional>
true

Show or hide the Download Button.

printing boolean <optional>
true

Show or hide the Print Button.

fullScreenOnInit boolean <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.

signatureCategories string <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"

commentDateFormat jQuery.fn.pccViewer~DateFormat

Specifies the date format to use to display comment dates.

signatureDateFormat jQuery.fn.pccViewer~DateFormat

Specifies the date format to use to display date signatures.

predefinedSearch Object <optional>

Specifies options so that the viewer can prepopulate the document with search terms. An example of this is defined in the predefinedSearch.json file available in all HTML5 viewer samples.

Properties
Name Type Argument Description
highlightColor string <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"

searchOnInit boolean <optional>

Whether to run the search when the viewer is initialized. Only search terms that use selected: true will be searched for when this property is enabled.

globalOptions Object <optional>
terms Array.<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 availble for the Objects used in the predefinedSearch.terms Array. Any options not specified on the individual search term Object will use the defined property on the predefinedSearch Object, or a viewer default if one does not exist.

Properties:
Name Type Argument Default Description
searchTerm string

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.

highlightColor string <optional>

The color to use when highlighting results from this particular search.

options Object <optional>

This is the same options object, overriding the settings in globalOptions for this specific term.

userDefinedRegex string <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.

selected boolean <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.


 

 


©2014. Accusoft Corporation. All Rights Reserved.

Send Feedback