Getting started with ScriptX.Services
ScriptX.Services enables the consistent appearance and formatting of HTML content printed from a browser. It also provides for printing of PDF files without prompting and printing directly (aka RAW Printing) to printers such as label printers using the printer's language such as ZPL.
ScriptX.Services is the cross‑browser solution for printing for individual Windows PCs, or across the cloud, or for devices connected to on‑premise servers.
The API server wraps the tried and trusted technology of ScriptX.Add‑on with the Open API and can be anywhere:
Migrating from ScriptX.Addon?
If you are an existing user of ScriptX.Add‑on you may want to go straight to Step 3 - Install ScriptX.Services for Windows PC and then 4 - ‘Then-to-now’ sample: adding ScriptX.Services to a ScriptX.Addon-enabled web page to see how easy it is to convert your organisation's existing ScriptX web pages, removing the dependency on Internet Explorer as the browser.
Adding print features to a web application?
If you are looking to add new printing capabilties to a web application then you may want to go straight to Step 3 - Install ScriptX.Services for Windows PC and then Step 5 - Calling the ScriptX.Services API directly to see how easy it is to add printing HTML, PDF documents and RAW printing, all without prompts, to a web application.
- Step 1 - Using ScriptX.Services for Cloud
- Step 2 - Using samples with ScriptX.Services for Cloud
- Step 3 - Install ScriptX.Services for Windows PC
- Step 4 - ‘Then-to-now’ sample: adding ScriptX.Services to a ScriptX.Addon-enabled web page
- Step 5 - Calling the ScriptX.Services API directly
Step 1 - Using ScriptX.Services for Cloud
Try our free HTML to PDF cloud printing service - no downloads or installation required
If you copy the above code, peplace [YOUR_LICENSE_GUID] with the GUID of your Cloud license.
Step 2 - Using samples with ScriptX.Services for Cloud
Our comprehensive samples site provides coding examples for the entire ScriptX family
Click here to open our samples site in another browser tab.
Firstly we need to check that the samples site is correctly configured to use ScriptX.Services for Cloud.
- Click the Settings link to open the Print Provider Settings panel
- Click the “Cloud / On Premise” option
- Click the “Reset to default” button
- Click the “Use this server” button - a green tick should appear to indicate that that the samples site is able to communicate with the cloud service
Your settings will be stored for the next time you visit the site. The Print Provider Settings panel should now look similar to this:
Now click the Sample sets for Services link at the bottom-left to return to the main page. Click the link for the Advanced sample set Enhanced page layout then click the Techie *Everything* link on the right. Here you can experiment with all the print, printer and paper settings that ScriptX allows you to control.
Step 3 - Install ScriptX.Services for Windows PC
The cross-browser evolution of ScriptX.Add‑on - controlled local printing of content from any mainstream browser
Please note: As you are not reading this guide on a Windows computer you are not able to install the local ScriptX.Services for Windows PC server. However there is no client dependency on Windows, so ScriptX.Services for Cloud or ScriptX.Services for On-Premise Devices will allow printing from the browser on a non-Windows computer or device.
Step 4 - ‘Then-to-now’ sample: converting a ScriptX‑enabled web page to use ScriptX.Services
When used in conjunction with our ScriptX.Add‑on wrapper library MeadCoScriptXJS, the ScriptX.Print.Client library enables a web page to switch seamlessly between ScriptX.Services and ScriptX.Add‑on for Internet Explorer, depending on the user's browser.
In other words, migration of your website from ScriptX.Add‑on to ScriptX.Services is quick and easy, and users of your existing, functioning ScriptX‑enabled website will no longer be restricted to Internet Explorer.
Maintaining investment in current code
If your organisation already uses ScriptX.Add‑on, please take a look at the section devoted to maintaining investment in current code which discusses a worked-through example of converting a web page from ScriptX.Add‑on to use both ScriptX.Services and ScriptX.Add‑on if available.
Step 5 - Calling the ScriptX.Services API directly
The ScriptX.Services server, whether in the cloud or installed locally, exposes a rich API.
of a ScriptX.Services server using an AJAX library or the browser
wraps calls to this API with an object model that handles licensing and gives access to page and printer
settings. This makes the job of migrating an existing ScriptX-enabled website straightforward (see Step 4)
but in many cases, such as where a known local printer is targeted or where a website uses a framework such as React, Angular or Vue.js,
calls to the API using the browser
fetch api or other Ajax library may be more appropriate.
Calling the API using
and the overhead of loading them.
Here is an example of printing an HTML fragment to a known local printer using an instance of ScriptX.Services for On-Premise Devices installed on an intranet (assumes jQuery is loaded and simplified as no cient license is required with ScriptX.Services for On-Premise Devices):
See Printing with the API for more
fetch based examples and discussion on how to use the API.
An OpenAPI description of the ScriptX.Services API can be found here, and a full technical reference is also available here. Both of these documents include functionality to test calls to the API directly from the page.