PrizmDoc® v14.1 Release - Updated
PrizmDoc / API Reference / Viewer Control / Namespace: PCCViewer / Class: PrintRequest
In This Topic
    Class: PrintRequest
    In This Topic

    PCCViewer. PrintRequest

    (protected) new PrintRequest()

    The PrintRequest object is created when printing the document. This constructor should not be used directly. Instead, a print request is created by PCCViewer.ViewerControl#print, and it is also made available through the PCCViewer.EventType.PrintRequested event.

    Example

    // A PrintRequest object is created by and returned from the call to the print method
    var printRequest = viewerControl.print();
    
    

    Members

    (static, readonly) EventType :string

    A list of events that can be triggered by the PCCViewer.PrintRequest object.

    Type:

    • string

    Properties:

    Name Description
    PrintPagePrepared : string

    Event fired when a page has been prepared. This event is used to indicate print progress.

    Augmented properties of the PCCViewer.Event object for this event:

    • index {number} Indicates the index of the page that was prepared in respect to totalPages.
    • pageNumber {number} Indicates the page number of the page that was prepared. This page number of the page in the document.
    • totalPages {number} Indicates the total number of pages that are being printed.
    PrintCompleted : string

    Event fired when print has completed, either due to a success, failure, or a cancel. This event does not indicate whether a user successfully printed the document, as they can still cancel the browser dialog, but rather that all pages were prepared successfully in the print request.

    Augmented properties of the PCCViewer.Event object for this event:

    • none
    PrintCancelled : string

    Event triggered if printing is cancelled during the preparation process.

    Augmented properties of the PCCViewer.Event object for this event:

    • none
    PrintFailed : string

    Event triggered if the printing process failed due to an error.

    Augmented properties of the PCCViewer.Event object for this event:

    • none
    See:

    (readonly) options :object

    Gets a copy of the validated options object which is used by the print request.

    The original options object may have been provided to the method PCCViewer.ViewerControl#print. If no options object was provided to print, or the options object did not define all properties, then the returned object will represent the actual options used.

    This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5.

    Type:

    • object
    See:

    (readonly) pageCount :number

    This property gets the number of pages which were requested in the print request.

    This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5.

    Type:

    • number
    See:

    (readonly) preparedCount :number

    This property gets the number of pages which have currently been prepared.

    This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5.

    Type:

    • number
    See:

    Methods

    cancel()

    Cancels the print request. This immediately stops the print progress, and no pages will be printed.

    getOptions() → {object}

    Gets a copy of the validated options object which is used by the print request.

    The original options object may have been provided to the method PCCViewer.ViewerControl#print. If no options object was provided to print, or the options object did not define all properties, then the returned object will represent the actual options used.

    Returns:

    A copy of the print options object which is used by this print request.

    • range {string} A comma-separated string with all page numbers for the requested pages.
    • orientation {string} The requested print orientation.
    • paperSize {string} The requested size of the paper to print on.
    • margins {string} Indicated whether default or none margins were used. See PCCViewer.ViewerControl#print.
    • includeMarks {boolean} Whether to print the document marks.
    • includeAnnotation {boolean} Whether to print the document annotations.
    • includeRedactions {boolean} Whether to print the document redactions.
    • includeComments {string} Location to print comments.
    • includeReasons {string} Location to print redaction reasons.
    • redactionViewMode {string} Whether to print document content text underneath solid rectangle redactions and selection text redactions marks.
    Type
    object

    getPageCount() → {number}

    Gets the number of pages which were requested in the print request.

    Returns:

    The number of pages which were requested to print.

    Type
    number

    getPreparedCount() → {number}

    Gets the number of pages which have currently been prepared.

    Returns:

    The number of pages which have been prepared.

    Type
    number

    off() → {PCCViewer.PrintRequest}

    Remove event listeners from the PrintRequest object.

    See:

    Returns:

    The object on which this method was called.

    Type
    PCCViewer.PrintRequest

    on() → {PCCViewer.PrintRequest}

    Add event listeners to the PrintRequest object.

    Example

    var printRequest = viewerControl.print();
    printRequest
      .on(PCCViewer.PrintRequest.EventType.PrintCompleted,
          function(ev) {
              alert("Print completed.");
          })
      .on(PCCViewer.PrintRequest.EventType.PrintPagePrepared,
          function(ev) {
              alert("Print progress: " + 100 * (ev.index + 1) / ev.totalPages + "%");
          });
    
    
    See:

    Returns:

    The object on which this method was called.

    Type
    PCCViewer.PrintRequest

    Documentation generated by JSDoc 3.6.10 on Mon Apr 22 2024 21:07:00 GMT+0000 (Coordinated Universal Time)