ScriptX logotype
  • Getting started
  • Documentation
  • Samples
  • Pricing
Free Trial Downloads
  • Home
  • Getting started
  • Documentation
  • Samples
  • Pricing
Developers ›  Knowledge Bank ›  How To Guides ›  ScriptX.Services ›  Debugging tips

Debugging ScriptX.Services

Thoughts on debugging ScriptX.Services

If only code were perfect, each written line worked exactly as required and the whole worked too. These are thoughts on where to look to resolve problems, not necessarily on how to look.

Of course, the problem may reside in the ScriptX.Services implementation. We fix all reported problems as soon as is practical and all licensees are entitled to full support via email.

If you are having problems, contact us and our development team will respond.

Own code

All APIs return errors with an appropriate HTTP error (typically 500) and a text description in the response.

Using the browser developer tools and network monitoring will show the response from the server, this should give a good clue on the problem.

Note that all calls to ScriptX.Services for Cloud and for Windows PC must include a valid license identity in the authentication header of the http request. For ScriptX.Services On Premise the header is not required and any value given will be ignored as in this case it is the ScriptX.Services installation itself that is licensed.

Using the Client libraries

The  ScriptX.Services Client Library provides a set of singleton instances to work with the ScriptX.Services API. The hierarchy implements useful behaviour to interact with the API at increasing levels of abstraction from the API.

The goal of the library is to bring an emulation of MeadCo's ScriptX.Add-on to working with MeadCo ScriptX.Services and this emulation is included in the library.

However, higher levels of the library can be used as convenience wrappers and functions to your own code.

Using ScriptX.Add on emulation

We strongly recommended that when using ScriptX.Addon emulation the  MeadCoScriptXJS Library is also used as this provides a number of useful features for obscuring the inevitable differences there are between the implementations of ScriptX.Add-on and ScriptX.Services. The emulation of the .Addon API with ScriptX.Services is excellent, but not perfect.

Tips
  1. Check the developer console

    Many development issues are logged to the developer console rather than reported as errors to the user.

    If “nothing appears to happen” check the developer console for messages, warnings and errors.

  2. Enable verbose logging

    By default the library does not log informational messages to the console. These can be enabled by including the following code after referencing the library:

            <script src="//cdn.jsdelivr.net/npm/scriptxprint-html@1/dist/meadco-scriptxservices.min.js"></script>
    <script type="text/javascript">
    // If ScriptX.Services client libraries have been loaded enable 
    // some more verbose logging to developer console (f12) for debugging purposes
    if (typeof MeadCo === "object") {
        MeadCo.logEnabled = true;
    }
    </script>
            
            

    The above will provide detailed logging of library actions for printing etc. - in otherwords after the libraries have initialised. To obtain logging of the library initialisation from the get-go (for example, to discover issues with licensing errors) logging can be enabled before the library is referenced:

            <script type="text/javascript">
            var MeadCo = { "logEnable": true };
            </script>
            <script src="//cdn.jsdelivr.net/npm/scriptxprint-html@1/dist/meadco-scriptxservices.min.js"></script>
            
            
  3. Use latest versions

    Check that the latest versions of all components are being used - ScriptX.Services and any javascript libraries being used.

  4. Order of implementation is important

    When working on pages that should support IE 11 and evergreen browsers, the preference should be that ScriptX.Addon is used when IE 11 is the browser.

    The ScriptX.Addon objects should be written in the html for the page before the <script></script> references to the ScriptX.Services libraries.

    In IE 11, the libraries will then see that ScriptX.Addon is available and will not interfere with its use. For evergreen browsers, ScriptX.Addon will not be found and the libraries will provide the emulation.

  5. Order of scripts is important

    If you are creating your own minimised package or are referencing each file individually, please note that the order of files is critical:

                <script src="meadco-core.js"></script>
                <script src="meadco-scriptxprint.js"></script>
                <script src="meadco-scriptxprinthtml.js"></script>
                <script src="meadco-scriptxprintpdf.js"></script>
                <script src="meadco-scriptxfactory.js"></script>
                <script src="meadco-scriptxprintlicensing.js"></script>
                <script src="meadco-secmgr.js"></script>
                
                

    Bad ordering of files or failure to include a required file will result in errors such as:

    "MeadCo.ScriptX.Print.PDF is not available to ScriptX.Services factory emulation."

  6. Verify license deployment details

    Double check the correct license GUID is being used. When using ScriptX.Services for Windows PC also verify that the path to the license file is either “warehouse” or the fullly qualified path to the license file.

    When coding a page for use by both ScriptX.Addon and ScriptX.Services ensure that both reference the correct license.

    Review License deployment.

  7. Verify use of libraries
    • A library should only be referenced once, for example:

                      <script src="//cdn.jsdelivr.net/npm/scriptxprint-html@1/dist/meadco-scriptxservices.min.js"></script>
                      
    • Do not include minimized and unminimized versions of files.

    • Do not include multiple packages, for example do not include meadco-scriptxservices.min.js and meadco-scriptxservicesprint.min.js

  8. Use network logging

    The libraries can eat/translate errors in a way that obscures the underlying problem.

    Using the browser developer tools and network monitoring will show the response from the server, this should give a good clue on the problem.

    If you find such a problem, contact us and our development team will look into improving behaviour.

  9. Review bare bones exemplar code

    A set of quick samples are deliberately bare bones and simple and are intended as exemplars of the scripting required to get ScriptX.Services working.

    The examples illustrate many common advanced features working with both ScriptX.Addon and ScriptX.Services for Windows PC from exactly the same script code with and without the use of  MeadCoScriptXJS Library .

  • 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.