<<if comments>>
Placing a copy of this cpclticketlayout.txt (LBL) file on the Internal server in the same dir as the Web.config allows an
override of the baked-in standard - which contains exactly the same data as this file. If you choose to override the
baked-in version, you can test your layout changes using the FieldTicket app Settings > BP > {pwd} > Unlock > ... > NSTP Tester
As always, if you need assistance, don't hesitate to contact Mpowered Support: support@mpowered.biz
LBL forms defined in cpclticketlayout.txt are dynamic - changing what gets printed as data in the ticket being printed changes,
as well as being controlled by various device and server settings. A 'running y' (runny) concept is used, so that all the y positions start
at the top of the page and as lines and text are added, runny keeps track of where we are as we move down the page. The running y
concept allows for sections to be added or dropped easily, as well as full control over the look of the final printed ticket.
Starting at the top:
the starty var gets set to the value identified in this cpcl file <<starty=189>>. This is the y starting point on the page, then
starty gets the nstpyoffset added to it - which is used to slide the whole LBL up OR down the page, then
starty is multiplied by either 1 (for the printer version of the cpcl) or 0 (for the svg version of the cpcl), then
the runny var starts off getting set to starty; the subby (sub-section y) var is the set to the value of runny.
There are gap variables (gapvars e.g. <<gap1y=60>>) which are used to define gaps between various elements - lines and text).
The gavars in the baked-in standard layout produce a reasonably condensed ticket. To open up the form, and give it more whitespace
around elements, the gapvars can be increased.
yhold1, yhold2, yhold3 vars are all set to 0
Then, in the cpcl below, we use various of these replacements, which manipulate runny and subby:
<<runny>> means replace with the current value of runny
<<runnymm>> means replace replace with the current value of runny(runny/8)
<<runny$n>> means means just add (+|-)n to runny, but no replace
<<runny&gapvar>> means just add gapvar to runny, but no replace, and set subby to 0
<<runny+gapvar>> means replace with the (current value of runny) + gapvar, but don't change runny, and set subby to 0
<<runny#gapvar>> means replace with the (current value of runny) + gapvar, and update runny to (current value of runny) + gapvar
<<subby>> means replace with the current value of runny + subby, but don't change runny or subby
<<subby=0>> means set subby to 0, but no replace
<<subby&gapvar>> means just add gapvar to subby, but no replace
<<subby+gapvar>> means replace with the (current value of runny) + subby + gapvar, and add gapvar to subby
<<subby#gapvar>> means replace with the (current value of runny) + subby + gapvar, and add subby to runny, and set subby to 0
<<subby^gapvar>> means replace with the (current value of runny) + subby + gapvar, and set subby to 0
<<yhold1#>> means set the current value of runny in gapvar yhold1, but no replace (there are 3 yhold gapvars)
<<yhold1>> means replace with the current value of gapvar yhold1
<<end comments>>
<!--- ********************************* --->
<!--- Mpowered Standard VEH, LNA ticket --->
<!--- ********************************* --->
<<if variables>>
<<starty=189>>
<<runny=starty>>
<<gap0y=0>><!--- used for no y change --->
<<gap1y=60>><!--- top line pushdown --->
<<gap2y=24>><!--- font 7 0 px (also svg font size t70size below) --->
<<gap3y=43>><!--- font 7 1 px (also svg font size t71size below) --->
<<gap4y=47>><!--- font 4 0 px (also svg font size t40size below) --->
<<gap5y=-7>><!--- shim back up to snug lower 7 1 text a little closer to the 7 1 text above it --->
<<gap6y=3>><!--- shim down a bit after a LINE so 7 0 text isn't right up on the line --->
<<gap7y=125>><!--- shim for the QR code --->
<<gap8y=0>>
<<gap9y=0>>
<<xguide575a=21>><!--- x position guidelines for 575 (3in) paper --->
<<xguide575b=35>>
<<xguide575c=130>>
<<xguide575d=221>>
<<xguide575e=236>>
<<xguide575f=291>>
<<xguide575g=305>>
<<xguide575h=472>>
<<xguide575i=561>>
<<xguide575j=0>>
<<xguide575k=0>>
<<xguide831a=30>><!--- x position guidelines for 831 (4in) paper --->
<<xguide831b=51>>
<<xguide831c=188>>
<<xguide831d=319>>
<<xguide831e=341>>
<<xguide831f=421>>
<<xguide831g=441>>
<<xguide831h=721>>
<<xguide831i=810>>
<<xguide831j=0>>
<<xguide831k=0>>
<<dropextamt1sec=N>><!--- Y=force drop the xamt section (even if it has data), N=section will display (but only if it has data) --->
<<dropextamt2sec=N>><!--- Y=force drop the yamt section (even if it has data), N=section will display (but only if it has data) --->
<<addencsec=>>
<<end variables>>
<<if svgvars>>
<<b3of9size=50>>
<<b3of9yadj=0>>;
<<barfontnm=Libre Barcode 39>>
<<font4nm=Sofia Sans Extra Condensed>><!--- for the DEVICE version we're going to make this Sofia Sans Extra Condensed Bold, tacking on Bold --->
<<font70nm=Sofia Sans>>
<<font71nm=Sofia Sans Extra Condensed>>
<<t70size=24>>
<<t71size=39>>
<<t40size=43>>
<<t9041size=81>>
<<fillcolour=green>>
<<strokecolour=#000000>>
<<strokewidth=1>>
<<end svgvars>>
<<if svgpre>>
<<if toserver>><!--- this will end up as a PDF-able version of the HTML - ready for selectPDF --->
<!DOCTYPE html>
<html>
<head>
</head>
  <link href='https://fonts.googleapis.com/css?family=Libre Barcode 39' rel='stylesheet'>
  <style>
    body {font-family: 'Libre Barcode 39';}
  </style>
<body>
<!--- to get the pdfw and pdfh, divide paperw and viewBoxHeight by 1.45 --->
<svg width='<<pdfw>>' height='<<pdfh>>' viewBox='0 0 <<paperw>> @@@viewBoxHeight@@@' fill='none'>
  <style>
    @import url('https://fonts.googleapis.com/css?family=Sofia+Sans+Extra+Condensed:400');
    @import url('https://fonts.googleapis.com/css2?family=Sofia+Sans+Extra+Condensed:ital,wght@0,700;1,700');
    @import url('https://fonts.googleapis.com/css?family=Sofia+Sans:400');
  </style>
<<end toserver>>
<<if todevice>>
<svg width='@@@scwidth@@@' viewBox='0 0 <<paperw>> @@@viewBoxHeight@@@' fill='none'>
<<end todevice>>
  <path d='M0,0 L<<paperw>>,0 L<<paperw>>,@@@viewBoxHeight@@@ L 0,@@@viewBoxHeight@@@ L0,0' fill='#f2faff' stroke='#FFC681'/>
  <<if todevice>><image href='resources/images/Free3of9 barcode MT.NOTREAL.png' width='280' height='55' x='<<barcodex>>' /><<end todevice>>
<<end svgpre>>
<<if svgpost>>
</svg>
<<if toserver>>
</body>
</html>
<<end toserver>>
<<if todevice>><!---<<posthtmlreport>>---><<end todevice>>
<<end svgpost>>
<<if cpcl>>
! U1 setvar "media.sense_mode" "bar"
! U1 setvar "power.inactivity_timeout" "7200"
! U1 setvar "media.feed_length" "<<nstpfeedlength>>"
! 0 200 200 <<runnymax>> 1<<crlf>><!--- DO NOT change this line, unless the regex in cpcltosvg() above is also changed!!! --->
SPEED 0<<crlf>>
CONTRAST 1<<crlf>>
CENTER<<crlf>>
BARCODE F39 1 1 40 0 <<runny>> <<barc>><<crlf>><!--- bar code --->
LEFT<<crlf>>

LINE <<xguidea>> <<runny+gap1y>> <<xguidei>> <<runny#gap1y>> 1<<crlf>>
<<yhold1#>><!--- hold this y - it is the top of the box --->
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>>
<<runny&gap6y>><!--- shim --->
TEXT 7 0 <<xguideb>> <<subby>> Ticket #:<<crlf>>
TEXT 4 0 <<xguideb>> <<subby^gap2y>> <<tkno>><<crlf>>
<<if runft1>><<if plat>>TEXT 7 0 <<xguideg>> <<subby>> Plate/Prov:<<crlf>><!--- PLATE ticket --->
TEXT 7 1 <<xguideg>> <<subby+gap2y>> <<platprov>><<crlf>><<end plat>>
<<if vin>>TEXT 7 0 <<xguideg>> <<subby>> VIN:<<crlf>><!--- VIN ticket --->
TEXT 7 1 <<xguideg>> <<subby+gap2y>> <<vin>><<crlf>><<end vin>><<end runft1>>
<<if runft2>>TEXT 7 0 <<xguideg>> <<subby>> Officer:<<crlf>>
TEXT 7 1 <<xguideg>> <<subby+gap2y>> <<badg>><<crlf>><<end runft2>>
LINE <<xguidea>> <<subby+gap3y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>><!--- TOTAL --->
<<if runft2>>LINE <<xguidef>> <<yhold1>> <<xguidef>> <<runny>> 1<<crlf>><!--- vert separation line ---><<end runft2>>
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>>
<<runny&gap6y>><!--- shim down a smidge --->

<<if runft1>>TEXT 7 0 <<xguideb>> <<subby>> Make:<<crlf>>
TEXT 7 1 <<xguideb>> <<subby^gap2y>> <<make>><<crlf>>
TEXT 7 0 <<xguideg>> <<subby>> Model:<<crlf>>
TEXT 7 1 <<xguideg>> <<subby+gap2y>> <<modl>><<crlf>>
LINE <<xguidea>> <<subby+gap3y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>><!--- TOTAL --->
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>>
<<runny&gap6y>><!--- shim down a smidge --->
TEXT 7 0 <<xguideb>> <<subby>> Colour:<<crlf>>
TEXT 7 1 <<xguideb>> <<subby^gap2y>> <<colr>><<crlf>>
TEXT 7 0 <<xguideg>> <<subby>> Officer:<<crlf>>
TEXT 7 1 <<xguideg>> <<subby+gap2y>> <<badg>><<crlf>>
LINE <<xguidea>> <<subby+gap3y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>><!--- TOTAL --->
LINE <<xguidef>> <<yhold1>> <<xguidef>> <<runny>> 1<<crlf>><!--- vert separation line --->
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>>
<<runny&gap6y>><!--- shim down a smidge ---><<end runft1>>

<<if runft2>>TEXT 7 0 <<xguideb>> <<subby>> Name and Address:<<crlf>>
TEXT 7 1 <<xguideb>> <<subby+gap2y>> <<name>><<crlf>>
<<subby&gap5y>><!--- shim up --->
TEXT 7 1 <<xguideb>> <<subby+gap3y>> <<adr1>><<crlf>>
<<subby&gap5y>><!--- shim up --->
TEXT 7 1 <<xguideb>> <<subby+gap3y>> <<adr2>><<crlf>>
<<subby&gap5y>><!--- shim up --->
TEXT 7 1 <<xguideb>> <<subby+gap3y>> <<adr3>><<crlf>>
LINE <<xguidea>> <<subby+gap3y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>><!--- TOTAL --->
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>>
<<runny&gap6y>><!--- shim down a smidge ---><<end runft2>>

<<if bylawsec>>TEXT 7 0 <<xguideb>> <<subby>> Bylaw: <<bylw>><<crlf>>
TEXT 7 1 <<xguideb>> <<subby+gap2y>> <<byp1>><<crlf>>
<<subby&gap5y>><!--- shim up --->
TEXT 7 1 <<xguideb>> <<subby+gap3y>> <<byp2>><<crlf>>
LINE <<xguidea>> <<subby+gap3y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>><!--- TOTAL --->
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>>
<<runny&gap6y>><!--- shim down a smidge ---><<end bylawsec>>

TEXT 7 0 <<xguideb>> <<subby>> Section: <<sect>><<crlf>>
TEXT 7 1 <<xguideb>> <<subby+gap2y>> <<sep1>><<crlf>>
<<subby&gap5y>><!--- shim up --->
TEXT 7 1 <<xguideb>> <<subby+gap3y>> <<sep2>><<crlf>>
LINE <<xguidea>> <<subby+gap3y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>><!--- TOTAL --->
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>>
<<yhold2#>><!--- hold in case of optional service date vertical line, can reuse yhold2 after last <<end svdtsec>> below --->
<<runny&gap6y>><!--- shim down a smidge --->

TEXT 7 0 <<xguideb>> <<subby>> Issued Date:<<crlf>>
TEXT 7 1 <<xguideb>> <<subby+gap2y>> <<ofdt>><<crlf>>
<<if svdtsec>><<subby=0>>TEXT 7 0 <<xguideg>> <<subby>> Service Date:<<crlf>>
TEXT 7 1 <<xguideg>> <<subby+gap2y>> <<svdt>><<crlf>><<end svdtsec>>
LINE <<xguidea>> <<subby+gap3y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>><!--- TOTAL --->
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>>
<<if svdtsec>>LINE <<xguidef>> <<yhold2>> <<xguidef>> <<runny>> 1<<crlf>><<end svdtsec>><!--- VERT line for Service Date --->
<<runny&gap6y>><!--- shim down a smidge --->

TEXT 7 0 <<xguideb>> <<subby>> Location: <<if gpsloc>>(GPS: <<gpsloc>>)<<end gpsloc>><<crlf>>
TEXT 7 1 <<xguideb>> <<subby+gap2y>> <<locx>><<crlf>>
LINE <<xguidea>> <<subby+gap3y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>><!--- TOTAL --->
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>>
<<yhold2#>><!--- hold for discount section vertical line --->
<<runny&gap6y>><!--- shim down a smidge --->

TEXT 7 0 <<xguideb>> <<subby>> Fine Amount:<<crlf>>
<<subby&gap2y>><<crlf>>
<<subby&gap2y>><<crlf>>
TEXT 4 0 <<xguideb>> <<subby+gap2y>> <<fine>><<crlf>>
<<subby=0>>
TEXT 7 0 <<xguidee>> <<subby>> <<dms1>><<crlf>>
TEXT 7 0 <<xguidee>> <<subby+gap2y>> <<dms2>><<crlf>>
TEXT 7 0 <<xguidee>> <<subby+gap2y>> <<dms3>><<crlf>>
TEXT 4 0 <<xguidee>> <<subby+gap2y>> <<damt>><<crlf>>
LINE <<xguidea>> <<subby+gap4y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>>
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>>
LINE <<xguided>> <<yhold2>> <<xguided>> <<runny>> 1<<crlf>><!--- VERT line for discount section --->

<<if bolddiscbox>>LINE <<xguided>> <<yhold2>> <<xguided>> <<runny>> 3<<crlf>>
LINE <<xguided>> <<yhold2>> <<xguidei>> <<yhold2>> 3<<crlf>>
LINE <<xguidei>> <<yhold2>> <<xguidei>> <<runny>> 3<<crlf>>
LINE <<xguided>> <<runny>> <<xguidei>> <<runny>> 3<<crlf>><<end bolddiscbox>>

<<if wrntsec>>T90 4 1 <<xguideh>> <<runny>> <<wrnt>><<crlf>><!--- vertical WARNING text ---><<end wrntsec>>

<<if xamtsec>><<runny&gap6y>>
TEXT 7 0 <<xguideb>> <<subby>> <<xms1>><<crlf>>
TEXT 7 0 <<xguideb>> <<subby+gap2y>> <<xms2>><<crlf>>
TEXT 4 0 <<xguideb>> <<subby+gap2y>> <<xamt>><<crlf>>
LINE <<xguidea>> <<subby+gap4y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>><!--- TOTAL --->
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>><<end xamtsec>>
<<if yamtsec>><<runny&gap6y>>
TEXT 7 0 <<xguideb>> <<subby>> <<yms1>><<crlf>>
TEXT 7 0 <<xguideb>> <<subby+gap2y>> <<yms2>><<crlf>>
TEXT 4 0 <<xguideb>> <<subby+gap2y>> <<yamt>><<crlf>>
LINE <<xguidea>> <<subby+gap4y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>><!--- TOTAL --->
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>><<end yamtsec>>

<<if cmntsec>><<runny&gap6y>>
TEXT 7 0 <<xguideb>> <<subby>> Comments:<<crlf>>
TEXT 7 1 <<xguideb>> <<subby+gap2y>> <<cmt1>><<crlf>>
<<subby&gap5y>><!--- shim up --->
TEXT 7 1 <<xguideb>> <<subby+gap3y>> <<cmt2>><<crlf>>
LINE <<xguidea>> <<subby+gap3y>> <<xguidei>> <<subby#gap0y>> 1<<crlf>><!--- TOTAL --->
<<if debug>>TEXT 7 0 <<xguideh>> <<runny>> <<runnymm>><<crlf>><<end debug>><<end cmntsec>>

LINE <<xguidea>> <<yhold1>> <<xguidea>> <<runny>> 1<<crlf>><!--- bottom of the BOX - left vertical line --->
LINE <<xguidei>> <<yhold1>> <<xguidei>> <<runny>> 1<<crlf>><!--- bottom of the BOX - right vertical line --->
<<runny&gap6y>><!--- put a little breathing room under the box --->

<!--- addencsec is for any other customizations, especially a QR code --->
<!--- Note: the longer the url/text, the bigger the QR becomes on the printed version, so keep it short as possible! --->
<!--- You MUST have a <<cr>> after the QR target data, see example. The <<cr>> is replaced with cr on device --->
<<addencsec>>

<<if debug>>LINE <<xguidea>> 0 <<xguidei>> 0 1<<crlf>>
TEXT 7 0 <<xguideh>> 0 0<<crlf>>
LINE <<xguidea>> <<runny>> <<xguidei>> <<runny>> 1<<crlf>>
TEXT 7 0 <<xguidea>> <<runny>> <<runnymm>> bottom of page<<crlf>><<end debug>><!--- the final runny --->

FORM<<crlf>>
POSTFEED <<nstppostfeed>><<crlf>>
PRINT<<crlf>>
<<end cpcl>>
