SmartJPrint - out of box online PDF document viewer parameters information.


Here is the list of parameters and details about where and how to use them. These parameters are used for CloudViewer as well as applications enabling dynamic customization.

DOCUMENT

Usage: Viewers only feature (all viewers use DOCUMENT argument to read one document at a time)

Used for viewing a document in a document viewer UI. A string pointing to an existing PDF or an URL that can dynamically generate a PDF document for viewing.

Examples
  • Static URL
    [http://www.activetree.com/jprint/demo/sample_pdf/sample1.pdf]
  • Local file URL (Windows)
    [file:/c:/demo/sample_pdf/sample1.pdf]
  • Dynamic URL
    [http://www.activetree.com/silent_print_report_from_browser/PdfJSPDemo2.jsp]
  • If the PDF is generated dynamically from a server program may require parameters. This is how one can add the parameters and values using the standard URL syntax.

    [http://www.myhost.com/silent_print_report_from_browser/dynamic_pdf.jsp?param1=value1&param2=value2...&paramN=valueN]

    DOC_LIST

    Usage: All (web as well as standalone applications except viewers)

  • This is either a String or java.util.List containing byte[] elements.
  • Typically used for printing and converting documents.
  • Format: [doc1-][doc-2][doc-3]...[doc-N]
  • DOC_LIST examples for PDF files

  • Two existing PDFs
    [file:/c:/test/pdfs/sample1.pdf][http://www.activetree.com/jprint/demo/sample_pdf/sample4.pdf]
  • Dynamically generated PDFs
    [http://www.activetree.com/demo/sjreport/PdfJSPDemo2.jsp][http://www.activetree.com/demo/sjreport/ReportGenerationDemo1.jsp]
  • Mix of dynamic and existing PDFs
    [file:/c:/test/pdfs/sample1.pdf][http://www.activetree.com/demo/sjreport/PdfJSPDemo1.jsp]
  • DOC_LIST examples for PDF byte[] content

    For byte[] contents this argument has to be an object of java.util.List containing byte[] elements. For complete code sample, look for examples in the downloaded server archive.

    PASSWORD

    Usage: All (web as well as standalone applications)

    Applicable only for those password protected documents. You may or may not pass a value for this parameter. If the document is NOT a password protected a value passed for it will be ignored.

    NOTE: While processing multiple documents using DOC_LIST only one password may be set. Password for each document if different, you may set one document to the DOC_LIST and therefore process one document at a time.

    URL_AUTH_ID

    Usage: All (web as well as standalone applications)

    The document URL (or the URL dynamically producing the document) might be password protected in the web server. Web server therefore requires a access USER NAME and PASSWORD (Note: this is different from document PASSWORD).

    Following parameters are used for accessing the password protected URL:
    URL_AUTH_ID - user name (or ID) for the protected URL along with the URL_AUTH_PASSWORD parameter.

    URL_AUTH_PASSWORD

    Usage: All (web as well as standalone applications)

    URL_AUTH_PASSWORD - user password for the protected URL, used when a URL_AUTH_ID is required for accessing an URL.

    JOB_NAME

    Usage: All (web as well as standalone applications)

    Job name is controlled using JOB_NAME name parameter value of which is a string.

    PAGE_SCALING

    Usage: All (web as well as standalone applications)

    This is controlled by PAGE_SCALING parameter. PDF page area may be different than the media printable area. Therefore it is important to set this flag in order to get the desired output. Following are the accepted values:
    - NONE if applied page content is not scaled to fit to the media size and orientation.
    - FIT_TO_PRINTABLE_AREA is used for page content to always get scaled to fit to the media printable area. If the printable area is smaller than the page content it will shrink the page content to fit to the printable area. On the other hand if the media printable area is larger than the page content it will expand the content to fit to the printable area.
    - SHRINK_TO_PRINTABLE_AREA is same as FIT_TO_PRINTABLE_AREA except that if the media printable area is larger than the page content it will not expand the page content to fit to the printable area. It can be used only for larger content to the output media by shrinking it.

    Default value is set to FIT_TO_PRINTABLE_AREA.

    AUTO_ROTATE_AND_CENTER

    Usage: All (web as well as standalone applications)

    This is a boolean "true" or "false" flag used to indicate whether or not to automatically rotate and center the document page content to the media printable area. A media printable area may not be of exact match with the document page size. Even if the size of the media is same the orientation may be different. This flag therefore ensures you to automatically re-orient and center the content to the media printable area if this flag is set to "true". This flag works with the PAGE_SCALING parameter. Value "false" for this flag only effective if the value of PAGE_SCALING parameter is NONE. All other value of page scaling will have no effect on this flag and a value "true" will be used (even if you have set it to "false").

    Default value is set to true.

    PAPER

    Usage: All (web as well as standalone applications)

    This parameter is used for setting a media size of format "(widthInPixel, heightInPixel)" for no margins are required for output. For an NA_LETTER paper it will be PAPER=(612,792) where paper width is 612 pixels and height is 792 pixels.

    If margins are required around the pages it will be of this format "(top, left, bottom, right, width, height)" and all are in pixels. An example media size "(72, 72, 72, 72, 612, 792)" - where top, left, bottom and right margins each is of 72 pixels and last two values is the total width and height of the media.

    AUTO_MATCH_PAPER

    Usage: All (web as well as standalone applications)

    AUTO_MATCH_PAPER can be set to "true" or "false". If set to true it will take each PDF page size and find a matched paper size looking into ISO paper size list. If found it will use that paper size, otherwise, it will use the paper size you specify with the PAPER flag. If PDF page size is not matched for auto-paper size match and you have not specified a PAPER size it will use a default paper size. We suggest you provide a default paper size using the PAPER parameter.

    PRINTER_NAME

    Usage: All (web as well as standalone applications)

    PRINTER_NAME and PRINTER_NAME_SUBSTRING_MATCH parameters are used in combination to print to a particular printer identified by a name. PRINTER_NAME value is either full name of the printer or a substring of it. On the other hand PRINTER_NAME_SUBSTRING_MATCH tells whether or not API should look for a printer that is of exact match (value if false) with the string in PRINTER_NAME or API should try to find a printer taking the PRINTER_NAME value and do a substring match (value if true) with all the available printers. If it do not find a matched printer using these two parameters it will print to default printer.

    PRINTER_NAME_SUBSTRING_MATCH

    Usage: All (web as well as standalone applications)

    Whether or not to do a substring match for finding a printer during printer search based on printer name.

    In this example PRINTER_NAME=HP LaserJet 4200 PCL&PRINTER_NAME_SUBSTRING_MATCH=false used to indicate that an exact match should be performed for finding a printer named "HP LaserJet 4200 PCL". When PRINTER_NAME_SUBSTRING_MATCH=true the first printer found using a substring match will be used even there are other printer name might match this substring.

    PRINT_QUALITY

    Usage: All (web as well as standalone applications)

    This parameter is used for setting the printout quality. Possible values are High, Normal and Draft. For laser printers this parameter may not make any difference in output quality. It is important for other kinds of printer such as a thermal printer.

    SIDE_TO_PRINT

    Usage: All (web as well as standalone applications)

    This parameter is used for this purpose. Possible values are ONE_SIDED, DUPLEX, TUMBLE, TWO_SIDED_LONG_EDGE, or TWO_SIDED_SHORT_EDGE. Actual outcome for this parameter will depend on whether or not the printer supports it. In this example a value of DUPLEX is used with the expectation that the output be printed on both sides of the pages. Duplex mode saves paper and is recommended if your printer support it.

    IS_USE_PRINTER_MARGINS

    Usage: All (web as well as standalone applications)

    This parameter is used for validating the paper size with the printer. A printer might be configured to keep certain amount of margins around the page. PDF content if printed ignoring this margins it might produce the content near the boundary of the paper is cut off. Set this flag to true if you want to use the printer margins, otherwise, set this flag to false. Default value is true.

    COPIES

    Usage: All (web as well as standalone applications)

    COPIES parameter takes an integer number as the number of copies to be printed. Default value is 1 copy. This example is using COPIES=2 for printing 2 copies.

    COLLATE_COPIES

    Usage: All (web as well as standalone applications)

    This parameter takes boolean true if you want the copies to be collated false otherwise. This is used when printing multiple copies. Default value for this parameter is true.

    PRINT_REQUEST_ATTRIBUTE_SET

    Usage: Standalone applications

    Applicable for applications to use their own print request attribute set directly using Java Print Service (JPS) APIs. See examples in the downloaded atchive for server edition.

    Code sample

        //Printing attribute set - subjected to support from JRE
        HashPrintRequestAttributeSet pSet = new HashPrintRequestAttributeSet();
        //TODO -- set your printing attributes based on JPS APIs.
        //Example: tray selection which often works if underlying JRE supports it.
        //pSet.add(javax.print.attribute.standard.MediaTray.ENVELOPE);
        //...
        silentPrint.setAttribute(SilentPrint.PRINT_REQUEST_ATTRIBUTE_SET, pSet);
        

    SINGLE_PRINT_JOB

    Usage: Web only parameter - for silently processing multiple documents online

    Use boolean true if you want all the DOC_LIST documents be printed as one print job, false otherwise. This is used when printing multiple PDF documents. One print job will cause the API to put together pages from all of the PDF documents and print them together as one document. If this flag it set to false it will print each PDF document as one print job post fixed with a number.

    SHOW_PRINT_DIALOG

    Usage: Web only

    This can be set to true if you want to select all of these printing parameters from a dialog window, false otherwise. This flag makes the printing non-silent since it will wait for user input before printing. Moreover it will ignore all the parameter values and will use what user select from this dialog. Only parameter API will use from the URL parameters is the PASSWORD value.

    SHOW_PRINT_ERROR_DIALOG

    Usage: Web only

    NOTE: This parameter typically used for browser based applications.

    This parameter if true shows a dialog displaying any kind of printing error if any, false otherwise. Error dialog is shown only if there are printing errors. Default value is true. This example set this flag to false so no dialogs are shown. (See DEBUG parameter later in this tutorial to trace the printing debug messages).

    STATUS_UPDATE_ENABLED

    Usage: Web only - updates process status on the browser page itself.

    NOTE: This parameter typically used for browser based applications.

    It is used for silent printing from browser based applications and may be ignored when used for standalone applications.

    This parameter if true it shows messages in the browser window while job is being processed. Messages such as PDFs to print, total number of pages, printer it is printing to etc. are displayed when printing is in progress. Default value is true. When you run without this parameter it will display messages in the browser window. Set this to false if do not want to see any messages in the browser window.

    DEBUG

    Usage: All (web as well as standalone applications) - debugs process output

    This parameter if true it shows API debug messages in the browser Java Console or in application console while printing is in progress. This is helpful for the end user as well as developers when trying to print and report a problem if any. This example is using a value false for not recording any debug messages. Default value is set to true.

    SERVER_CALL_BACK_URL

    Usage: Web only - to call a custom server program for dynamically exchanding security and other information

    NOTE: This parameter typically used for browser based applications.

    SERVER_CALL_BACK_URL - A HREF value (i.e. URL) may be provided for this parameter that will be called at run time. All parameters is going to be made available to the server URL for knowing the document and allow access to it by way of providing all security and other information it might need for its opening. Callback program may simply deny access to this program by not providing the access information or simply setting an empty DOCUMENT or DOC_LIST content to the attribute map it replies back for client.

    Examples:
    SERVER_CALL_BACK_URL=http://www.activetree.com/jprint/demo/server.jsp

    ON_SUCCESS_SHOW_PAGE

    Usage: Web only

    NOTE: This parameter typically used for browser based applications.

    An web URL may be set using this parameter for showing a page after completion of the job.

    Examples:
    ON_SUCCESS_SHOW_PAGE=http://www.activetree.com/jprint/demo/success.jsp

    ON_SUCCESS_PAGE_TARGET

    Usage: Web only

    NOTE: This parameter typically used for browser based applications.

    Possible values are "_blank", "self" and a named window; e.g. "myWindow"

    Examples (show success page in new window; "_blank"):
    ON_SUCCESS_SHOW_PAGE=http://www.activetree.com/jprint/demo/success.jsp&ON_SUCCESS_PAGE_TARGET=_blank

    ON_FAILURE_SHOW_PAGE

    Usage: Web only

    NOTE: This parameter typically used for browser based applications.

    Similar to the ON_SUCCESS_SHOW_PAGE parameter except that this parameter is used for showing a page if job failed.

    Examples:
    ON_FAILURE_SHOW_PAGE=http://www.activetree.com/jprint/demo/failure.jsp

    ON_SUCCESS_PAGE_TARGET

    Usage: Web only

    NOTE: This parameter typically used for browser based applications.

    This target value used with ON_FAILURE_SHOW_PAGE discussed above.

    Examples (show failure page in new window; "_blank"):
    ON_FAILURE_SHOW_PAGE=http://www.activetree.com/jprint/demo/failure.jsp&ON_FAILURE_PAGE_TARGET=_blank

    IS_SHOW_PRINT_PREVIEW

    Usage: Web only

    NOTE: This parameter typically used for browser based applications.

    When silent printing from browser it may be necessary to preview the document pages before submitting the job for printing or conversion. This parameter is set to true for showing the pages in the viewer.

    This parameter is used along with VIEWER_PAGE and VIEWER_CONTROLS parameters.

    VIEWER_PAGE

    Usage: Web only

    NOTE: This parameter typically used for browser based applications.

    If IS_SHOW_PRINT_PREVIEW is set to true VIEWER_PAGE is used for identifying the document viewer URL so that the document may be opened in the viewer.

    ZOOM_COMBO_VALUES

    Usage: All (web as well as standalone applications)

    Used to override the existing default zoom combo values to a new set of values.

    To override the existing zooms specify a new list of zoom values in an array format. It is a two dimensional array with first row containing names and second row is the zoom values. Since the value of the frist row is displayed as texts it could be any thing seperated by comma (. However, second row values must be numeric indicating the percentage. Example:
    http://...&ZOOM_COMBO_VALUES={{0.50x, 0.75x, 1.00x, 1.50x, 2.00x}{50, 75, 100, 150, 200}}&...
    http://...&ZOOM_COMBO_VALUES={{50 percent, 75 percent, 100 percent, 150 percent, 200 percent}, {50, 75, 100, 150, 200}}&...

    VIEWER_CONTROLS

    Usage: All (web as well as standalone applications)

    This parameter typically used for scripting document viewers. In other words one can dynamically generate and display a custom document viewer in browser (or as an application) using one or more of the viewer controls. Each viewer control is identified by a name. Therefore, the value in the VIEWER_CONTROLS parameter is one or more control names separated by comma.

    It has direct relationship with the VIEWER_PAGE (example: view_pdf.jsp). VIEWER_CONTROLS may be omitted, be left empty, or a comma separated list of control names. If VIEWER_CONTROLS is not empty then only the specified UI controls will be displayed in the viewer. Controls typically remain in a hierarchy and therefore if a top level control name is used then all of its child controls will be shown and no need to mention the child control names. For example, if TOOLS_PANE itself is specified then there will be no toolbar because all of the tool bar components belong to the TOOLS_PANE.

    General URL format (where xxx=some document format such as pdf, tiff, doc, rtf etc.):

    http://.../view_xxx.jsp?...&VIEWER_CONTROLS=PRINT_BUTTON, FIRST_PAGE_BUTTON, NEXT_PAGE_BUTTON, PREVIOUS_PAGE_BUTTON, LAST_PAGE_BUTTON, GO_TO_A_PAGE_FIELD, TOTAL_PAGE_LABEL&...

    Examples (Custom viewer creation):

    - This shows all controls
    ...view_xxx.jsp?DOCUMENT=docUrl

    - This shows only "print" and back/fwd controls
    http://.../view_xxx.jsp?DOCUMENT=docUrl&VIEWER_CONTROLS=PRINT_BUTTON, FIRST_PAGE_BUTTON, NEXT_PAGE_BUTTON, PREVIOUS_PAGE_BUTTON, LAST_PAGE_BUTTON, GO_TO_A_PAGE_FIELD, TOTAL_PAGE_LABEL

    - Shows only "print" button
    http://.../view_xxx.jsp?DOCUMENT=docUrl&VIEWER_CONTROLS=PRINT_BUTTON

    - Allow user to open a document and then print only once closing the document.
    http://.../view_xxx.jsp?DOCUMENT=docUrl&VIEWER_CONTROLS=SILENT_PRINT_BUTTON

    -Shows only "print" and "url" entry controls
    http://.../view_xxx.jsp?DOCUMENT=docUrl&VIEWER_CONTROLS=PRINT_BUTTON,OPEN_FROM_URL_BUTTON

    Here is the list of all viewer controls. In general these control names may be used for all document viewer scripts and URLs.
    Viewer control name Description
    FIT_TO_WIDTH_BUTTON Fits the document to width of the viewer
    FIT_TO_HEIGHT_BUTTON Fits document page to view height
    FIT_TO_WINDOW_BUTTON Fits page within the view window
    ROTATE_PAGE_CLOCKWISE_BUTTON Rotate page clockwise
    ROTATE_PAGE_ANTICLOCKWISE_BUTTON Rotate page counter clockwise
    OPEN_FROM_URL_BUTTON Open a document from the URL enterable field control
    EDIT_DOCUMENT_HISTORY_BUTTON Open a dialog to edit the document open history
    FIRST_PAGE_BUTTON Show first page
    PREVIOUS_PAGE_BUTTON Show previous page
    NEXT_PAGE_BUTTON Show next page
    LAST_PAGE_BUTTON Show last page
    GO_TO_A_PAGE_FIELD Enter a page number to go show that page
    ZOOMIN_BUTTON Zoom in button
    ZOOMOUT_BUTTON Zoom out button
    ZOOM_CHANGE_COMBO Drop down combo with list of pre-selected zooms to choose
    HUNDREAD_PERCENT_BUTTON View with no zoom
    PRINT_BUTTON Print one or more pages
    SILENT_PRINT_BUTTON Used for silent printing from a browser. If this control is shown the UI will close automaticaly once print button is pressed.
    SAVE_AS_PDF_BUTTON Save document as a PDF file
    SAVE_AS_PNG_BUTTON Save one or more pages as PNG image
    SAVE_AS_JPEG_BUTTON save one or more pages as JPEG image
    SAVE_AS_BMP_BUTTON Save one or more pages as BMP image
    HELP_BUTTON Show help window
    CLOSE_DOCUMENT_BUTTON Close currently opened document
    OPEN_LOCAL_DOCUMENT_BUTTON Open file dialog to open a document from local file system
    THUMBNAILS_VIEW_BUTTON Buttn to show or hide thumbnail view
    SINGLE_PAGE_LAYOUT_BUTTON Button to show pages with one page at a time. User can view one page at a time and need to press on page navigation buttons to see other pages
    CONTINOUS_PAGE_LAYOUT_BUTTON Show all pages in a scrollable single control pane
    PRINT_RANGE_FIELD User enterable print control to specify range of pages to print
    TOTAL_PAGE_LABEL Label that shows current page number with total number of pages
    URL_ADDRESS_LABEL Label describing the URL field where user can enter a document location
    Following are the top level controls containing child controls.
    FIT_TO_HEIGHT_MI Menu item to fit page in view width
    FIT_TO_WIDTH_MI Menu item to view page in view height
    FIT_TO_WINDOW_MI Menu item to view page within the view window
    ROTATE_PAGE_CLOCKWISE_MI Menu item to rotate a page clockwise
    ROTATE_PAGE_ANTICLOCKWISE_MI Menu item to rotate a page counter clockwise
    OPEN_FROM_URL_MI Menu item to open a document from URL entry field
    EDIT_DOCUMENT_HISTORY_MI Menu item to open document history edit window
    FIRST_PAGE_MI Go to first page menu item
    PREVIOUS_PAGE_MI Go to previous page menu item
    NEXT_PAGE_MI Go to next page menu item
    LAST_PAGE_MI Go to last page menu item
    ZOOMIN_MI Zoom in menu item
    ZOOMOUT_MI Zoom out menu item
    HUNDREAD_PERCENT_MI 100% zoom menu item
    PRINT_MI Print menu item
    SILENT_PRINT_MI Silent print menu item
    SAVE_AS_PDF_MI Save as a PDF document menu item
    SAVE_AS_PNG_MI Save one or more pages as PNF image menu item
    SAVE_AS_JPEG_MI Save one or more pages as JPEG image menu item
    SAVE_AS_BMP_MI Menu item to same one or more pages as BMP image
    SHOW_HELP_MI Menu item to show help window
    ABOUT_MI Menu item to show about window
    PROXY_MI Menu item to show proxy setting window
    CLOSE_DOCUMENT_MI Menu item to close the currently opened document
    OPEN_LOCAL_DOCUMENT_MI Menu item to open a document from local file system
    THUMBNAILS_VIEW_MI Thumbnail viewing menu item
    SINGLE_PAGE_LAYOUT_MI Menu item for switching to single page view
    CONTINOUS_PAGE_LAYOUT_MI Show continous pages view
    TOOLS_PANE Tools pane
    TOOL_BAR_PANE Tool bar container pane
    FILE_TOOL Pane contains the file toolbar
    THUMBNAIL_TOOL Pane contains the thumbnails toolbar
    BROWSE_TOOL Pane contains the browse toolbar
    ZOOM_TOOL Container for zoom toolbar
    PRINT_TOOL Container for print related controls
    ROTATE_TOOL Container for page rotation related controls
    HELP_TOOL Container for help controls
    PAGE_LAYOUT_TOOL Container holds the page view
    MENU_BAR_PANE Container holds the menubar
    FILE_MENU Container holds the file menu
    VIEW_MENU Container for view menu
    HELP_MENU Help menu container
    STATUS_BAR Container for status bar
    LEFT_TAB Container for left hand side tab view typically holds thumbnails, table of content and similar views

    Contact Us

    Copyright © Activetree, Inc. All rights reserved.
    Web: http://www.activetree.com
    Email: sales@activetree.com
    Tel: +1 408-791-8036 Fax: +1 408-716-8450