ScriptX logotype
  • Getting started
  • Documentation
  • Samples
  • Pricing
Free Trial Downloads
  • Home
  • Getting started
  • Documentation
  • Samples
  • Pricing
Developers ›  Knowledge Bank ›  How To Guides ›  ScriptX.Services ›  Then To Now ›  Stage 2

Printing with ScriptX.Services

This walk-through illustrates taking a classic document that has a controlled print experience and works only in Internet Explorer and making it work with ScriptX.Services in any browser on any platform using the minimum amount of development effort and making as few changes as possible (though more changes might be desirable).

Previously : Stage 1 - Implement a simple UI

To work with ScriptX.Services requires the  ScriptX.Services Client Library that implements compatibility to ScriptX.Addon for ScriptX.Services. The libraries can be configured with attributes describing the server to use.

The ScriptX.Services Server in use is ScriptX.Services for Windows PC which default listens on 127.0.0.1, port 4991. We can use the same license as we used with ScriptX.Add-on.

The following new code is needed:

    
    <!-- Add.on to scriptx.services compatibility -->
    <script src="//cdn.jsdelivr.net/npm/scriptxprint-html@1/dist/meadco-scriptxservices.min.js"
        data-meadco-license="8f351de0-5990-45c3-8fd2-8037b878939f"
        data-meadco-server="http://127.0.0.1:41191"
        data-meadco-license-path="warehouse"
        data-meadco-license-revision="0"
        data-meadco-syncinit="true"
    >
    </script>
    

That is all that is needed.

Browse to the sample

ScriptX.Services for Windows PC must be running on the PC. ScriptX.Services will not start on demand but they are started whenever a user logs-in.

If unsure, use the  ScriptX.Services dashboard to check.

Open your browser (any browser) and go to the address  https://scriptxprintsamples.meadroid.com/ThenToNow/Now

  • If you have used Internet Explorer note that nothing has changed, everything works exactly as before (ScriptX.Add-on is still being used).
  • If you use a browser such as Google Chrome or Microsft Edge then the buttons can be used to print the page.

If you use Internet Explorer then the ScriptX.Services Client Library does nothing and ScriptX.Addon implments printing.

If you use an evergreen browser then it will ignore the <object /> tags of ScriptX.Addon and the ScriptX.Services Client Library will implement a "factory" object and "factory.printing" in javascript and will use ScriptX.Services for printing.

What does not work with ScriptX.Services as it does with ScriptX.Add-on
  • The default is no prompt when printing - with ScriptX.Add-on the default is to prompt.
  • Using the print options from the browser Print menu gives the browser print experience as it has not been overridden by ScriptX.Services.

Please note that print preview requires ScriptX.Services for Windows PC v2.16.0 or later and ScriptX Client Library v1.11.0 or later - it is not supported by earlier versions.

Using other ScriptX.Services Servers

To use ScriptX.Services on Cloud or ScriptX.Services for On-Premise Devices then the attributes change, for example, to work with ScriptX.Services for On-Premise Devices:

    
    <script src="//cdn.jsdelivr.net/npm/scriptxprint-html@1/dist/meadco-scriptxservices.min.js"
        data-meadco-subscription=""
        data-meadco-server="http://<yourlocaldomain>/<yourOnPremServicesAppName>">
    </script>
    
Next up: Stage 3 - Summary and review
  • Knowledge Bank
  • 'How To' Guides
    • ScriptX.Services
      • Introduction
      • Getting started
      • Evaluate with modern code
      • Maintaining investment in current code
        • Stage 1: Adding UI
        • Stage 2: Printing with ScriptX.Services
        • Stage 3: Summary and review
        • Stage 4: Error reporting
        • Stage 5: Prompted printing
        • Stage 6: Preparing for advanced uses
        • Stage 7: WaitForSpoolingComplete
        • Stage 8: Recommendations for some common issues
      • Printing with the API
      • MeadCoScriptXJS Library
      • Installing ScriptX.Services
        • For Windows PC
        • For On Premise Devices hosted on Windows Server
        • For On Premise Devices hosted on Windows 10/11
        • Configure options For On Premise Devices
        • Cloud
      • Orchestrator
      • Debugging
      • License deployment
        • For Windows PC
        • For On Premise Devices
      • Samples
        • Configure for Windows PC
        • Configure for On Premise
        • Configure for Cloud
    • Security Manager
      • Deploying a license or revision
    • ScriptX.Add-on
      • Introduction
      • Installing ScriptX on client PCs
      • Basic printing with ScriptX
      • Advanced printing features
      • Backwards compatibility
      • How to check if ScriptX is installed
      • License deployment
      • Quick start with Visual Studio
        • ASP.NET MVC
        • ASP.NET Web Forms
      • Nuget Packages
        • MeadCoScriptXJS Library
        • Installer helpers
        • ASP.NET WebForms Controls
        • Helpers for ASP.NET MVC
      • Client-side printing samples
  • Technical Reference
    • ScriptX.Services
      • Web service API
        • Service Description
          • (GET)
        • Licensing
          • licensing (GET)
          • licensing (POST)
          • licensing/ping (GET)
        • Printer
          • settings (GET)
          • current (GET)
          • current (PUT)
          • connection (PUT)
          • connection (DELETE)
        • PrintHtml
          • settings (GET)
          • deviceinfo (GET)
          • htmlPrintDefaults (GET)
          • print (POST)
          • status (GET)
          • download (GET)
          • canceljob (PUT)
        • PrintPdf
          • print (POST)
          • status (GET)
          • download (GET)
        • PrintDirect
          • print (POST)
      • Orchestrator API
        • v1
          • GET
        • v2
          • PUT
          • GET
      • ScriptX.Services compatibility roadmap
    • Security Manager
      • How it works
      • License Expiry
      • Testing for a valid license
      • About the license file (.mlf)
        • LICENSE
        • APPLICENSE
        • TITLE
        • DOMAINS
        • DOMAIN
        • PERMISSION
      • API
        • Apply
        • License
        • result
        • validLicense
    • ScriptX.Add-on
      • factory
        • baseUrl
        • ComponentVersionString
        • IsUniqueIDAvailable
        • OnDocumentComplete
        • relativeUrl
        • ResetUniqueID
        • ScriptXVersion
        • SecurityManagerVersion
        • Shutdown
        • UniqueID
      • printing
        • AddPrinterConnection
        • BatchPrintPDF
        • BatchPrintPDFEx
        • bottomMargin
        • collate
        • copies
        • currentPrinter
        • DefaultPrinter
        • disableUI
        • duplex
        • duplex2
        • EnumJobs
        • EnumPrinters
        • footer
        • GetJobsCount
        • GetMarginMeasure
        • header
        • headerFooterFont
        • IsSpooling
        • IsTemplateSupported
        • leftMargin
        • onafterprint
        • onbeforeprint
        • onbeforeunload
        • onpagesetup
        • onuserpagesetup
        • onuserprint
        • onuserprintpreview
        • orientation
        • OwnQueue
        • pageHeight
        • PageSetup
        • pageWidth
        • paperSize
        • paperSource
        • paperSource2
        • portrait
        • Preview
        • Print
        • printBackground
        • printer
        • PrintHTML
        • PrintHTMLEx
        • PrintPDF
        • PrintSetup
        • printToFileName
        • RemovePrinterConnection
        • rightMargin
        • SetMarginMeasure
        • SetPageRange
        • SetPreviewZoom
        • SetPrintScale
        • Sleep
        • templateURL
        • topMargin
        • TotalPrintPages
        • unprintableBottom
        • unprintableLeft
        • unprintableRight
        • unprintableTop
        • WaitForSpoolingComplete
      • printerControl
        • attributes
        • Bins
        • Forms
        • isLocal
        • isNetwork
        • isShared
        • Jobs
        • location
        • name
        • Pause
        • port
        • Purge
        • Resume
        • serverName
        • shareName
        • status
      • Job
        • Delete
        • Pause
        • Restart
        • Resume
      • enhancedFormatting
        • allFooterHeight
        • allHeaderHeight
        • allPagesFooter
        • allPagesHeader
        • extraFirstFooterHeight
        • extraFirstPageFooter
        • firstFooterHeight
        • firstHeaderHeight
        • firstPageFooter
        • firstPageHeader
        • pageRange
        • printingPass
      • rawPrinting
        • printer
        • printDocument
        • printString
    • Change and history logs
    • Articles
      • v1.15.x ScriptX Client Library
      • Dialogs with ScriptX.Services
      • Accessing protected content
      • Long term servicing (LTS)
 
ScriptX logotype
Home Getting started Documentation Samples Contact us

© 2025 Mead & Co Limited.

Follow us:
LinkedIn   GitHub
X

Warning:

This ScriptX.Add-on sample can only be viewed using Internet Explorer.