2.8.11.052101, 21 May 2019 4:25 PM : © 2019 - Mead & Company Ltd.

 touching this button will return a PDF document of this page.

For users

Compare with previewing/printing the document with your browser : the document has been formatted with desired margins and headers and footers and the paper is in landscape orientation.

This document is served from the cloud and this is the 'classic' basic functionality of the classic, Internet Explorer only, ScriptX.Add-on.

But, the print service resides in the cloud and this is a demonstration, so, the "printing" is limited to delivering the paginated content by a PDF document.

On-premise

This same technology is available from on-premise servers which has access to on-premise printers and so we can bring classic ScriptX functionality to modern browsers like Chrome, Edge, Firefox and Safari - all it takes is some javascript and a Web API.

For the scripters

        <script src="/scripts/jquery-3.1.1.min.js"></script>
        <script src="/scripts/meadco.scriptX/meadco-scriptx-core.js"></script>
        <script src="/scripts/meadco.scriptX/meadco-scriptx-print.js"></script>
        <script src="/scripts/meadco.scriptX/meadco-scriptx-printhtml.js"></script>
        <script src="/scripts/meadco.scriptx/meadco-scriptxfactory.js"></script>
        <script src="/scripts/meadco-scriptx-1.3.0.js"></script>

        <script type="text/javascript">
        'use strict';    
        // a function for ux to show print in progress
        function spoolStatus(bEnable) { ... }

        $(window).on('load', function () {
           // connect to a print server
           MeadCo.ScriptX.Print.connect(
            "https://scriptx.print.meadroid.com",
            "");
           $("#btn_printPage").click(function () {
              var settings = MeadCo.ScriptX.Print.HTML;
              settings.header = "";
              settings.footer = "&p of &P&b&b&d";
              settings.page.orientation = 
                        MeadCo.ScriptX.Print.HTML.PageOrientation.LANDSCAPE;
              MeadCo.ScriptX.Print.HTML.printDocument();
              
              spoolStatus(true);
              MeadCo.ScriptX.Print.waitForSpoolingComplete(-1,
                  function(result) {
                      spoolStatus(false);
                      if ( typeof result === "string" )
                          alert("An error occurred while printing\n\n" + result);
                  });
           });
        });
        </script>