JavaScript API for IBM Daeja ViewONE print service

With the following JavaScript API, system integrators can interact with the IBM® Daeja® ViewONE print service to print documents that are accessible to the viewer.

You must reference the JavaScript API script file in the following way:
http://<domain:port>/navigator/jaxrs/v1/viewoneAction?plugin=ViewONEPlugin&action=ViewONEPlatform&helpParameters=security_token,action,plugin&op=com.ibm.ecm&file=viewone-api.js

To use this JavaScript API, you must reference the API in an HTML page.

API Description

PrintJob class
This class represents a print job. A print job is a model and controller that contain data that is related to the document to be printed. A developer can initiate printing a document by using this class. See the following example for creating and using the PrintJob object:
   var printListener = function(url)
   {
      window.open(url); // Open the document in browser window.
   };

  var printJobj = new com.ibm.ecm.PrintJob();
  printJobj.setDocument(window.testDocument)
      .prepare()
            .then(printListener);

PrintJob methods

prepare()

Produces a printable PDF file. The URL to this printable PDF file is returned through the listener. The file URL is used to open the document for printing such as passing it to an iFrame or opened in a browser window.

  • Returns: A promise
  • Type: Promise
setDocument(url)

Identifies the document that is to be printed.

Parameters:
  • Name: url
  • Type: string
  • Description: The URL of the document to print.
  • Returns: This print job
  • Type: PrintJob