Skip to content

Instantly share code, notes, and snippets.

View PeteGCole's full-sized avatar
💭
Working on ScriptX.Print.Client - tests and documentation

Pete Cole PeteGCole

💭
Working on ScriptX.Print.Client - tests and documentation
View GitHub Profile
// synchronous waitforspooling complete - unsupported, little tested. use at your own discretion.
//
function WaitForSpoolingComplete() {
var licenseGuid = "{09df1dc1-cba3-48a8-aebe-ef2f287b51cd}"; // replace with own
var serverApiUrl = MeadCo.makeApiEndPoint("http://127.0.0.1:41191", "v1/printHtml");
var printApi = MeadCo.ScriptX.Print;
if (printApi.isSpooling) {
var jobs = printApi.queue;
@PeteGCole
PeteGCole / waitforspoolingcomplete.html
Created September 28, 2020 14:29
WaitForSpoolingComplete scenarios
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>WaitForSpoolingComplete Scenarious</h1>
<div>
// Whether duplex is supported can be checked in one of two ways:
// These rely on the driver correctly reporting that it doesnt support duplex.
// 1. catch the error that occurs when trying to set duplex
try {
factory.printing.duplex = 2;
} catch (e) {
// duplex isnt supported, will need to be manual
}
@PeteGCole
PeteGCole / viewandprint.cshtml
Created October 20, 2016 15:14
Using ASP.NET MVC Helper
@using MeadCo.ScriptXClient
<div class="pagecontent">
<button class="btn btn-default" id="btn-print">Print document</button>
</div>
@* Output ScriptX tags. Will use installer page if required *@
@MeadCo.ScriptXClient.ClientPrinting.GetHtml(
clientValidationAction: ClientPrinting.ValidationAction.Redirect,
printSettings: new PrintSettings
@PeteGCole
PeteGCole / gist:a622c39342440c1d0091de2940ae716b
Last active October 20, 2016 14:33
web.config for ScriptX v7 with MeadCo.ScriptXConfigHandler
<meadco>
<scriptx>
<clientinstaller
filename="~/content/meadco.scriptx/installers/smsx.cab"
manualfilename="~/content/meadco.scriptx/installers/ScriptX.msi"
version="7.7.0.20" scope="machine" processor="x86"
installhelper="~/ScriptXClientPrinting/Install" />
</scriptx>
</meadco>