ScriptX.Services for Windows PC License Deployment
This page is all about how to deploy and use the ScriptX.Services evaluation license. After a successful evaluation, deployment of your own license is very similar.
Please read all sections to familiarise yourself with the process and common issues you may encounter.
The license : 3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497
.. is the current evaluation license for ScriptX.Services and ScriptX.Addon.
This is revision 7 of the license and is valid from 24 October 2023 to 20 November 2024
and validates these root URLs:
- scriptxprintsamples.meadroid.com
- support.meadroid.com
- localhost
- www.meadroid.com
- scriptxsamples.meadroid.com
with these features enabled:
- Advanced HTML Printing, Direct/RAW Printing, PDF Printing, Enhanced HTML Formatting,
Note
The url of interest for the evaluation license is "localhost". It enables you to fully evaluate all the features available with ScriptX with content served from a local server such as IIS Express, Node.js, Tomcat etc.
The other urls show where else we at MeadCo use this license and illustrate how a publisher license might look.
Also, this license will work with ScriptX.Add-on for those users who continue to use Internet Explorer 11 or IE Mode in Microsoft Edge.
The application installer
The license is not a lot of use without an application to use it! The ScriptX.Services for Windows PC application must be installed on each Windows x64 PC on which a controlled print experience from any browser is required. Windows 10 and Windows 11 are supported.
The latest version of ScriptX.Services for Windows PC is 2.22.0.22. We always recommend keeping up to date with the latest version to ensure the continued secure and issue free experience for users.
In order for the installers to run administrator rights are required..
Orchestrator for ScriptX.Services is built-in to ScriptX.Services for Windows PC with 2.17.0 and later.
For further information please see the guide to installing ScriptX.Services for Windows PC.
The license file
The license is provided in a file which needs to be downloaded, verified and cached by MeadCo Security Manager for ScriptX Services. The license has to be provided by every HTML page that uses ScriptX.Services for a controlled printing experience.
There is a choice as to where MeadCo Security Manager downloads the file from: MeadCo License Warehouse, or your own content servers.
-
MeadCo License Warehouse
Subject to there being no abuse of the facility and client PCs have access to the public Internet then the license can be downloaded from the MeadCo License Warehouse.
This use is illustrated below.
-
Self host
Client PCs will download the file from your own content server(s). Access to the publiic Internet is not required
The first job is to download the license file:
After download, copy the license file to a suitable content folder on the server for your web application.
For ease of system maintenance it is preferable to a have single current copy of sxlic.mlf located centrally. The file does not have to reside at a licensed address, simply, all client PCs must be able to access and download the file. Also see Recommended binary & license file location.
We strongly recommend against renaming the file to, for example, include a revision number. Renaming will almost certainly cause issues in the future when the license is updated/renewed.
Referencing the license in code
For successful printing the license must:
- Be provided in full, i.e. the license file, to MeadCo Security Manager for ScriptX Services via the ScriptX.Services Licensing API before using any other APIs.
- Be referenced by its GUID (3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497) in each call made to ScriptX.Services APIs for printing (HTML, PDF or RAW).
Page license reference
The page license reference is the equivalent of including the MeadCo Security Manager for ScriptX.Addon on the page using an <OBJECT /> element.
For ScriptX.Services, the reference must be made in script by calling the ScriptX.Services Licensing API and it must be done before using any other APIs.
There are several ways that this can be done. If you wish to use the ScriptX.Services API directly, please see ScriptX.Services Licensing API
If you are using the MeadCo Client Libraries then there are two choices:
-
Call the Licensing.apply() function
'use strict'; MeadCo.ScriptX.Print.Licensing.connect( "http://127.0.0.1:41191", "{3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497}"); MeadCo.ScriptX.Print.Licensing.apply( "{3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497}",7,"warehouse"); MeadCo.ScriptX.Print.HTML.connect( "http://127.0.0.1:41191","{3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497}");
or, as synchronous behaviour is deprecated in all browsers, use an asynchronous connection to the server with a callback function to be called when the server connection is completed. Asynchronous initialisation does not block the browser UI.
Do not use asynchronous initialisation if you are working with "old" code that assumes it can run immediately upon window load/documment ready. You must change your code to allow intialisation to complete before making further calls. See Preparing for advances uses for more information.
'use strict'; MeadCo.ScriptX.Print.Licensing.connect( "http://127.0.0.1:41191", "{3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497}"); MeadCo.ScriptX.Print.Licensing.applyAsync( "{3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497}",7,"warehouse", function() { MeadCo.ScriptX.Print.HTML.connectAsync( "http://127.0.0.1:41191", "{3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497}", function(msg) { console.error("Service initialisation failed: " + msg); }); }, function(msg) { console.error("Apply license failed: " + msg) } );
The value "warehouse" means the license will be downloaded from MeadCo's license service. Alternatively, provide a valid fully qualified, not relative, url to the location of the license file (sxlic.mlf).
If a PC will be shared among several users and multiple users may be signed in concurrently then you should consider using Orchestrator for ScriptX.Services for Windows PC to resolve port conflict problems.
In these circumstances Orchestrator can offer considerable benefits.
Orchestrator must be configured before attempting to connect and apply the license by specifying the port in use by Orchestrator:
'use strict'; MeadCo.ScriptX.Print.orchestrator = 41190; // .. as above synchronous or asynchronous code
Orchestrator is built-in to ScriptX.Services for Windows PC 2.17.0 and later.
Or,
-
Use attribute values. The first example assumes you have included the libraries in your app, the second assumes use of a CDN.
<script src="/scripts/MeadCo.ScriptX/meadco-secmgr-1.15.1.js" data-meadco-server="http://127.0.0.1:41191" data-meadco-orchestrator="41190" data-meadco-license="{3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497}" data-meadco-license-path="warehouse" data-meadco-license-revision="7" data-meadco-syncinit="true" data-meadco-reporterror="true"> </script>
Or, as synchronous behaviour is deprecated in all browsers, use an asynchronous connection to the server:
Do not use asynchronous initialisation if you are working with "old" code that assumes it can run immediately upon window load/documment ready. You must change your code to allow intialisation to complete before making further calls. See Preparing for advances uses for more information.
<script src="//cdn.jsdelivr.net/npm/scriptxprint-html@1/dist/meadco-scriptxservices.min.js" data-meadco-server="http://127.0.0.1:41191" data-meadco-orchestrator="41190" data-meadco-license="{3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497}" data-meadco-license-path="warehouse" data-meadco-license-revision="7" data-meadco-syncinit="false"> </script>
- data-meadco-server
- The url to the ScriptX.Services for Windows PC server. Typically this value is http://127.0.0.1:41191.
- data-meadco-orchestrator
-
Default is Orchestrator is not in use. If a PC will be shared among several users and multiple users may be signed in concurrently then you should consider using Orchestrator for ScriptX.Services to resolve port conflict problems and provide the port in use by Orchestrator.
Orchestrator is built-in to ScriptX.Services for Windows PC 2.17.0 and later.
- data-meadco-license
- The unique MeadCo publishing license provided by MeadCo. The presense of this attribute signals to the library that ScriptX.Services for Windows PC is being used, rather than for Cloud or for On Premise Devices.
- data-meadco-license-path
- The location of the license file (.mlf). The special value "warehouse" signifies the license should be downloaded from the MeadCo Licenses store on the public internet (https://licenses.meadroid.com ). Alternatively, provide a valid fully qualified, not relative, url to the location of the license file (sxlic.mlf)
- data-meadco-license-revision
- The current revision of the license. If this value is later than the currently cached license the the download will be forced - in otherwords this is the means to ensure a valid updated license is used.
- data-meadco-syncinit
- Default true. If false then asynchronous calls are made to the server to verify and if required download and cache the license.
- data-meadco-reporterror
- Default true. Only applies to synchronous initialisation. If false then any errors that occur when appliying the license are not reported in browser UI (they will be logged to the console).
API license reference
If you are or intend using the MeadCo Client Libraries and have initialised them as described above then all API calls to ScriptX.Services will use the required authorisation headers that include the license GUID.
If you are or intend using your own code to make the AJAX API calls then you must add an Authorisation header to each call. For example:
headers = { "Authorization" : "Basic " + btoa("3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497" + ":") };
See Web Service API Reference for more details.
Helpful articles and samples
If a PC will be shared among several users and multiple users may be signed in concurrently then please consider using Orchestrator for ScriptX.Services for Windows PC.
In these circumstances Orchestrator can offer considerable benefits.
The following articles discuss and illustrate how to use ScriptX.Services in your code.
- Orchestrator for ScriptX.Services for Windows PC.
- How to code with ScriptX.Services for Windows PC
- How to install ScriptX.Services for Windows PC
- A discussion and workthrough for migrating from ScriptX.Addon to ScriptX.Services
- A no frills sample of code for ScriptX.Addon and ScriptX.Services using common advanced features.
- Discussion and tips on debugging use of ScriptX.Services for Windows PC.
Finally, remember our samples. These are built to latest HTML standards, use the MeadCoScriptXJS simple wrapper library and illustrate most things that are possible with ScriptX (customers do keep coming up with new and imaginative ways of using it too!). Feel free to examine the source to all samples and copy any code that is of use to you.
Potential problems
This section describes problems you may encouter and how to resolve them. If you canot resolve an issue then please contact our support team via email. All licensees are entitled to unlimited email based support for the duration of license.
Issues may occur when trying to provide the license to MeadCo Security Manager for ScriptX Services via the ScriptX.Services Licensing API and will be either:
- There is a problem with connecting to ScriptX.Services for Windows PC server.
- There was a problem downloading the license.
- The license could not be verified and validated.
- The license is being used in an invalid context.
To debug, open developer tools for your browser (F12) and use the Network pane to log the calls being made to the ScriptX.Services for Windows PC server. Locate the API call (typically "http://localhost:41191/api/v1/licensing") and inspect the response. Any code libraries in use, or your own code, may be reflecting error responses to the UI or console but inspecting the actual response value will remove any doubt about the original error response.
Issues with connecting to ScriptX.Services for Windows PC server
Error | Description/advice |
---|---|
ERR_CONNECTION_REFUSED (seen in the console log) |
This error will typically appear as "http://127.0.0.1:41191/api/v1/licensing/ping?_=1652795005401 net:: ERR_CONNECTION_REFUSED" There are two probable causes:
|
401 Not authorised (seen in the console log) |
This error may occur when the license has not been applied There are two probable causes:
|
Issues with download
Error | Description/advice |
---|---|
The system cannot locate the object specified | This error usually occurs when a bad location/name is given for the license file, in other words the value of the "path" parameter is wrong. To trouble shoot this, try navigating to the value used (adjusting for relative values) and ensure that the file is downloaded by the browser. |
Unspecified error |
If using the MeadCo License Warehouse to deliver license files to users, the most likely cause of this error is the GUID parameter value is wrong; it should be: 3cfd70e2-f38f-4ab2-95f4-4ce4c1e39497. (for example If using your own content server to deliver license files to users then this error indicates an issue has occured on the server. |
Issues with license validation
Error | Description/advice |
---|---|
Invalid HTML parameters specified for the license. |
When working with the evaluation please note that the only valid domain is "localhost". If you are using "localhost" please contact us for additional assistance. |
Issues with context
All licenses contain a list of domains/paths that are valid origins/locations for content wishing to use ScriptX features.
Error | Description/advice |
---|---|
Unauthorized site, or invalid security zone. | The origin of the content requesting to be licensed for using ScriptX.Services for Windows PC is not listed in the license. |