manual.html 432 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="generator" content="pandoc" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  7. <meta name="author" content="Version 2.13.0.9" />
  8. <title>Zint Barcode Generator and Zint Barcode Studio User Manual</title>
  9. <style>
  10. html {
  11. font-family: TeX Gyre Pagella;
  12. color: #1a1a1a;
  13. background-color: #ffffff;
  14. }
  15. body {
  16. line-height: 1.2;
  17. margin: 0 auto;
  18. max-width: 50em;
  19. padding-left: 50px;
  20. padding-right: 50px;
  21. padding-top: 50px;
  22. padding-bottom: 50px;
  23. hyphens: auto;
  24. overflow-wrap: break-word;
  25. text-rendering: optimizeLegibility;
  26. font-kerning: normal;
  27. }
  28. @media (max-width: 600px) {
  29. body {
  30. font-size: 0.9em;
  31. padding: 12px;
  32. }
  33. h1 {
  34. font-size: 1.8em;
  35. }
  36. }
  37. @media print {
  38. html {
  39. background-color: white;
  40. }
  41. body {
  42. background-color: transparent;
  43. color: black;
  44. font-size: 12pt;
  45. }
  46. p, h2, h3 {
  47. orphans: 3;
  48. widows: 3;
  49. }
  50. h2, h3, h4 {
  51. page-break-after: avoid;
  52. }
  53. }
  54. p {
  55. margin: 1em 0;
  56. }
  57. a {
  58. color: #800000;
  59. }
  60. a:visited {
  61. color: #800000;
  62. }
  63. a:not(:hover) {
  64. text-decoration: none;
  65. }
  66. figure {
  67. margin-left: 0;
  68. margin-right: 0;
  69. text-align: center;
  70. }
  71. img {
  72. max-width: 100%;
  73. }
  74. img.btn {
  75. height: 0.9em;
  76. }
  77. img.win {
  78. max-width: 80%;
  79. }
  80. img.pop {
  81. max-width: 60%;
  82. }
  83. img[src*="gui_set_printing_scale.png"] {
  84. max-width: 50%;
  85. }
  86. img.lin {
  87. max-height: 10em;
  88. }
  89. img[src*="code128_rotate90.svg"] {
  90. max-height: 20em;
  91. }
  92. img.i2d {
  93. max-height: 10em;
  94. }
  95. img[src*="upnqr.svg"] {
  96. max-height: 20em;
  97. }
  98. img.i2dbig {
  99. }
  100. img.trk {
  101. max-height: 3em;
  102. }
  103. img[src*="fim.svg"] {
  104. max-height: 10em;
  105. }
  106. img.dotty {
  107. max-height: 7em;
  108. }
  109. img.ultra {
  110. max-height: 12em;
  111. }
  112. img.upcean {
  113. max-height: 12em;
  114. }
  115. h1, h2, h3, h4, h5, h6 {
  116. margin-top: 1.4em;
  117. }
  118. h5, h6 {
  119. font-size: 1em;
  120. font-style: italic;
  121. }
  122. h6 {
  123. font-weight: normal;
  124. }
  125. ol, ul {
  126. padding-left: 1.7em;
  127. margin-top: 1em;
  128. }
  129. li > ol, li > ul {
  130. margin-top: 0;
  131. }
  132. dt {
  133. font-weight:bold;
  134. }
  135. blockquote {
  136. margin: 1em 0 1em 1.7em;
  137. padding-left: 1em;
  138. border-left: 2px solid #e6e6e6;
  139. color: #606060;
  140. }
  141. code {
  142. font-family: Liberation Mono;
  143. font-size: 90%;
  144. margin: 0;
  145. hyphens: manual;
  146. color: #000000;
  147. }
  148. pre {
  149. margin: 1em 0;
  150. overflow: auto;
  151. }
  152. pre code {
  153. padding: 0;
  154. overflow: visible;
  155. overflow-wrap: normal;
  156. }
  157. .sourceCode {
  158. background-color: transparent;
  159. overflow: visible;
  160. }
  161. div.sourceCode {
  162. background-color: #f7f7f7;
  163. padding: 0.3em 0;
  164. }
  165. aside.footnotes {
  166. font-size:90%;
  167. }
  168. hr {
  169. background-color: #1a1a1a;
  170. border: none;
  171. height: 1px;
  172. margin: 1em 0;
  173. }
  174. table {
  175. margin: 0 auto 0.4em auto;
  176. border-collapse: collapse;
  177. overflow-x: auto;
  178. font-variant-numeric: lining-nums tabular-nums;
  179. }
  180. #tbl\:gridmatrix_eccs {
  181. margin-top: 1em;
  182. }
  183. table caption {
  184. margin-bottom: 0.75em;
  185. }
  186. tbody {
  187. margin-top: 0.5em;
  188. border-top: 1px solid #1a1a1a;
  189. border-bottom: 1px solid #1a1a1a;
  190. }
  191. th {
  192. border-top: 1px solid #1a1a1a;
  193. padding: 0.25em 0.5em 0.25em 0.5em;
  194. }
  195. td {
  196. padding: 0.125em 0.5em 0.25em 0.5em;
  197. vertical-align: top;
  198. }
  199. tbody tr:first-child td {
  200. padding-top: 0.5em;
  201. }
  202. thead > tr {
  203. margin-bottom: 4em;
  204. text-align: center;
  205. }
  206. #banner {
  207. text-align: center;
  208. }
  209. #banner img.img_hdr {
  210. height: 7em;
  211. }
  212. #TOC {
  213. font-size: 115%;
  214. }
  215. #TOC li {
  216. list-style: none;
  217. margin-bottom: 0.1em;
  218. margin-top: 0.2em;
  219. }
  220. #TOC ul {
  221. padding-left: 1.3em;
  222. }
  223. #TOC > ul {
  224. padding-left: 0;
  225. }
  226. #TOC > ul > li {
  227. margin-top: 0.5em;
  228. }
  229. #TOC > ul > li > a {
  230. font-weight: bold;
  231. }
  232. #TOC a:not(:hover) {
  233. color: #1a1a1a;
  234. text-decoration: none;
  235. }
  236. dd > p {
  237. margin-bottom:1.5em;
  238. margin-top:0.5em;
  239. }
  240. #exit-status + dl > dt {
  241. float: left;
  242. }
  243. #exit-status + dl > dd {
  244. margin-bottom: 1em;
  245. }
  246. code{white-space: pre-wrap;}
  247. span.smallcaps{font-variant: small-caps;}
  248. div.columns{display: flex; gap: min(4vw, 1.5em);}
  249. div.column{flex: auto; overflow-x: auto;}
  250. div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
  251. /* The extra [class] is a hack that increases specificity enough to
  252. override a similar rule in reveal.js */
  253. ul.task-list[class]{list-style: none;}
  254. ul.task-list li input[type="checkbox"] {
  255. font-size: inherit;
  256. width: 0.8em;
  257. margin: 0 0.8em 0.2em -1.6em;
  258. vertical-align: middle;
  259. }
  260. .display.math{display: block; text-align: center; margin: 0.5rem auto;}
  261. /* CSS for syntax highlighting */
  262. html { -webkit-text-size-adjust: 100%; }
  263. pre > code.sourceCode { white-space: pre; position: relative; }
  264. pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
  265. pre > code.sourceCode > span:empty { height: 1.2em; }
  266. .sourceCode { overflow: visible; }
  267. code.sourceCode > span { color: inherit; text-decoration: inherit; }
  268. div.sourceCode { margin: 1em 0; }
  269. pre.sourceCode { margin: 0; }
  270. @media screen {
  271. div.sourceCode { overflow: auto; }
  272. }
  273. @media print {
  274. pre > code.sourceCode { white-space: pre-wrap; }
  275. pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
  276. }
  277. pre.numberSource code
  278. { counter-reset: source-line 0; }
  279. pre.numberSource code > span
  280. { position: relative; left: -4em; counter-increment: source-line; }
  281. pre.numberSource code > span > a:first-child::before
  282. { content: counter(source-line);
  283. position: relative; left: -1em; text-align: right; vertical-align: baseline;
  284. border: none; display: inline-block;
  285. -webkit-touch-callout: none; -webkit-user-select: none;
  286. -khtml-user-select: none; -moz-user-select: none;
  287. -ms-user-select: none; user-select: none;
  288. padding: 0 4px; width: 4em;
  289. color: #aaaaaa;
  290. }
  291. pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
  292. div.sourceCode
  293. { }
  294. @media screen {
  295. pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
  296. }
  297. code span.al { color: #ff0000; } /* Alert */
  298. code span.an { color: #008000; } /* Annotation */
  299. code span.at { } /* Attribute */
  300. code span.bu { } /* BuiltIn */
  301. code span.cf { color: #0000ff; } /* ControlFlow */
  302. code span.ch { color: #008080; } /* Char */
  303. code span.cn { } /* Constant */
  304. code span.co { color: #008000; } /* Comment */
  305. code span.cv { color: #008000; } /* CommentVar */
  306. code span.do { color: #008000; } /* Documentation */
  307. code span.er { color: #ff0000; font-weight: bold; } /* Error */
  308. code span.ex { } /* Extension */
  309. code span.im { } /* Import */
  310. code span.in { color: #008000; } /* Information */
  311. code span.kw { color: #0000ff; } /* Keyword */
  312. code span.op { } /* Operator */
  313. code span.ot { color: #ff4000; } /* Other */
  314. code span.pp { color: #ff4000; } /* Preprocessor */
  315. code span.sc { color: #008080; } /* SpecialChar */
  316. code span.ss { color: #008080; } /* SpecialString */
  317. code span.st { color: #008080; } /* String */
  318. code span.va { } /* Variable */
  319. code span.vs { color: #008080; } /* VerbatimString */
  320. code span.wa { color: #008000; font-weight: bold; } /* Warning */
  321. </style>
  322. <!--[if lt IE 9]>
  323. <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
  324. <![endif]-->
  325. </head>
  326. <body>
  327. <div id="banner">
  328. <img src="images/zint.png" class="img_hdr">
  329. <img src="images/zint-qt.png" class="img_hdr">
  330. </div>
  331. <header id="title-block-header">
  332. <h1 class="title">Zint Barcode Generator and Zint Barcode Studio User
  333. Manual</h1>
  334. <p class="author">Version 2.13.0.9</p>
  335. <p class="date">December 2024</p>
  336. </header>
  337. <nav id="TOC" role="doc-toc">
  338. <ul>
  339. <li><a href="#introduction" id="toc-introduction">1. Introduction</a>
  340. <ul>
  341. <li><a href="#glossary" id="toc-glossary">1.1 Glossary</a></li>
  342. </ul></li>
  343. <li><a href="#installing-zint" id="toc-installing-zint">2. Installing
  344. Zint</a>
  345. <ul>
  346. <li><a href="#linux" id="toc-linux">2.1 Linux</a></li>
  347. <li><a href="#bsd" id="toc-bsd">2.2 BSD</a></li>
  348. <li><a href="#microsoft-windows" id="toc-microsoft-windows">2.3
  349. Microsoft Windows</a></li>
  350. <li><a href="#apple-macos" id="toc-apple-macos">2.4 Apple macOS</a></li>
  351. <li><a href="#zint-tcl-backend" id="toc-zint-tcl-backend">2.5 Zint Tcl
  352. Backend</a></li>
  353. </ul></li>
  354. <li><a href="#using-zint-barcode-studio"
  355. id="toc-using-zint-barcode-studio">3. Using Zint Barcode Studio</a>
  356. <ul>
  357. <li><a href="#main-window-and-data-tab"
  358. id="toc-main-window-and-data-tab">3.1 Main Window and Data Tab</a></li>
  359. <li><a href="#gs1-composite-groupbox"
  360. id="toc-gs1-composite-groupbox">3.2 GS1 Composite Groupbox</a></li>
  361. <li><a href="#additional-ecidata-segments-groupbox"
  362. id="toc-additional-ecidata-segments-groupbox">3.3 Additional ECI/Data
  363. Segments Groupbox</a></li>
  364. <li><a href="#symbology-specific-groupbox"
  365. id="toc-symbology-specific-groupbox">3.4 Symbology-specific
  366. Groupbox</a></li>
  367. <li><a href="#symbology-specific-tab"
  368. id="toc-symbology-specific-tab">3.5 Symbology-specific Tab</a></li>
  369. <li><a href="#appearance-tab" id="toc-appearance-tab">3.6 Appearance
  370. Tab</a></li>
  371. <li><a href="#data-dialog" id="toc-data-dialog">3.7 Data Dialog</a></li>
  372. <li><a href="#sequence-dialog" id="toc-sequence-dialog">3.8 Sequence
  373. Dialog</a></li>
  374. <li><a href="#export-dialog" id="toc-export-dialog">3.9 Export
  375. Dialog</a></li>
  376. <li><a href="#cli-equivalent-dialog" id="toc-cli-equivalent-dialog">3.10
  377. CLI Equivalent Dialog</a></li>
  378. </ul></li>
  379. <li><a href="#using-the-command-line" id="toc-using-the-command-line">4.
  380. Using the Command Line</a>
  381. <ul>
  382. <li><a href="#inputting-data" id="toc-inputting-data">4.1 Inputting
  383. Data</a></li>
  384. <li><a href="#directing-output" id="toc-directing-output">4.2 Directing
  385. Output</a></li>
  386. <li><a href="#selecting-barcode-type"
  387. id="toc-selecting-barcode-type">4.3 Selecting Barcode Type</a></li>
  388. <li><a href="#adjusting-height" id="toc-adjusting-height">4.4 Adjusting
  389. Height</a></li>
  390. <li><a href="#adjusting-whitespace" id="toc-adjusting-whitespace">4.5
  391. Adjusting Whitespace</a></li>
  392. <li><a href="#adding-boundary-bars-and-boxes"
  393. id="toc-adding-boundary-bars-and-boxes">4.6 Adding Boundary Bars and
  394. Boxes</a></li>
  395. <li><a href="#using-colour" id="toc-using-colour">4.7 Using
  396. Colour</a></li>
  397. <li><a href="#rotating-the-symbol" id="toc-rotating-the-symbol">4.8
  398. Rotating the Symbol</a></li>
  399. <li><a href="#adjusting-image-size-x-dimension"
  400. id="toc-adjusting-image-size-x-dimension">4.9 Adjusting Image Size
  401. (X-dimension)</a>
  402. <ul>
  403. <li><a href="#scaling-by-x-dimension-and-resolution"
  404. id="toc-scaling-by-x-dimension-and-resolution">4.9.1 Scaling by
  405. X-dimension and Resolution</a></li>
  406. <li><a href="#scaling-example" id="toc-scaling-example">4.9.2 Scaling
  407. Example</a></li>
  408. <li><a href="#maxicode-raster-scaling"
  409. id="toc-maxicode-raster-scaling">4.9.3 MaxiCode Raster Scaling</a></li>
  410. </ul></li>
  411. <li><a href="#human-readable-text-hrt-options"
  412. id="toc-human-readable-text-hrt-options">4.10 Human Readable Text (HRT)
  413. Options</a></li>
  414. <li><a href="#input-modes" id="toc-input-modes">4.11 Input Modes</a>
  415. <ul>
  416. <li><a href="#unicode-data-and-gs1-modes"
  417. id="toc-unicode-data-and-gs1-modes">4.11.1 Unicode, Data, and GS1
  418. Modes</a></li>
  419. <li><a href="#input-modes-and-eci" id="toc-input-modes-and-eci">4.11.2
  420. Input Modes and ECI</a>
  421. <ul>
  422. <li><a href="#input-modes-and-eci-example-1"
  423. id="toc-input-modes-and-eci-example-1">4.11.2.1 Input Modes and ECI
  424. Example 1</a></li>
  425. <li><a href="#input-modes-and-eci-example-2"
  426. id="toc-input-modes-and-eci-example-2">4.11.2.2 Input Modes and ECI
  427. Example 2</a></li>
  428. <li><a href="#input-modes-and-eci-example-3"
  429. id="toc-input-modes-and-eci-example-3">4.11.2.3 Input Modes and ECI
  430. Example 3</a></li>
  431. </ul></li>
  432. </ul></li>
  433. <li><a href="#batch-processing" id="toc-batch-processing">4.12 Batch
  434. Processing</a></li>
  435. <li><a href="#direct-output-to-stdout"
  436. id="toc-direct-output-to-stdout">4.13 Direct Output to stdout</a></li>
  437. <li><a href="#automatic-filenames" id="toc-automatic-filenames">4.14
  438. Automatic Filenames</a></li>
  439. <li><a href="#working-with-dots" id="toc-working-with-dots">4.15 Working
  440. with Dots</a></li>
  441. <li><a href="#multiple-segments" id="toc-multiple-segments">4.16
  442. Multiple Segments</a></li>
  443. <li><a href="#structured-append" id="toc-structured-append">4.17
  444. Structured Append</a></li>
  445. <li><a href="#help-options" id="toc-help-options">4.18 Help
  446. Options</a></li>
  447. <li><a href="#other-options" id="toc-other-options">4.19 Other
  448. Options</a></li>
  449. </ul></li>
  450. <li><a href="#using-the-api" id="toc-using-the-api">5. Using the API</a>
  451. <ul>
  452. <li><a href="#creating-and-deleting-symbols"
  453. id="toc-creating-and-deleting-symbols">5.1 Creating and Deleting
  454. Symbols</a></li>
  455. <li><a href="#encoding-and-saving-to-file"
  456. id="toc-encoding-and-saving-to-file">5.2 Encoding and Saving to
  457. File</a></li>
  458. <li><a href="#encoding-and-printing-functions-in-depth"
  459. id="toc-encoding-and-printing-functions-in-depth">5.3 Encoding and
  460. Printing Functions in Depth</a></li>
  461. <li><a href="#buffering-symbols-in-memory-raster"
  462. id="toc-buffering-symbols-in-memory-raster">5.4 Buffering Symbols in
  463. Memory (raster)</a></li>
  464. <li><a href="#buffering-symbols-in-memory-vector"
  465. id="toc-buffering-symbols-in-memory-vector">5.5 Buffering Symbols in
  466. Memory (vector)</a></li>
  467. <li><a href="#buffering-symbols-in-memory-memfile"
  468. id="toc-buffering-symbols-in-memory-memfile">5.6 Buffering Symbols in
  469. Memory (memfile)</a></li>
  470. <li><a href="#setting-options" id="toc-setting-options">5.7 Setting
  471. Options</a></li>
  472. <li><a href="#handling-errors" id="toc-handling-errors">5.8 Handling
  473. Errors</a></li>
  474. <li><a href="#specifying-a-symbology"
  475. id="toc-specifying-a-symbology">5.9 Specifying a Symbology</a></li>
  476. <li><a href="#adjusting-output-options"
  477. id="toc-adjusting-output-options">5.10 Adjusting Output Options</a></li>
  478. <li><a href="#setting-the-input-mode"
  479. id="toc-setting-the-input-mode">5.11 Setting the Input Mode</a></li>
  480. <li><a href="#multiple-segments-1" id="toc-multiple-segments-1">5.12
  481. Multiple Segments</a></li>
  482. <li><a href="#scaling-helpers" id="toc-scaling-helpers">5.13 Scaling
  483. Helpers</a></li>
  484. <li><a href="#verifying-symbology-availability"
  485. id="toc-verifying-symbology-availability">5.14 Verifying Symbology
  486. Availability</a></li>
  487. <li><a href="#checking-symbology-capabilities"
  488. id="toc-checking-symbology-capabilities">5.15 Checking Symbology
  489. Capabilities</a></li>
  490. <li><a href="#zint-version" id="toc-zint-version">5.16 Zint
  491. Version</a></li>
  492. </ul></li>
  493. <li><a href="#types-of-symbology" id="toc-types-of-symbology">6. Types
  494. of Symbology</a>
  495. <ul>
  496. <li><a href="#one-dimensional-symbols"
  497. id="toc-one-dimensional-symbols">6.1 One-Dimensional Symbols</a>
  498. <ul>
  499. <li><a href="#code-11" id="toc-code-11">6.1.1 Code 11</a></li>
  500. <li><a href="#code-2-of-5" id="toc-code-2-of-5">6.1.2 Code 2 of 5</a>
  501. <ul>
  502. <li><a href="#standard-code-2-of-5"
  503. id="toc-standard-code-2-of-5">6.1.2.1 Standard Code 2 of 5</a></li>
  504. <li><a href="#iata-code-2-of-5" id="toc-iata-code-2-of-5">6.1.2.2 IATA
  505. Code 2 of 5</a></li>
  506. <li><a href="#industrial-code-2-of-5"
  507. id="toc-industrial-code-2-of-5">6.1.2.3 Industrial Code 2 of 5</a></li>
  508. <li><a href="#interleaved-code-2-of-5-iso-16390"
  509. id="toc-interleaved-code-2-of-5-iso-16390">6.1.2.4 Interleaved Code 2 of
  510. 5 (ISO 16390)</a></li>
  511. <li><a href="#code-2-of-5-data-logic"
  512. id="toc-code-2-of-5-data-logic">6.1.2.5 Code 2 of 5 Data Logic</a></li>
  513. <li><a href="#itf-14" id="toc-itf-14">6.1.2.6 ITF-14</a></li>
  514. <li><a href="#deutsche-post-leitcode"
  515. id="toc-deutsche-post-leitcode">6.1.2.7 Deutsche Post Leitcode</a></li>
  516. <li><a href="#deutsche-post-identcode"
  517. id="toc-deutsche-post-identcode">6.1.2.8 Deutsche Post
  518. Identcode</a></li>
  519. </ul></li>
  520. <li><a href="#upc-universal-product-code-iso-15420"
  521. id="toc-upc-universal-product-code-iso-15420">6.1.3 UPC (Universal
  522. Product Code) (ISO 15420)</a>
  523. <ul>
  524. <li><a href="#upc-version-a" id="toc-upc-version-a">6.1.3.1 UPC Version
  525. A</a></li>
  526. <li><a href="#upc-version-e" id="toc-upc-version-e">6.1.3.2 UPC Version
  527. E</a></li>
  528. </ul></li>
  529. <li><a href="#ean-european-article-number-iso-15420"
  530. id="toc-ean-european-article-number-iso-15420">6.1.4 EAN (European
  531. Article Number) (ISO 15420)</a>
  532. <ul>
  533. <li><a href="#ean-2-ean-5-ean-8-and-ean-13"
  534. id="toc-ean-2-ean-5-ean-8-and-ean-13">6.1.4.1 EAN-2, EAN-5, EAN-8 and
  535. EAN-13</a></li>
  536. <li><a href="#sbn-isbn-and-isbn-13"
  537. id="toc-sbn-isbn-and-isbn-13">6.1.4.2 SBN, ISBN and ISBN-13</a></li>
  538. </ul></li>
  539. <li><a href="#plessey" id="toc-plessey">6.1.5 Plessey</a>
  540. <ul>
  541. <li><a href="#uk-plessey" id="toc-uk-plessey">6.1.5.1 UK
  542. Plessey</a></li>
  543. <li><a href="#msi-plessey" id="toc-msi-plessey">6.1.5.2 MSI
  544. Plessey</a></li>
  545. </ul></li>
  546. <li><a href="#telepen" id="toc-telepen">6.1.6 Telepen</a>
  547. <ul>
  548. <li><a href="#telepen-alpha" id="toc-telepen-alpha">6.1.6.1 Telepen
  549. Alpha</a></li>
  550. <li><a href="#telepen-numeric" id="toc-telepen-numeric">6.1.6.2 Telepen
  551. Numeric</a></li>
  552. </ul></li>
  553. <li><a href="#code-39" id="toc-code-39">6.1.7 Code 39</a>
  554. <ul>
  555. <li><a href="#standard-code-39-iso-16388"
  556. id="toc-standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO
  557. 16388)</a></li>
  558. <li><a href="#extended-code-39" id="toc-extended-code-39">6.1.7.2
  559. Extended Code 39</a></li>
  560. <li><a href="#code-93" id="toc-code-93">6.1.7.3 Code 93</a></li>
  561. <li><a href="#pzn-pharmazentralnummer"
  562. id="toc-pzn-pharmazentralnummer">6.1.7.4 PZN
  563. (Pharmazentralnummer)</a></li>
  564. <li><a href="#logmars" id="toc-logmars">6.1.7.5 LOGMARS</a></li>
  565. <li><a href="#code-32" id="toc-code-32">6.1.7.6 Code 32</a></li>
  566. <li><a href="#hibc-code-39" id="toc-hibc-code-39">6.1.7.7 HIBC Code
  567. 39</a></li>
  568. <li><a href="#vehicle-identification-number-vin"
  569. id="toc-vehicle-identification-number-vin">6.1.7.8 Vehicle
  570. Identification Number (VIN)</a></li>
  571. </ul></li>
  572. <li><a href="#codabar-en-798" id="toc-codabar-en-798">6.1.8 Codabar (EN
  573. 798)</a></li>
  574. <li><a href="#pharmacode" id="toc-pharmacode">6.1.9 Pharmacode</a></li>
  575. <li><a href="#code-128" id="toc-code-128">6.1.10 Code 128</a>
  576. <ul>
  577. <li><a href="#standard-code-128-iso-15417"
  578. id="toc-standard-code-128-iso-15417">6.1.10.1 Standard Code 128 (ISO
  579. 15417)</a></li>
  580. <li><a href="#code-128-suppress-code-set-c-code-sets-a-and-b-only"
  581. id="toc-code-128-suppress-code-set-c-code-sets-a-and-b-only">6.1.10.2
  582. Code 128 Suppress Code Set C (Code Sets A and B only)</a></li>
  583. <li><a href="#gs1-128" id="toc-gs1-128">6.1.10.3 GS1-128</a></li>
  584. <li><a href="#ean-14" id="toc-ean-14">6.1.10.4 EAN-14</a></li>
  585. <li><a href="#nve-18-sscc-18" id="toc-nve-18-sscc-18">6.1.10.5 NVE-18
  586. (SSCC-18)</a></li>
  587. <li><a href="#hibc-code-128" id="toc-hibc-code-128">6.1.10.6 HIBC Code
  588. 128</a></li>
  589. <li><a href="#dpd-code" id="toc-dpd-code">6.1.10.7 DPD Code</a></li>
  590. <li><a href="#upu-s10" id="toc-upu-s10">6.1.10.8 UPU S10</a></li>
  591. </ul></li>
  592. <li><a href="#gs1-databar-iso-24724"
  593. id="toc-gs1-databar-iso-24724">6.1.11 GS1 DataBar (ISO 24724)</a>
  594. <ul>
  595. <li><a href="#gs1-databar-omnidirectional-and-gs1-databar-truncated"
  596. id="toc-gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1
  597. GS1 DataBar Omnidirectional and GS1 DataBar Truncated</a></li>
  598. <li><a href="#gs1-databar-limited" id="toc-gs1-databar-limited">6.1.11.2
  599. GS1 DataBar Limited</a></li>
  600. <li><a href="#gs1-databar-expanded"
  601. id="toc-gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</a></li>
  602. </ul></li>
  603. <li><a href="#korea-post-barcode" id="toc-korea-post-barcode">6.1.12
  604. Korea Post Barcode</a></li>
  605. <li><a href="#channel-code" id="toc-channel-code">6.1.13 Channel
  606. Code</a></li>
  607. <li><a href="#bc412-semi-t1-95" id="toc-bc412-semi-t1-95">6.1.14 BC412
  608. (SEMI T1-95)</a></li>
  609. </ul></li>
  610. <li><a href="#stacked-symbologies" id="toc-stacked-symbologies">6.2
  611. Stacked Symbologies</a>
  612. <ul>
  613. <li><a href="#basic-symbol-stacking"
  614. id="toc-basic-symbol-stacking">6.2.1 Basic Symbol Stacking</a></li>
  615. <li><a href="#codablock-f" id="toc-codablock-f">6.2.2
  616. Codablock-F</a></li>
  617. <li><a href="#code-16k-en-12323" id="toc-code-16k-en-12323">6.2.3 Code
  618. 16K (EN 12323)</a></li>
  619. <li><a href="#pdf417-iso-15438" id="toc-pdf417-iso-15438">6.2.4 PDF417
  620. (ISO 15438)</a></li>
  621. <li><a href="#compact-pdf417-iso-15438"
  622. id="toc-compact-pdf417-iso-15438">6.2.5 Compact PDF417 (ISO
  623. 15438)</a></li>
  624. <li><a href="#micropdf417-iso-24728"
  625. id="toc-micropdf417-iso-24728">6.2.6 MicroPDF417 (ISO 24728)</a></li>
  626. <li><a href="#gs1-databar-stacked-iso-24724"
  627. id="toc-gs1-databar-stacked-iso-24724">6.2.7 GS1 DataBar Stacked (ISO
  628. 24724)</a>
  629. <ul>
  630. <li><a href="#gs1-databar-stacked" id="toc-gs1-databar-stacked">6.2.7.1
  631. GS1 DataBar Stacked</a></li>
  632. <li><a href="#gs1-databar-stacked-omnidirectional"
  633. id="toc-gs1-databar-stacked-omnidirectional">6.2.7.2 GS1 DataBar Stacked
  634. Omnidirectional</a></li>
  635. <li><a href="#gs1-databar-expanded-stacked"
  636. id="toc-gs1-databar-expanded-stacked">6.2.7.3 GS1 DataBar Expanded
  637. Stacked</a></li>
  638. </ul></li>
  639. <li><a href="#code-49" id="toc-code-49">6.2.8 Code 49</a></li>
  640. </ul></li>
  641. <li><a href="#gs1-composite-symbols-iso-24723"
  642. id="toc-gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO
  643. 24723)</a>
  644. <ul>
  645. <li><a href="#cc-a" id="toc-cc-a">6.3.1 CC-A</a></li>
  646. <li><a href="#cc-b" id="toc-cc-b">6.3.2 CC-B</a></li>
  647. <li><a href="#cc-c" id="toc-cc-c">6.3.3 CC-C</a></li>
  648. </ul></li>
  649. <li><a href="#two-track-symbols" id="toc-two-track-symbols">6.4
  650. Two-Track Symbols</a>
  651. <ul>
  652. <li><a href="#two-track-pharmacode" id="toc-two-track-pharmacode">6.4.1
  653. Two-Track Pharmacode</a></li>
  654. <li><a href="#postnet" id="toc-postnet">6.4.2 POSTNET</a></li>
  655. <li><a href="#planet" id="toc-planet">6.4.3 PLANET</a></li>
  656. <li><a href="#brazilian-cepnet" id="toc-brazilian-cepnet">6.4.4
  657. Brazilian CEPNet</a></li>
  658. <li><a href="#dx-film-edge-barcode" id="toc-dx-film-edge-barcode">6.4.5
  659. DX Film Edge Barcode</a></li>
  660. </ul></li>
  661. <li><a href="#state-postal-codes" id="toc-state-postal-codes">6.5
  662. 4-State Postal Codes</a>
  663. <ul>
  664. <li><a href="#australia-post-4-state-symbols"
  665. id="toc-australia-post-4-state-symbols">6.5.1 Australia Post 4-State
  666. Symbols</a>
  667. <ul>
  668. <li><a href="#customer-barcodes" id="toc-customer-barcodes">6.5.1.1
  669. Customer Barcodes</a></li>
  670. <li><a href="#reply-paid-barcode" id="toc-reply-paid-barcode">6.5.1.2
  671. Reply Paid Barcode</a></li>
  672. <li><a href="#routing-barcode" id="toc-routing-barcode">6.5.1.3 Routing
  673. Barcode</a></li>
  674. <li><a href="#redirect-barcode" id="toc-redirect-barcode">6.5.1.4
  675. Redirect Barcode</a></li>
  676. </ul></li>
  677. <li><a href="#dutch-post-kix-code" id="toc-dutch-post-kix-code">6.5.2
  678. Dutch Post KIX Code</a></li>
  679. <li><a href="#royal-mail-4-state-customer-code-rm4scc"
  680. id="toc-royal-mail-4-state-customer-code-rm4scc">6.5.3 Royal Mail
  681. 4-State Customer Code (RM4SCC)</a></li>
  682. <li><a href="#royal-mail-4-state-mailmark"
  683. id="toc-royal-mail-4-state-mailmark">6.5.4 Royal Mail 4-State
  684. Mailmark</a></li>
  685. <li><a href="#usps-intelligent-mail"
  686. id="toc-usps-intelligent-mail">6.5.5 USPS Intelligent Mail</a></li>
  687. <li><a href="#japanese-postal-code" id="toc-japanese-postal-code">6.5.6
  688. Japanese Postal Code</a></li>
  689. <li><a href="#daft-code" id="toc-daft-code">6.5.7 DAFT Code</a></li>
  690. </ul></li>
  691. <li><a href="#matrix-symbols" id="toc-matrix-symbols">6.6 Matrix
  692. Symbols</a>
  693. <ul>
  694. <li><a href="#data-matrix-iso-16022"
  695. id="toc-data-matrix-iso-16022">6.6.1 Data Matrix (ISO 16022)</a></li>
  696. <li><a href="#royal-mail-2d-mailmark-cmdm-data-matrix"
  697. id="toc-royal-mail-2d-mailmark-cmdm-data-matrix">6.6.2 Royal Mail 2D
  698. Mailmark (CMDM) (Data Matrix)</a></li>
  699. <li><a href="#qr-code-iso-18004" id="toc-qr-code-iso-18004">6.6.3 QR
  700. Code (ISO 18004)</a></li>
  701. <li><a href="#micro-qr-code-iso-18004"
  702. id="toc-micro-qr-code-iso-18004">6.6.4 Micro QR Code (ISO
  703. 18004)</a></li>
  704. <li><a href="#rectangular-micro-qr-code-rmqr-iso-23941"
  705. id="toc-rectangular-micro-qr-code-rmqr-iso-23941">6.6.5 Rectangular
  706. Micro QR Code (rMQR) (ISO 23941)</a></li>
  707. <li><a href="#upnqr-univerzalnega-plačilnega-naloga-qr"
  708. id="toc-upnqr-univerzalnega-plačilnega-naloga-qr">6.6.6 UPNQR
  709. (Univerzalnega Plačilnega Naloga QR)</a></li>
  710. <li><a href="#maxicode-iso-16023" id="toc-maxicode-iso-16023">6.6.7
  711. MaxiCode (ISO 16023)</a></li>
  712. <li><a href="#aztec-code-iso-24778" id="toc-aztec-code-iso-24778">6.6.8
  713. Aztec Code (ISO 24778)</a></li>
  714. <li><a href="#aztec-runes-iso-24778"
  715. id="toc-aztec-runes-iso-24778">6.6.9 Aztec Runes (ISO 24778)</a></li>
  716. <li><a href="#code-one" id="toc-code-one">6.6.10 Code One</a></li>
  717. <li><a href="#grid-matrix" id="toc-grid-matrix">6.6.11 Grid
  718. Matrix</a></li>
  719. <li><a href="#dotcode" id="toc-dotcode">6.6.12 DotCode</a></li>
  720. <li><a href="#han-xin-code-iso-20830"
  721. id="toc-han-xin-code-iso-20830">6.6.13 Han Xin Code (ISO 20830)</a></li>
  722. <li><a href="#ultracode" id="toc-ultracode">6.6.14 Ultracode</a></li>
  723. </ul></li>
  724. <li><a href="#other-barcode-like-markings"
  725. id="toc-other-barcode-like-markings">6.7 Other Barcode-Like Markings</a>
  726. <ul>
  727. <li><a href="#facing-identification-mark-fim"
  728. id="toc-facing-identification-mark-fim">6.7.1 Facing Identification Mark
  729. (FIM)</a></li>
  730. <li><a href="#flattermarken" id="toc-flattermarken">6.7.2
  731. Flattermarken</a></li>
  732. </ul></li>
  733. </ul></li>
  734. <li><a href="#legal-and-version-information"
  735. id="toc-legal-and-version-information">7. Legal and Version
  736. Information</a>
  737. <ul>
  738. <li><a href="#license" id="toc-license">7.1 License</a></li>
  739. <li><a href="#patent-issues" id="toc-patent-issues">7.2 Patent
  740. Issues</a></li>
  741. <li><a href="#version-information" id="toc-version-information">7.3
  742. Version Information</a></li>
  743. <li><a href="#sources-of-information"
  744. id="toc-sources-of-information">7.4 Sources of Information</a></li>
  745. <li><a href="#standards-compliance" id="toc-standards-compliance">7.5
  746. Standards Compliance</a>
  747. <ul>
  748. <li><a href="#symbology-standards" id="toc-symbology-standards">7.5.1
  749. Symbology Standards</a></li>
  750. <li><a href="#general-standards" id="toc-general-standards">7.5.2
  751. General Standards</a></li>
  752. </ul></li>
  753. </ul></li>
  754. <li><a href="#annex-a.-character-encoding"
  755. id="toc-annex-a.-character-encoding">Annex A. Character Encoding</a>
  756. <ul>
  757. <li><a href="#a.1-ascii-standard" id="toc-a.1-ascii-standard">A.1 ASCII
  758. Standard</a></li>
  759. <li><a href="#a.2-latin-alphabet-no.-1-isoiec-8859-1"
  760. id="toc-a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2 Latin Alphabet No. 1
  761. (ISO/IEC 8859-1)</a></li>
  762. </ul></li>
  763. <li><a href="#annex-b.-qt-backend-qzint"
  764. id="toc-annex-b.-qt-backend-qzint">Annex B. Qt Backend QZint</a></li>
  765. <li><a href="#annex-c.-tcl-backend-binding"
  766. id="toc-annex-c.-tcl-backend-binding">Annex C. Tcl Backend
  767. Binding</a></li>
  768. <li><a href="#annex-d.-man-page-zint1"
  769. id="toc-annex-d.-man-page-zint1">Annex D. Man Page ZINT(1)</a><ul>
  770. <li><a href="#name" id="toc-name">NAME</a></li>
  771. <li><a href="#synopsis" id="toc-synopsis">SYNOPSIS</a></li>
  772. <li><a href="#description" id="toc-description">DESCRIPTION</a></li>
  773. <li><a href="#options" id="toc-options">OPTIONS</a></li>
  774. <li><a href="#exit-status" id="toc-exit-status">EXIT STATUS</a></li>
  775. <li><a href="#examples" id="toc-examples">EXAMPLES</a></li>
  776. <li><a href="#bugs" id="toc-bugs">BUGS</a></li>
  777. <li><a href="#see-also" id="toc-see-also">SEE ALSO</a></li>
  778. <li><a href="#conforming-to" id="toc-conforming-to">CONFORMING
  779. TO</a></li>
  780. <li><a href="#copyright" id="toc-copyright">COPYRIGHT</a></li>
  781. <li><a href="#author" id="toc-author">AUTHOR</a></li>
  782. </ul>
  783. </nav>
  784. <h1 id="introduction">1. Introduction</h1>
  785. <p>The Zint project aims to provide a complete cross-platform open
  786. source barcode generating solution. The package currently consists of a
  787. Qt-based GUI, a CLI command line executable and a library with an API to
  788. allow developers access to the capabilities of Zint. It is hoped that
  789. Zint provides a solution which is flexible enough for professional users
  790. while at the same time takes care of as much of the processing as
  791. possible to allow easy translation from input data to barcode image.</p>
  792. <p>The library which forms the main component of the Zint project is
  793. currently able to encode data in over 50 barcode symbologies (types of
  794. barcode), for each of which it is possible to translate that data from
  795. either UTF-8 (Unicode) or a raw 8-bit data stream. The image can be
  796. rendered as a</p>
  797. <ul>
  798. <li>Windows Bitmap (BMP),</li>
  799. <li>Enhanced Metafile Format (EMF),</li>
  800. <li>Encapsulated PostScript (EPS),</li>
  801. <li>Graphics Interchange Format (GIF),</li>
  802. <li>ZSoft Paintbrush (PCX) image,</li>
  803. <li>Portable Network Graphic (PNG) image,</li>
  804. <li>Tagged Image File Format (TIF), or a</li>
  805. <li>Scalable Vector Graphic (SVG).</li>
  806. </ul>
  807. <p>Many options are available for setting the characteristics of the
  808. output image including the size and colour of the image, the amount of
  809. error correction used in the symbol and the orientation of the
  810. image.</p>
  811. <h2 id="glossary">1.1 Glossary</h2>
  812. <p>Some of the words and phrases used in this document are specific to
  813. barcoding, and so a brief explanation is given to help
  814. understanding:</p>
  815. <dl>
  816. <dt>symbol</dt>
  817. <dd>
  818. <p>A symbol is an image which encodes data according to one of the
  819. standards. This encompasses barcodes (linear symbols) as well as any of
  820. the other methods of representing data used in this program.</p>
  821. </dd>
  822. <dt>symbology</dt>
  823. <dd>
  824. <p>A method of encoding data to create a certain type of symbol.</p>
  825. </dd>
  826. <dt>linear</dt>
  827. <dd>
  828. <p>A linear or one-dimensional symbol is one which consists of bars and
  829. spaces, and is what most people associate with the term ‘barcode’.
  830. Examples include Code 128.</p>
  831. </dd>
  832. <dt>stacked</dt>
  833. <dd>
  834. <p>A stacked symbol consists of multiple linear symbols placed one above
  835. another and which together hold the message, usually alongside some
  836. error correction data. Examples include PDF417.</p>
  837. </dd>
  838. <dt>matrix</dt>
  839. <dd>
  840. <p>A matrix symbol is one based on a (usually square) grid of elements
  841. called modules. Examples include Data Matrix, but MaxiCode and DotCode
  842. are also considered matrix symbologies.</p>
  843. </dd>
  844. <dt>composite</dt>
  845. <dd>
  846. <p>A composite symbology is one which is made up of elements which are
  847. both linear and stacked. Those currently supported are made up of a
  848. linear ‘primary’ message above which is printed a stacked component
  849. based on the PDF417 symbology. These symbols also have a separator which
  850. separates the linear and the stacked components. The stacked component
  851. is most often referred to as the 2D (two-dimensional) component.</p>
  852. </dd>
  853. <dt>X-dimension</dt>
  854. <dd>
  855. <p>The X-dimension of a symbol is the size (usually the width) of the
  856. smallest element. For a linear symbology this is the width of the
  857. smallest bar. For matrix symbologies it is the width of the smallest
  858. module (usually a square). Barcode widths and heights are expressed in
  859. X-dimensions. Most linear symbologies can have their height varied
  860. whereas most matrix symbologies have a fixed width-to-height ratio where
  861. the height is determined by the width.</p>
  862. </dd>
  863. <dt>GS1 data</dt>
  864. <dd>
  865. <p>This is a structured way of representing information which consists
  866. of ‘chunks’ of data, each of which starts with an Application Identifier
  867. (AI). The AI identifies what type of information is being encoded.</p>
  868. </dd>
  869. <dt>Reader Initialisation (Programming)</dt>
  870. <dd>
  871. <p>Some symbologies allow a special character to be included which can
  872. be detected by the scanning equipment as signifying that the data is
  873. used to program or change settings in that equipment. This data is
  874. usually not passed on to the software which handles normal input data.
  875. This feature should only be used if you are familiar with the
  876. programming codes relevant to your scanner.</p>
  877. </dd>
  878. <dt>ECI</dt>
  879. <dd>
  880. <p>The Extended Channel Interpretations (ECI) mechanism allows for
  881. multi-language data to be encoded in symbols which would usually support
  882. only Latin-1 (ISO/IEC 8859-1 plus ASCII) characters. This can be useful,
  883. for example, if you need to encode Cyrillic characters, but should be
  884. used with caution as not all scanners support this method.</p>
  885. </dd>
  886. </dl>
  887. <p>Two other concepts that are important are raster and vector.</p>
  888. <dl>
  889. <dt>raster</dt>
  890. <dd>
  891. <p>A low level bitmap representation of an image. BMP, GIF, PCX, PNG and
  892. TIF are raster file formats.</p>
  893. </dd>
  894. <dt>vector</dt>
  895. <dd>
  896. <p>A high level command- or data-based representation of an image. EMF,
  897. EPS and SVG are vector file formats. They require renderers to turn them
  898. into bitmaps.</p>
  899. </dd>
  900. </dl>
  901. <h1 id="installing-zint">2. Installing Zint</h1>
  902. <h2 id="linux">2.1 Linux</h2>
  903. <p>The easiest way to configure compilation is to take advantage of the
  904. CMake utilities. You will need to install CMake and
  905. <code>libpng-dev</code> first. For instance on <code>apt</code>
  906. systems:</p>
  907. <div class="sourceCode" id="cb1"><pre
  908. class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install git cmake build-essential libpng-dev</span></code></pre></div>
  909. <p>If you want to take advantage of Zint Barcode Studio you will also
  910. need to have Qt and its component <code>"Desktop gcc 64-bit"</code>
  911. installed, as well as <code>mesa</code>. For details see
  912. <code>"README.linux"</code> in the project root directory.</p>
  913. <p>Once you have fulfilled these requirements unzip the source code
  914. tarball or clone the latest source</p>
  915. <div class="sourceCode" id="cb2"><pre
  916. class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> clone https://git.code.sf.net/p/zint/code zint</span></code></pre></div>
  917. <p>and follow these steps in the top directory:</p>
  918. <div class="sourceCode" id="cb3"><pre
  919. class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">mkdir</span> build</span>
  920. <span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> build</span>
  921. <span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="fu">cmake</span> ..</span>
  922. <span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span>
  923. <span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> make install</span></code></pre></div>
  924. <p>The CLI command line program can be accessed by typing</p>
  925. <div class="sourceCode" id="cb4"><pre
  926. class="sourceCode bash"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="pp">[</span><span class="ss">options</span><span class="pp">]</span></span></code></pre></div>
  927. <p>The GUI can be accessed by typing</p>
  928. <div class="sourceCode" id="cb5"><pre
  929. class="sourceCode bash"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint-qt</span></span></code></pre></div>
  930. <p>To test that the installation has been successful a shell script is
  931. included in the <code>"frontend"</code> sub-directory. To run the test
  932. type</p>
  933. <div class="sourceCode" id="cb6"><pre
  934. class="sourceCode bash"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./test.sh</span></span></code></pre></div>
  935. <p>This should create numerous files in the sub-directory
  936. <code>"frontend/test_sh_out"</code> showing the many modes of operation
  937. which are available from Zint.</p>
  938. <h2 id="bsd">2.2 BSD</h2>
  939. <p>The latest Zint CLI, <code>libzint</code> library and GUI can be
  940. installed from the <code>zint</code> package on FreeBSD:</p>
  941. <div class="sourceCode" id="cb7"><pre
  942. class="sourceCode bash"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">su</span></span>
  943. <span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg</span> install zint</span>
  944. <span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="bu">exit</span></span></code></pre></div>
  945. <p>and on OpenBSD (where the GUI is in a separate <code>zint-gui</code>
  946. package):</p>
  947. <div class="sourceCode" id="cb8"><pre
  948. class="sourceCode bash"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">su</span></span>
  949. <span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg_add</span> zint zint-gui</span>
  950. <span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="bu">exit</span></span></code></pre></div>
  951. <p>To build from source (including for NetBSD) see
  952. <code>"README.bsd"</code> in the project root directory.</p>
  953. <h2 id="microsoft-windows">2.3 Microsoft Windows</h2>
  954. <p>For Microsoft Windows, Zint is distributed as a binary executable.
  955. Simply download the ZIP file, then right-click on the ZIP file and
  956. <code>"Extract All"</code>. A new folder will be created within which
  957. are two binary files:</p>
  958. <ul>
  959. <li><code>qtZint.exe</code> - Zint Barcode Studio</li>
  960. <li><code>zint.exe</code> - Command Line Interface</li>
  961. </ul>
  962. <p>For fresh releases you will get a warning message from Microsoft
  963. Defender SmartScreen that this is an ‘unrecognised app’. This happens
  964. because Zint is a free and open-source software project with no
  965. advertising and hence no income, meaning we are not able to afford the
  966. $664 per year to have the application digitally signed by Microsoft.</p>
  967. <p>To build Zint on Windows from source, see
  968. <code>"win32/README"</code>.</p>
  969. <h2 id="apple-macos">2.4 Apple macOS</h2>
  970. <p>The latest Zint CLI and <code>libzint</code> can be installed using
  971. Homebrew.<a href="#fn1" class="footnote-ref" id="fnref1"
  972. role="doc-noteref"><sup>1</sup></a> To install Homebrew input the
  973. following line into the macOS terminal</p>
  974. <div class="sourceCode" id="cb9"><pre
  975. class="sourceCode bash"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="ex">/bin/bash</span> <span class="at">-c</span> <span class="st">&quot;</span><span class="va">$(</span><span class="ex">curl</span> <span class="at">-fsSL</span> <span class="dt">\</span></span>
  976. <span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh<span class="va">)</span><span class="st">&quot;</span></span></code></pre></div>
  977. <p>Once Homebrew is installed use the following command to install the
  978. CLI and library</p>
  979. <div class="sourceCode" id="cb10"><pre
  980. class="sourceCode bash"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="ex">brew</span> install zint</span></code></pre></div>
  981. <p>To build from source (and install the GUI) see
  982. <code>"README.macos"</code> in the project root directory.</p>
  983. <h2 id="zint-tcl-backend">2.5 Zint Tcl Backend</h2>
  984. <p>The Tcl backend in the <code>"backend_tcl"</code> sub-directory may
  985. be built using the provided TEA (Tcl Extension Architecture) build on
  986. Linux, Windows, macOS and Android. For Windows, an MSVC6 makefile is
  987. also available. See <a href="#annex-c.-tcl-backend-binding">Annex C. Tcl
  988. Backend Binding</a> for further details.</p>
  989. <h1 id="using-zint-barcode-studio">3. Using Zint Barcode Studio</h1>
  990. <p>Zint Barcode Studio is the graphical user interface for Zint. If you
  991. are starting from a command line interface you can start the GUI by
  992. typing</p>
  993. <div class="sourceCode" id="cb11"><pre
  994. class="sourceCode bash"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint-qt</span></span></code></pre></div>
  995. <p>or on Windows</p>
  996. <div class="sourceCode" id="cb12"><pre
  997. class="sourceCode bash"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">qtZint.exe</span></span></code></pre></div>
  998. <p>See the note in section <a href="#microsoft-windows">2.3 Microsoft
  999. Windows</a> about Microsoft Defender SmartScreen.</p>
  1000. <p>Below is a brief guide to Zint Barcode Studio.</p>
  1001. <h2 id="main-window-and-data-tab">3.1 Main Window and Data Tab</h2>
  1002. <figure>
  1003. <img src="images/gui_main.png" title="fig:" class="win"
  1004. alt="Zint Barcode Studio on startup - main window with Data tab" />
  1005. <figcaption aria-hidden="true">Zint Barcode Studio on startup - main
  1006. window with Data tab</figcaption>
  1007. </figure>
  1008. <p>This is the main window of Zint Barcode Studio. The top of the window
  1009. shows a preview of the barcode that the current settings would create.
  1010. These settings can be changed using the controls below. The text box in
  1011. the <code>"Data to Encode"</code> groupbox on this first Data tab allows
  1012. you to enter the data to be encoded. When you are happy with your
  1013. settings you can use the <code>"Save..."</code> button to save the
  1014. resulting image to a file.</p>
  1015. <p>The <code>"Symbology"</code> drop-down box gives access to all of the
  1016. symbologies supported by Zint shown in alphabetical order. The text box
  1017. to its right can filter the drop-down to only show matching symbologies.
  1018. For instance typing <code>"mail"</code> will only show barcodes in the
  1019. drop-down whose names contain the word <code>"mail"</code>. Each word
  1020. entered will match. So typing <code>"mail post"</code> will show
  1021. barcodes whose names contain <code>"mail"</code> or <code>"post"</code>
  1022. (or both).</p>
  1023. <p>The ellipsis button <code>"..."</code> to the right of the data text
  1024. box invokes the Data Dialog - see <a href="#data-dialog">3.7 Data
  1025. Dialog</a> for details. The delete button <img
  1026. src="images/gui_delete.png" class="btn" alt="delete" /> next to it will
  1027. clear the data text box and the ECI (Extended Channel Interpretations)
  1028. drop-down if set.</p>
  1029. <p>To set the barcode as a Programming Initialisation symbol click the
  1030. <code>"Reader Init"</code> checkbox. The <code>"1234.."</code> button to
  1031. its right invokes the Sequence Dialog - see <a
  1032. href="#sequence-dialog">3.8 Sequence Dialog</a>. The zap button <img
  1033. src="images/gui_zap.png" class="btn" alt="zap" /> will clear all data
  1034. and reset all settings for the barcode to defaults.</p>
  1035. <p>The <code>"BMP"</code> and <code>"SVG"</code> buttons at the bottom
  1036. will copy the image to the clipboard in BMP format and SVG format
  1037. respectively. Further copy-to-clipboard formats are available by
  1038. clicking the <code>"Menu"</code> button, along with
  1039. <code>"CLI Equivalent..."</code>, <code>"Save As..."</code>,
  1040. <code>"Factory Reset..."</code>, <code>"Help"</code>,
  1041. <code>"About..."</code> and <code>"Quit"</code> options. Most of the
  1042. options are also available in a context menu by right-clicking the
  1043. preview.</p>
  1044. <figure>
  1045. <img src="images/gui_menus.png" title="fig:" class="win"
  1046. alt="Zint Barcode Studio main menu (left) and context menu (right)" />
  1047. <figcaption aria-hidden="true">Zint Barcode Studio main menu (left) and
  1048. context menu (right)</figcaption>
  1049. </figure>
  1050. <h2 id="gs1-composite-groupbox">3.2 GS1 Composite Groupbox</h2>
  1051. <figure>
  1052. <img src="images/gui_composite.png" title="fig:" class="win"
  1053. alt="Zint Barcode Studio encoding GS1 Composite data" />
  1054. <figcaption aria-hidden="true">Zint Barcode Studio encoding GS1
  1055. Composite data</figcaption>
  1056. </figure>
  1057. <p>In the middle of the Data tab is an area for creating composite
  1058. symbologies which appears when the currently selected symbology is
  1059. supported by the GS1 Composite symbology standard. GS1 data can then be
  1060. entered with square brackets used to separate Application Identifier
  1061. (AI) information from data as shown here. For details, see <a
  1062. href="#gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO
  1063. 24723)</a>.</p>
  1064. <h2 id="additional-ecidata-segments-groupbox">3.3 Additional ECI/Data
  1065. Segments Groupbox</h2>
  1066. <figure>
  1067. <img src="images/gui_segs.png" title="fig:" class="win"
  1068. alt="Zint Barcode Studio encoding multiple segments" />
  1069. <figcaption aria-hidden="true">Zint Barcode Studio encoding multiple
  1070. segments</figcaption>
  1071. </figure>
  1072. <p>For symbologies that support ECIs (Extended Channel Interpretations)
  1073. the middle of the Data tab is an area for entering additional data
  1074. segments with their own ECIs. Up to 4 segments (including the main
  1075. <code>"Data to Encode"</code> as segment 0) may be specified. See <a
  1076. href="#multiple-segments">4.16 Multiple Segments</a> for details.</p>
  1077. <h2 id="symbology-specific-groupbox">3.4 Symbology-specific
  1078. Groupbox</h2>
  1079. <figure>
  1080. <img src="images/gui_c25inter.png" title="fig:" class="win"
  1081. alt="Zint Barcode Studio showing Code 2 of 5 Interleaved settings" />
  1082. <figcaption aria-hidden="true">Zint Barcode Studio showing Code 2 of 5
  1083. Interleaved settings</figcaption>
  1084. </figure>
  1085. <p>Many symbologies have extra options to change the content, format and
  1086. appearance of the symbol generated. For those with few additional
  1087. options (and no support for GS1 data or ECIs), the middle of the Data
  1088. tab is an area for setting those options.</p>
  1089. <p>Here is shown the check digit options for an Interleaved Code 2 of 5
  1090. symbol (see <a href="#interleaved-code-2-of-5-iso-16390">6.1.2.4
  1091. Interleaved Code 2 of 5 (ISO 16390)</a>).</p>
  1092. <p>Symbologies with more than a few options (or support for GS1 data or
  1093. ECIs) have a second Symbology-specific tab, shown next.</p>
  1094. <h2 id="symbology-specific-tab">3.5 Symbology-specific Tab</h2>
  1095. <figure>
  1096. <img src="images/gui_aztec.png" title="fig:" class="win"
  1097. alt="Zint Barcode Studio showing Aztec Code options" />
  1098. <figcaption aria-hidden="true">Zint Barcode Studio showing Aztec Code
  1099. options</figcaption>
  1100. </figure>
  1101. <p>A second tab appears for those symbologies with more than a few extra
  1102. options.</p>
  1103. <p>Here is shown the options available for an Aztec Code symbol.</p>
  1104. <p>You can adjust its size or error correction level (see <a
  1105. href="#aztec-code-iso-24778">6.6.8 Aztec Code (ISO 24778)</a>), select
  1106. how its data is to be treated (see <a href="#input-modes">4.11 Input
  1107. Modes</a>), and set it as part of a Structured Append sequence of
  1108. symbols (see <a href="#structured-append">4.17 Structured
  1109. Append</a>).</p>
  1110. <h2 id="appearance-tab">3.6 Appearance Tab</h2>
  1111. <figure>
  1112. <img src="images/gui_appearance.png" title="fig:" class="win"
  1113. alt="Zint Barcode Studio showing Appearance tab options" />
  1114. <figcaption aria-hidden="true">Zint Barcode Studio showing Appearance
  1115. tab options</figcaption>
  1116. </figure>
  1117. <p>The Appearance tab can be used to adjust the dimensions and other
  1118. properties of the symbol.</p>
  1119. <p>The <code>"Height"</code> value affects the height of symbologies
  1120. which do not have a fixed width-to-height ratio, i.e. those other than
  1121. matrix symbologies. For such symbologies the
  1122. <code>"Automatic Height"</code> checkbox will be enabled - uncheck this
  1123. to manually adjust the height. The <code>"Compliant Height"</code>
  1124. checkbox applies to symbologies that define a standard height - see <a
  1125. href="#adjusting-height">4.4 Adjusting Height</a>.</p>
  1126. <p>Boundary bars can be added with the <code>"Border Type"</code>
  1127. drop-down and their size adjusted with <code>"Border Width"</code>, and
  1128. whitespace can be adjusted both horizontally (first spinbox) and
  1129. vertically (second spinbox), and also through the
  1130. <code>"Quiet Zones"</code> checkbox if standard quiet zones are defined
  1131. for the symbology.</p>
  1132. <p>The size of the saved image can be specified with
  1133. <code>"Printing Scale"</code>, and also by clicking the <img
  1134. src="images/gui_scaling.png" class="btn" alt="scaling" /> icon to invoke
  1135. the Set Printing Scale Dialog - see <a
  1136. href="#adjusting-image-size-x-dimension">4.9 Adjusting Image Size
  1137. (X-dimension)</a> for further details.</p>
  1138. <figure>
  1139. <img src="images/gui_set_printing_scale.png" title="fig:" class="pop"
  1140. alt="Adjusting the Print Size" />
  1141. <figcaption aria-hidden="true">Adjusting the Print Size</figcaption>
  1142. </figure>
  1143. <p>The foreground and background colours can be set either using the
  1144. text boxes which accept <code>"RRGGBBAA"</code> hexadecimal values and
  1145. <code>"C,M,Y,K"</code> decimal percentage values, or by clicking the
  1146. foreground eye <img src="images/gui_black_eye.png" class="btn"
  1147. alt="eye" /> and background eye <img src="images/gui_white_eye.png"
  1148. class="btn" alt="eye" /> buttons which invoke a colour picker.</p>
  1149. <figure>
  1150. <img src="images/gui_colour.png" title="fig:" class="pop"
  1151. alt="The colour picker tool" />
  1152. <figcaption aria-hidden="true">The colour picker tool</figcaption>
  1153. </figure>
  1154. <p>(Note that to change the colours visually, the luminence slider, the
  1155. long narrow column on the right, must be adjusted.) The color picker
  1156. only deals in RGB(A), and will overwrite any CMYK values with RGB(A)
  1157. values once <code>"OK"</code> is selected.</p>
  1158. <p>Back in the Appearance tab, the colours can be reset to
  1159. black-on-white using the <code>"Reset"</code> button, and exchanged one
  1160. for the other using the swap <img src="images/gui_swap.png" class="btn"
  1161. alt="swap" /> button next to it.</p>
  1162. <h2 id="data-dialog">3.7 Data Dialog</h2>
  1163. <figure>
  1164. <img src="images/gui_data_dialog.png" title="fig:" class="pop"
  1165. alt="Entering longer text input" />
  1166. <figcaption aria-hidden="true">Entering longer text input</figcaption>
  1167. </figure>
  1168. <p>Clicking on the ellipsis <code>"..."</code> button next to the
  1169. <code>"Data to Encode"</code> text box in the Data tab opens a larger
  1170. window which can be used to enter longer strings of text. You can also
  1171. use this window to load data from a file.</p>
  1172. <p>The dialog is also available for additional ECI/Data segments by
  1173. clicking the ellipsis button to the right of their data text boxes.</p>
  1174. <p>Note that if your data contains line feeds (<code>LF</code>) then the
  1175. data will be split into separate lines in the dialog box. On saving the
  1176. data back to the main text box any separate lines in the data will be
  1177. escaped as <code>'\n'</code> and the <code>"Parse Escapes"</code>
  1178. checkbox will be set. This only affects line feeds, not carriage returns
  1179. (<code>CR</code>) or <code>CR+LF</code> pairs, and behaves the same on
  1180. both Windows and Unix. (For details on escape sequences, see <a
  1181. href="#inputting-data">4.1 Inputting Data</a>.)</p>
  1182. <h2 id="sequence-dialog">3.8 Sequence Dialog</h2>
  1183. <figure>
  1184. <img src="images/gui_sequence.png" title="fig:" class="pop"
  1185. alt="Creating a sequence of barcode symbols" />
  1186. <figcaption aria-hidden="true">Creating a sequence of barcode
  1187. symbols</figcaption>
  1188. </figure>
  1189. <p>Clicking on the sequence button (labelled <code>"1234.."</code>) in
  1190. the Data tab opens the Sequence Dialog. This allows you to create
  1191. multiple barcode images by entering a sequence of data inputs in the
  1192. right hand panel. Sequences can also be automatically generated by
  1193. entering parameters on the left hand side or by importing the data from
  1194. a file. Zint will generate a separate barcode image for each line of
  1195. text in the right hand panel. The format field determines the format of
  1196. the automatically generated sequence where characters have the meanings
  1197. as given below:</p>
  1198. <div id="tbl:sequence_format_characters" class="tablenos">
  1199. <table id="tbl:sequence_format_characters"
  1200. data-tag=": Sequence Format Characters">
  1201. <caption><span>Table : Sequence Format Characters</span> </caption>
  1202. <thead>
  1203. <tr>
  1204. <th style="text-align: left;">Character</th>
  1205. <th style="text-align: left;">Effect</th>
  1206. </tr>
  1207. </thead>
  1208. <tbody>
  1209. <tr>
  1210. <td style="text-align: left;"><code>$</code></td>
  1211. <td style="text-align: left;">Insert leading zeroes</td>
  1212. </tr>
  1213. <tr>
  1214. <td style="text-align: left;"><code>#</code></td>
  1215. <td style="text-align: left;">Insert leading spaces</td>
  1216. </tr>
  1217. <tr>
  1218. <td style="text-align: left;"><code>*</code></td>
  1219. <td style="text-align: left;">Insert leading asterisks</td>
  1220. </tr>
  1221. <tr>
  1222. <td style="text-align: left;">Any other character</td>
  1223. <td style="text-align: left;">Interpreted literally</td>
  1224. </tr>
  1225. </tbody>
  1226. </table>
  1227. </div>
  1228. <p>Once you’re happy with the Sequence Data, click the
  1229. <code>"Export..."</code> button to bring up the Export Dialog, discussed
  1230. next.</p>
  1231. <h2 id="export-dialog">3.9 Export Dialog</h2>
  1232. <figure>
  1233. <img src="images/gui_export.png" title="fig:" class="pop"
  1234. alt="Setting filenames for an exported sequence of barcode symbols" />
  1235. <figcaption aria-hidden="true">Setting filenames for an exported
  1236. sequence of barcode symbols</figcaption>
  1237. </figure>
  1238. <p>The Export Dialog invoked by pressing the <code>"Export..."</code>
  1239. button in the Sequence Dialog sets the parameters for exporting the
  1240. sequence of barcode images. Here you can set the output directory, the
  1241. format of the output filenames and what their image type will be. Note
  1242. that the symbology, colour and other formatting information are taken
  1243. from the main window.</p>
  1244. <h2 id="cli-equivalent-dialog">3.10 CLI Equivalent Dialog</h2>
  1245. <figure>
  1246. <img src="images/gui_cli_equivalent.png" title="fig:" class="pop"
  1247. alt="CLI Equivalent Dialog" />
  1248. <figcaption aria-hidden="true">CLI Equivalent Dialog</figcaption>
  1249. </figure>
  1250. <p>The CLI Equivalent Dialog can be invoked from the main menu or the
  1251. context menu and displays the CLI command that will reproduce the
  1252. barcode as currently configured in the GUI. Press the
  1253. <code>"Copy"</code> button to copy the command to the clipboard, which
  1254. can then be pasted into the command line.</p>
  1255. <h1 id="using-the-command-line">4. Using the Command Line</h1>
  1256. <p>This section describes how to encode data using the command line
  1257. frontend (CLI) program. The examples given are for the Unix platform,
  1258. but the same options are available for Windows - just remember to
  1259. include the executable file extension if <code>".EXE"</code> is not in
  1260. your <code>PATHEXT</code> environment variable, i.e.:</p>
  1261. <div class="sourceCode" id="cb13"><pre
  1262. class="sourceCode bash"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint.exe</span> <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  1263. <p>For compatibility with Windows the examples use double quotes to
  1264. delimit data, though on Unix single quotes are generally preferable as
  1265. they stop the shell from processing any characters such as backslash or
  1266. dollar. A single quote itself is dealt with by terminating the
  1267. single-quoted text, backslashing the single quote, and then
  1268. continuing:</p>
  1269. <div class="sourceCode" id="cb14"><pre
  1270. class="sourceCode bash"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&#39;Text containing a single quote &#39;</span><span class="dt">\&#39;</span><span class="st">&#39; in the middle&#39;</span></span></code></pre></div>
  1271. <p>Some examples use backslash (<code>\</code>) to continue commands
  1272. onto the next line. For Windows, use caret (<code>^</code>) instead.</p>
  1273. <p>Certain options that take values have short names as well as long
  1274. ones, namely <code>-b</code> (<code>--barcode</code>), <code>-d</code>
  1275. (<code>--data</code>), <code>-i</code> (<code>--input</code>),
  1276. <code>-o</code> (<code>--output</code>) and <code>-w</code>
  1277. (<code>--whitesp</code>). For these a space should be used to separate
  1278. the short name from its value, to avoid ambiguity. For long names a
  1279. space or an equals sign may be used. For instance:</p>
  1280. <div class="sourceCode" id="cb15"><pre
  1281. class="sourceCode bash"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span>
  1282. <span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--data</span><span class="op">=</span><span class="st">&quot;This Text&quot;</span></span>
  1283. <span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--data</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  1284. <p>The examples use a space separator for short option names, and an
  1285. equals sign for long option names.</p>
  1286. <h2 id="inputting-data">4.1 Inputting Data</h2>
  1287. <p>The data to encode can be entered at the command line using the
  1288. <code>-d</code> or <code>--data</code> option, for example</p>
  1289. <div class="sourceCode" id="cb16"><pre
  1290. class="sourceCode bash"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  1291. <p>This will encode the text <code>"This Text"</code>. Zint will use the
  1292. default symbology, Code 128, and output to the default file
  1293. <code>"out.png"</code> in the current directory. Alternatively, if
  1294. <code>libpng</code> was not present when Zint was built, the default
  1295. output file will be <code>"out.gif"</code>.</p>
  1296. <p>The data input to the Zint CLI is assumed to be encoded in UTF-8
  1297. (Unicode) format (Zint will correctly handle UTF-8 data on Windows). If
  1298. you are encoding characters beyond the 7-bit ASCII set using a scheme
  1299. other than UTF-8 then you will need to set the appropriate input options
  1300. as shown in <a href="#input-modes">4.11 Input Modes</a> below.</p>
  1301. <p>Non-printing characters can be entered on the command line using
  1302. backslash (<code>\</code>) as an escape character in combination with
  1303. the <code>--esc</code> switch. Permissible sequences are shown in the
  1304. table below.</p>
  1305. <div id="tbl:escape_sequences" class="tablenos">
  1306. <table id="tbl:escape_sequences" data-tag=": Escape Sequences">
  1307. <caption><span>Table : Escape Sequences</span> </caption>
  1308. <colgroup>
  1309. <col style="width: 15%" />
  1310. <col style="width: 15%" />
  1311. <col style="width: 10%" />
  1312. <col style="width: 57%" />
  1313. </colgroup>
  1314. <thead>
  1315. <tr>
  1316. <th style="text-align: left;">Escape Sequence</th>
  1317. <th style="text-align: left;">ASCII Equivalent</th>
  1318. <th style="text-align: left;">Name</th>
  1319. <th style="text-align: left;">Interpretation</th>
  1320. </tr>
  1321. </thead>
  1322. <tbody>
  1323. <tr>
  1324. <td style="text-align: left;"><code>\0</code></td>
  1325. <td style="text-align: left;">0x00</td>
  1326. <td style="text-align: left;"><code>NUL</code></td>
  1327. <td style="text-align: left;">Null character</td>
  1328. </tr>
  1329. <tr>
  1330. <td style="text-align: left;"><code>\E</code></td>
  1331. <td style="text-align: left;">0x04</td>
  1332. <td style="text-align: left;"><code>EOT</code></td>
  1333. <td style="text-align: left;">End of Transmission</td>
  1334. </tr>
  1335. <tr>
  1336. <td style="text-align: left;"><code>\a</code></td>
  1337. <td style="text-align: left;">0x07</td>
  1338. <td style="text-align: left;"><code>BEL</code></td>
  1339. <td style="text-align: left;">Bell</td>
  1340. </tr>
  1341. <tr>
  1342. <td style="text-align: left;"><code>\b</code></td>
  1343. <td style="text-align: left;">0x08</td>
  1344. <td style="text-align: left;"><code>BS</code></td>
  1345. <td style="text-align: left;">Backspace</td>
  1346. </tr>
  1347. <tr>
  1348. <td style="text-align: left;"><code>\t</code></td>
  1349. <td style="text-align: left;">0x09</td>
  1350. <td style="text-align: left;"><code>HT</code></td>
  1351. <td style="text-align: left;">Horizontal Tab</td>
  1352. </tr>
  1353. <tr>
  1354. <td style="text-align: left;"><code>\n</code></td>
  1355. <td style="text-align: left;">0x0A</td>
  1356. <td style="text-align: left;"><code>LF</code></td>
  1357. <td style="text-align: left;">Line Feed</td>
  1358. </tr>
  1359. <tr>
  1360. <td style="text-align: left;"><code>\v</code></td>
  1361. <td style="text-align: left;">0x0B</td>
  1362. <td style="text-align: left;"><code>VT</code></td>
  1363. <td style="text-align: left;">Vertical Tab</td>
  1364. </tr>
  1365. <tr>
  1366. <td style="text-align: left;"><code>\f</code></td>
  1367. <td style="text-align: left;">0x0C</td>
  1368. <td style="text-align: left;"><code>FF</code></td>
  1369. <td style="text-align: left;">Form Feed</td>
  1370. </tr>
  1371. <tr>
  1372. <td style="text-align: left;"><code>\r</code></td>
  1373. <td style="text-align: left;">0x0D</td>
  1374. <td style="text-align: left;"><code>CR</code></td>
  1375. <td style="text-align: left;">Carriage Return</td>
  1376. </tr>
  1377. <tr>
  1378. <td style="text-align: left;"><code>\e</code></td>
  1379. <td style="text-align: left;">0x1B</td>
  1380. <td style="text-align: left;"><code>ESC</code></td>
  1381. <td style="text-align: left;">Escape</td>
  1382. </tr>
  1383. <tr>
  1384. <td style="text-align: left;"><code>\G</code></td>
  1385. <td style="text-align: left;">0x1D</td>
  1386. <td style="text-align: left;"><code>GS</code></td>
  1387. <td style="text-align: left;">Group Separator</td>
  1388. </tr>
  1389. <tr>
  1390. <td style="text-align: left;"><code>\R</code></td>
  1391. <td style="text-align: left;">0x1E</td>
  1392. <td style="text-align: left;"><code>RS</code></td>
  1393. <td style="text-align: left;">Record Separator</td>
  1394. </tr>
  1395. <tr>
  1396. <td style="text-align: left;"><code>\\</code></td>
  1397. <td style="text-align: left;">0x5C</td>
  1398. <td style="text-align: left;"><code>\</code></td>
  1399. <td style="text-align: left;">Backslash</td>
  1400. </tr>
  1401. <tr>
  1402. <td style="text-align: left;"><code>\dNNN</code></td>
  1403. <td style="text-align: left;">NNN</td>
  1404. <td style="text-align: left;"></td>
  1405. <td style="text-align: left;">Any 8-bit character where NNN is decimal
  1406. (000-255)</td>
  1407. </tr>
  1408. <tr>
  1409. <td style="text-align: left;"><code>\oNNN</code></td>
  1410. <td style="text-align: left;">0oNNN</td>
  1411. <td style="text-align: left;"></td>
  1412. <td style="text-align: left;">Any 8-bit character where NNN is octal
  1413. (000-377)</td>
  1414. </tr>
  1415. <tr>
  1416. <td style="text-align: left;"><code>\xNN</code></td>
  1417. <td style="text-align: left;">0xNN</td>
  1418. <td style="text-align: left;"></td>
  1419. <td style="text-align: left;">Any 8-bit character where NN is
  1420. hexadecimal (00-FF)</td>
  1421. </tr>
  1422. <tr>
  1423. <td style="text-align: left;"><code>\uNNNN</code></td>
  1424. <td style="text-align: left;"></td>
  1425. <td style="text-align: left;"></td>
  1426. <td style="text-align: left;">Any 16-bit Unicode BMP<a href="#fn2"
  1427. class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a>
  1428. character where NNNN is hexadecimal (0000-FFFF)</td>
  1429. </tr>
  1430. <tr>
  1431. <td style="text-align: left;"><code>\UNNNNNN</code></td>
  1432. <td style="text-align: left;"></td>
  1433. <td style="text-align: left;"></td>
  1434. <td style="text-align: left;">Any 21-bit Unicode character where NNNNNN
  1435. is hexadecimal (000000-10FFFF)</td>
  1436. </tr>
  1437. </tbody>
  1438. </table>
  1439. </div>
  1440. <p>(Special escape sequences are available for Code 128 only to manually
  1441. switch Code Sets and insert special FNC1 characters - see <a
  1442. href="#standard-code-128-iso-15417">6.1.10.1 Standard Code 128 (ISO
  1443. 15417)</a> for details.)</p>
  1444. <p>Input data can be read directly from file using the <code>-i</code>
  1445. or <code>--input</code> switch as shown below. The input file is assumed
  1446. to be UTF-8 formatted unless an alternative mode is selected. This
  1447. option replaces the use of the <code>-d</code> switch.</p>
  1448. <div class="sourceCode" id="cb17"><pre
  1449. class="sourceCode bash"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-i</span> somefile.txt</span></code></pre></div>
  1450. <p>To read from stdin specify a single hyphen <code>"-"</code> as the
  1451. input file.</p>
  1452. <p>Note that except when batch processing (see <a
  1453. href="#batch-processing">4.12 Batch Processing</a> below), the file (or
  1454. stdin) should not end with a newline (<code>LF</code> on Unix,
  1455. <code>CR+LF</code> on Windows) unless you want the newline to be encoded
  1456. in the symbol.</p>
  1457. <h2 id="directing-output">4.2 Directing Output</h2>
  1458. <p>Output can be directed to a file other than the default using the
  1459. <code>-o</code> or <code>--output</code> switch. For example:</p>
  1460. <div class="sourceCode" id="cb18"><pre
  1461. class="sourceCode bash"><code class="sourceCode bash"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> here.png <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  1462. <p>This draws a Code 128 barcode in the file <code>"here.png"</code>. If
  1463. an Encapsulated PostScript file is needed simply append the filename
  1464. with <code>".eps"</code>, and so on for the other supported file
  1465. types:</p>
  1466. <div class="sourceCode" id="cb19"><pre
  1467. class="sourceCode bash"><code class="sourceCode bash"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> there.eps <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  1468. <p>The currently supported output file formats are shown in the
  1469. following table.</p>
  1470. <div id="tbl:output_file_formats" class="tablenos">
  1471. <table id="tbl:output_file_formats" data-tag=": Output File Formats">
  1472. <caption><span>Table : Output File Formats</span> </caption>
  1473. <thead>
  1474. <tr>
  1475. <th>Extension</th>
  1476. <th style="text-align: left;">File format</th>
  1477. </tr>
  1478. </thead>
  1479. <tbody>
  1480. <tr>
  1481. <td>bmp</td>
  1482. <td style="text-align: left;">Windows Bitmap</td>
  1483. </tr>
  1484. <tr>
  1485. <td>emf</td>
  1486. <td style="text-align: left;">Enhanced Metafile Format</td>
  1487. </tr>
  1488. <tr>
  1489. <td>eps</td>
  1490. <td style="text-align: left;">Encapsulated PostScript</td>
  1491. </tr>
  1492. <tr>
  1493. <td>gif</td>
  1494. <td style="text-align: left;">Graphics Interchange Format</td>
  1495. </tr>
  1496. <tr>
  1497. <td>pcx</td>
  1498. <td style="text-align: left;">ZSoft Paintbrush image</td>
  1499. </tr>
  1500. <tr>
  1501. <td>png</td>
  1502. <td style="text-align: left;">Portable Network Graphic</td>
  1503. </tr>
  1504. <tr>
  1505. <td>svg</td>
  1506. <td style="text-align: left;">Scalable Vector Graphic</td>
  1507. </tr>
  1508. <tr>
  1509. <td>tif</td>
  1510. <td style="text-align: left;">Tagged Image File Format</td>
  1511. </tr>
  1512. <tr>
  1513. <td>txt</td>
  1514. <td style="text-align: left;">Text file (see <a
  1515. href="#other-options">4.19 Other Options</a>)</td>
  1516. </tr>
  1517. </tbody>
  1518. </table>
  1519. </div>
  1520. <p>The filename can contain directories and sub-directories also, which
  1521. will be created if they don’t already exist:</p>
  1522. <div class="sourceCode" id="cb20"><pre
  1523. class="sourceCode bash"><code class="sourceCode bash"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> <span class="st">&quot;dir/subdir/filename.eps&quot;</span> <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  1524. <p>Note that on Windows, filenames are assumed to be UTF-8 encoded.</p>
  1525. <h2 id="selecting-barcode-type">4.3 Selecting Barcode Type</h2>
  1526. <p>Selecting which type of barcode you wish to produce (i.e. which
  1527. symbology to use) can be done at the command line using the
  1528. <code>-b</code> or <code>--barcode</code> switch followed by the
  1529. appropriate integer value or name in the following table. For example to
  1530. create a Data Matrix symbol you could use:</p>
  1531. <div class="sourceCode" id="cb21"><pre
  1532. class="sourceCode bash"><code class="sourceCode bash"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">-o</span> datamatrix.png <span class="at">-d</span> <span class="st">&quot;Data to encode&quot;</span></span></code></pre></div>
  1533. <p>or</p>
  1534. <div class="sourceCode" id="cb22"><pre
  1535. class="sourceCode bash"><code class="sourceCode bash"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> DATAMATRIX <span class="at">-o</span> datamatrix.png <span class="at">-d</span> <span class="st">&quot;Data to encode&quot;</span></span></code></pre></div>
  1536. <p>Names are treated case-insensitively by the CLI, and the
  1537. <code>BARCODE_</code> prefix and any underscores are optional.</p>
  1538. <div id="tbl:barcode_types" class="tablenos">
  1539. <table id="tbl:barcode_types" data-tag=": Barcode Types (Symbologies)">
  1540. <caption><span>Table : Barcode Types (Symbologies)</span> </caption>
  1541. <colgroup>
  1542. <col style="width: 11%" />
  1543. <col style="width: 33%" />
  1544. <col style="width: 55%" />
  1545. </colgroup>
  1546. <thead>
  1547. <tr>
  1548. <th style="text-align: left;">Numeric Value</th>
  1549. <th style="text-align: left;">Name<a href="#fn3" class="footnote-ref"
  1550. id="fnref3" role="doc-noteref"><sup>3</sup></a></th>
  1551. <th style="text-align: left;">Barcode Name</th>
  1552. </tr>
  1553. </thead>
  1554. <tbody>
  1555. <tr>
  1556. <td style="text-align: left;">1</td>
  1557. <td style="text-align: left;"><code>BARCODE_CODE11</code></td>
  1558. <td style="text-align: left;">Code 11</td>
  1559. </tr>
  1560. <tr>
  1561. <td style="text-align: left;">2<code>*</code></td>
  1562. <td style="text-align: left;"><code>BARCODE_C25STANDARD</code></td>
  1563. <td style="text-align: left;">Standard Code 2 of 5</td>
  1564. </tr>
  1565. <tr>
  1566. <td style="text-align: left;">3</td>
  1567. <td style="text-align: left;"><code>BARCODE_C25INTER</code></td>
  1568. <td style="text-align: left;">Interleaved 2 of 5</td>
  1569. </tr>
  1570. <tr>
  1571. <td style="text-align: left;">4</td>
  1572. <td style="text-align: left;"><code>BARCODE_C25IATA</code></td>
  1573. <td style="text-align: left;">Code 2 of 5 IATA</td>
  1574. </tr>
  1575. <tr>
  1576. <td style="text-align: left;">6</td>
  1577. <td style="text-align: left;"><code>BARCODE_C25LOGIC</code></td>
  1578. <td style="text-align: left;">Code 2 of 5 Data Logic</td>
  1579. </tr>
  1580. <tr>
  1581. <td style="text-align: left;">7</td>
  1582. <td style="text-align: left;"><code>BARCODE_C25IND</code></td>
  1583. <td style="text-align: left;">Code 2 of 5 Industrial</td>
  1584. </tr>
  1585. <tr>
  1586. <td style="text-align: left;">8</td>
  1587. <td style="text-align: left;"><code>BARCODE_CODE39</code></td>
  1588. <td style="text-align: left;">Code 3 of 9 (Code 39)</td>
  1589. </tr>
  1590. <tr>
  1591. <td style="text-align: left;">9</td>
  1592. <td style="text-align: left;"><code>BARCODE_EXCODE39</code></td>
  1593. <td style="text-align: left;">Extended Code 3 of 9 (Code 39+)</td>
  1594. </tr>
  1595. <tr>
  1596. <td style="text-align: left;">13</td>
  1597. <td style="text-align: left;"><code>BARCODE_EANX</code></td>
  1598. <td style="text-align: left;">EAN (EAN-2, EAN-5, EAN-8 and EAN-13)</td>
  1599. </tr>
  1600. <tr>
  1601. <td style="text-align: left;">14</td>
  1602. <td style="text-align: left;"><code>BARCODE_EANX_CHK</code></td>
  1603. <td style="text-align: left;">EAN + Check Digit</td>
  1604. </tr>
  1605. <tr>
  1606. <td style="text-align: left;">16<code>*</code></td>
  1607. <td style="text-align: left;"><code>BARCODE_GS1_128</code></td>
  1608. <td style="text-align: left;">GS1-128 (UCC.EAN-128)</td>
  1609. </tr>
  1610. <tr>
  1611. <td style="text-align: left;">18</td>
  1612. <td style="text-align: left;"><code>BARCODE_CODABAR</code></td>
  1613. <td style="text-align: left;">Codabar</td>
  1614. </tr>
  1615. <tr>
  1616. <td style="text-align: left;">20</td>
  1617. <td style="text-align: left;"><code>BARCODE_CODE128</code></td>
  1618. <td style="text-align: left;">Code 128 (automatic Code Set
  1619. switching)</td>
  1620. </tr>
  1621. <tr>
  1622. <td style="text-align: left;">21</td>
  1623. <td style="text-align: left;"><code>BARCODE_DPLEIT</code></td>
  1624. <td style="text-align: left;">Deutsche Post Leitcode</td>
  1625. </tr>
  1626. <tr>
  1627. <td style="text-align: left;">22</td>
  1628. <td style="text-align: left;"><code>BARCODE_DPIDENT</code></td>
  1629. <td style="text-align: left;">Deutsche Post Identcode</td>
  1630. </tr>
  1631. <tr>
  1632. <td style="text-align: left;">23</td>
  1633. <td style="text-align: left;"><code>BARCODE_CODE16K</code></td>
  1634. <td style="text-align: left;">Code 16K</td>
  1635. </tr>
  1636. <tr>
  1637. <td style="text-align: left;">24</td>
  1638. <td style="text-align: left;"><code>BARCODE_CODE49</code></td>
  1639. <td style="text-align: left;">Code 49</td>
  1640. </tr>
  1641. <tr>
  1642. <td style="text-align: left;">25</td>
  1643. <td style="text-align: left;"><code>BARCODE_CODE93</code></td>
  1644. <td style="text-align: left;">Code 93</td>
  1645. </tr>
  1646. <tr>
  1647. <td style="text-align: left;">28</td>
  1648. <td style="text-align: left;"><code>BARCODE_FLAT</code></td>
  1649. <td style="text-align: left;">Flattermarken</td>
  1650. </tr>
  1651. <tr>
  1652. <td style="text-align: left;">29<code>*</code></td>
  1653. <td style="text-align: left;"><code>BARCODE_DBAR_OMN</code></td>
  1654. <td style="text-align: left;">GS1 DataBar Omnidirectional (including GS1
  1655. DataBar Truncated)</td>
  1656. </tr>
  1657. <tr>
  1658. <td style="text-align: left;">30<code>*</code></td>
  1659. <td style="text-align: left;"><code>BARCODE_DBAR_LTD</code></td>
  1660. <td style="text-align: left;">GS1 DataBar Limited</td>
  1661. </tr>
  1662. <tr>
  1663. <td style="text-align: left;">31<code>*</code></td>
  1664. <td style="text-align: left;"><code>BARCODE_DBAR_EXP</code></td>
  1665. <td style="text-align: left;">GS1 DataBar Expanded</td>
  1666. </tr>
  1667. <tr>
  1668. <td style="text-align: left;">32</td>
  1669. <td style="text-align: left;"><code>BARCODE_TELEPEN</code></td>
  1670. <td style="text-align: left;">Telepen Alpha</td>
  1671. </tr>
  1672. <tr>
  1673. <td style="text-align: left;">34</td>
  1674. <td style="text-align: left;"><code>BARCODE_UPCA</code></td>
  1675. <td style="text-align: left;">UPC-A</td>
  1676. </tr>
  1677. <tr>
  1678. <td style="text-align: left;">35</td>
  1679. <td style="text-align: left;"><code>BARCODE_UPCA_CHK</code></td>
  1680. <td style="text-align: left;">UPC-A + Check Digit</td>
  1681. </tr>
  1682. <tr>
  1683. <td style="text-align: left;">37</td>
  1684. <td style="text-align: left;"><code>BARCODE_UPCE</code></td>
  1685. <td style="text-align: left;">UPC-E</td>
  1686. </tr>
  1687. <tr>
  1688. <td style="text-align: left;">38</td>
  1689. <td style="text-align: left;"><code>BARCODE_UPCE_CHK</code></td>
  1690. <td style="text-align: left;">UPC-E + Check Digit</td>
  1691. </tr>
  1692. <tr>
  1693. <td style="text-align: left;">40</td>
  1694. <td style="text-align: left;"><code>BARCODE_POSTNET</code></td>
  1695. <td style="text-align: left;">POSTNET</td>
  1696. </tr>
  1697. <tr>
  1698. <td style="text-align: left;">47</td>
  1699. <td style="text-align: left;"><code>BARCODE_MSI_PLESSEY</code></td>
  1700. <td style="text-align: left;">MSI Plessey</td>
  1701. </tr>
  1702. <tr>
  1703. <td style="text-align: left;">49</td>
  1704. <td style="text-align: left;"><code>BARCODE_FIM</code></td>
  1705. <td style="text-align: left;">FIM</td>
  1706. </tr>
  1707. <tr>
  1708. <td style="text-align: left;">50</td>
  1709. <td style="text-align: left;"><code>BARCODE_LOGMARS</code></td>
  1710. <td style="text-align: left;">LOGMARS</td>
  1711. </tr>
  1712. <tr>
  1713. <td style="text-align: left;">51</td>
  1714. <td style="text-align: left;"><code>BARCODE_PHARMA</code></td>
  1715. <td style="text-align: left;">Pharmacode One-Track</td>
  1716. </tr>
  1717. <tr>
  1718. <td style="text-align: left;">52</td>
  1719. <td style="text-align: left;"><code>BARCODE_PZN</code></td>
  1720. <td style="text-align: left;">PZN</td>
  1721. </tr>
  1722. <tr>
  1723. <td style="text-align: left;">53</td>
  1724. <td style="text-align: left;"><code>BARCODE_PHARMA_TWO</code></td>
  1725. <td style="text-align: left;">Pharmacode Two-Track</td>
  1726. </tr>
  1727. <tr>
  1728. <td style="text-align: left;">54</td>
  1729. <td style="text-align: left;"><code>BARCODE_CEPNET</code></td>
  1730. <td style="text-align: left;">Brazilian CEPNet</td>
  1731. </tr>
  1732. <tr>
  1733. <td style="text-align: left;">55</td>
  1734. <td style="text-align: left;"><code>BARCODE_PDF417</code></td>
  1735. <td style="text-align: left;">PDF417</td>
  1736. </tr>
  1737. <tr>
  1738. <td style="text-align: left;">56<code>*</code></td>
  1739. <td style="text-align: left;"><code>BARCODE_PDF417COMP</code></td>
  1740. <td style="text-align: left;">Compact PDF417 (Truncated PDF417)</td>
  1741. </tr>
  1742. <tr>
  1743. <td style="text-align: left;">57</td>
  1744. <td style="text-align: left;"><code>BARCODE_MAXICODE</code></td>
  1745. <td style="text-align: left;">MaxiCode</td>
  1746. </tr>
  1747. <tr>
  1748. <td style="text-align: left;">58</td>
  1749. <td style="text-align: left;"><code>BARCODE_QRCODE</code></td>
  1750. <td style="text-align: left;">QR Code</td>
  1751. </tr>
  1752. <tr>
  1753. <td style="text-align: left;">60</td>
  1754. <td style="text-align: left;"><code>BARCODE_CODE128AB</code></td>
  1755. <td style="text-align: left;">Code 128 (Suppress Code Set C)</td>
  1756. </tr>
  1757. <tr>
  1758. <td style="text-align: left;">63</td>
  1759. <td style="text-align: left;"><code>BARCODE_AUSPOST</code></td>
  1760. <td style="text-align: left;">Australia Post Standard Customer</td>
  1761. </tr>
  1762. <tr>
  1763. <td style="text-align: left;">66</td>
  1764. <td style="text-align: left;"><code>BARCODE_AUSREPLY</code></td>
  1765. <td style="text-align: left;">Australia Post Reply Paid</td>
  1766. </tr>
  1767. <tr>
  1768. <td style="text-align: left;">67</td>
  1769. <td style="text-align: left;"><code>BARCODE_AUSROUTE</code></td>
  1770. <td style="text-align: left;">Australia Post Routing</td>
  1771. </tr>
  1772. <tr>
  1773. <td style="text-align: left;">68</td>
  1774. <td style="text-align: left;"><code>BARCODE_AUSDIRECT</code></td>
  1775. <td style="text-align: left;">Australia Post Redirection</td>
  1776. </tr>
  1777. <tr>
  1778. <td style="text-align: left;">69</td>
  1779. <td style="text-align: left;"><code>BARCODE_ISBNX</code></td>
  1780. <td style="text-align: left;">ISBN (EAN-13 with verification stage)</td>
  1781. </tr>
  1782. <tr>
  1783. <td style="text-align: left;">70</td>
  1784. <td style="text-align: left;"><code>BARCODE_RM4SCC</code></td>
  1785. <td style="text-align: left;">Royal Mail 4-State Customer Code
  1786. (RM4SCC)</td>
  1787. </tr>
  1788. <tr>
  1789. <td style="text-align: left;">71</td>
  1790. <td style="text-align: left;"><code>BARCODE_DATAMATRIX</code></td>
  1791. <td style="text-align: left;">Data Matrix (ECC200)</td>
  1792. </tr>
  1793. <tr>
  1794. <td style="text-align: left;">72</td>
  1795. <td style="text-align: left;"><code>BARCODE_EAN14</code></td>
  1796. <td style="text-align: left;">EAN-14</td>
  1797. </tr>
  1798. <tr>
  1799. <td style="text-align: left;">73</td>
  1800. <td style="text-align: left;"><code>BARCODE_VIN</code></td>
  1801. <td style="text-align: left;">Vehicle Identification Number</td>
  1802. </tr>
  1803. <tr>
  1804. <td style="text-align: left;">74</td>
  1805. <td style="text-align: left;"><code>BARCODE_CODABLOCKF</code></td>
  1806. <td style="text-align: left;">Codablock-F</td>
  1807. </tr>
  1808. <tr>
  1809. <td style="text-align: left;">75</td>
  1810. <td style="text-align: left;"><code>BARCODE_NVE18</code></td>
  1811. <td style="text-align: left;">NVE-18 (SSCC-18)</td>
  1812. </tr>
  1813. <tr>
  1814. <td style="text-align: left;">76</td>
  1815. <td style="text-align: left;"><code>BARCODE_JAPANPOST</code></td>
  1816. <td style="text-align: left;">Japanese Postal Code</td>
  1817. </tr>
  1818. <tr>
  1819. <td style="text-align: left;">77</td>
  1820. <td style="text-align: left;"><code>BARCODE_KOREAPOST</code></td>
  1821. <td style="text-align: left;">Korea Post</td>
  1822. </tr>
  1823. <tr>
  1824. <td style="text-align: left;">79<code>*</code></td>
  1825. <td style="text-align: left;"><code>BARCODE_DBAR_STK</code></td>
  1826. <td style="text-align: left;">GS1 DataBar Stacked</td>
  1827. </tr>
  1828. <tr>
  1829. <td style="text-align: left;">80<code>*</code></td>
  1830. <td style="text-align: left;"><code>BARCODE_DBAR_OMNSTK</code></td>
  1831. <td style="text-align: left;">GS1 DataBar Stacked Omnidirectional</td>
  1832. </tr>
  1833. <tr>
  1834. <td style="text-align: left;">81<code>*</code></td>
  1835. <td style="text-align: left;"><code>BARCODE_DBAR_EXPSTK</code></td>
  1836. <td style="text-align: left;">GS1 DataBar Expanded Stacked</td>
  1837. </tr>
  1838. <tr>
  1839. <td style="text-align: left;">82</td>
  1840. <td style="text-align: left;"><code>BARCODE_PLANET</code></td>
  1841. <td style="text-align: left;">PLANET</td>
  1842. </tr>
  1843. <tr>
  1844. <td style="text-align: left;">84</td>
  1845. <td style="text-align: left;"><code>BARCODE_MICROPDF417</code></td>
  1846. <td style="text-align: left;">MicroPDF417</td>
  1847. </tr>
  1848. <tr>
  1849. <td style="text-align: left;">85<code>*</code></td>
  1850. <td style="text-align: left;"><code>BARCODE_USPS_IMAIL</code></td>
  1851. <td style="text-align: left;">USPS Intelligent Mail (OneCode)</td>
  1852. </tr>
  1853. <tr>
  1854. <td style="text-align: left;">86</td>
  1855. <td style="text-align: left;"><code>BARCODE_PLESSEY</code></td>
  1856. <td style="text-align: left;">UK Plessey</td>
  1857. </tr>
  1858. <tr>
  1859. <td style="text-align: left;">87</td>
  1860. <td style="text-align: left;"><code>BARCODE_TELEPEN_NUM</code></td>
  1861. <td style="text-align: left;">Telepen Numeric</td>
  1862. </tr>
  1863. <tr>
  1864. <td style="text-align: left;">89</td>
  1865. <td style="text-align: left;"><code>BARCODE_ITF14</code></td>
  1866. <td style="text-align: left;">ITF-14</td>
  1867. </tr>
  1868. <tr>
  1869. <td style="text-align: left;">90</td>
  1870. <td style="text-align: left;"><code>BARCODE_KIX</code></td>
  1871. <td style="text-align: left;">Dutch Post KIX Code</td>
  1872. </tr>
  1873. <tr>
  1874. <td style="text-align: left;">92</td>
  1875. <td style="text-align: left;"><code>BARCODE_AZTEC</code></td>
  1876. <td style="text-align: left;">Aztec Code</td>
  1877. </tr>
  1878. <tr>
  1879. <td style="text-align: left;">93</td>
  1880. <td style="text-align: left;"><code>BARCODE_DAFT</code></td>
  1881. <td style="text-align: left;">DAFT Code</td>
  1882. </tr>
  1883. <tr>
  1884. <td style="text-align: left;">96</td>
  1885. <td style="text-align: left;"><code>BARCODE_DPD</code></td>
  1886. <td style="text-align: left;">DPD Code</td>
  1887. </tr>
  1888. <tr>
  1889. <td style="text-align: left;">97</td>
  1890. <td style="text-align: left;"><code>BARCODE_MICROQR</code></td>
  1891. <td style="text-align: left;">Micro QR Code</td>
  1892. </tr>
  1893. <tr>
  1894. <td style="text-align: left;">98</td>
  1895. <td style="text-align: left;"><code>BARCODE_HIBC_128</code></td>
  1896. <td style="text-align: left;">HIBC Code 128</td>
  1897. </tr>
  1898. <tr>
  1899. <td style="text-align: left;">99</td>
  1900. <td style="text-align: left;"><code>BARCODE_HIBC_39</code></td>
  1901. <td style="text-align: left;">HIBC Code 39</td>
  1902. </tr>
  1903. <tr>
  1904. <td style="text-align: left;">102</td>
  1905. <td style="text-align: left;"><code>BARCODE_HIBC_DM</code></td>
  1906. <td style="text-align: left;">HIBC Data Matrix ECC200</td>
  1907. </tr>
  1908. <tr>
  1909. <td style="text-align: left;">104</td>
  1910. <td style="text-align: left;"><code>BARCODE_HIBC_QR</code></td>
  1911. <td style="text-align: left;">HIBC QR Code</td>
  1912. </tr>
  1913. <tr>
  1914. <td style="text-align: left;">106</td>
  1915. <td style="text-align: left;"><code>BARCODE_HIBC_PDF</code></td>
  1916. <td style="text-align: left;">HIBC PDF417</td>
  1917. </tr>
  1918. <tr>
  1919. <td style="text-align: left;">108</td>
  1920. <td style="text-align: left;"><code>BARCODE_HIBC_MICPDF</code></td>
  1921. <td style="text-align: left;">HIBC MicroPDF417</td>
  1922. </tr>
  1923. <tr>
  1924. <td style="text-align: left;">110</td>
  1925. <td style="text-align: left;"><code>BARCODE_HIBC_BLOCKF</code></td>
  1926. <td style="text-align: left;">HIBC Codablock-F</td>
  1927. </tr>
  1928. <tr>
  1929. <td style="text-align: left;">112</td>
  1930. <td style="text-align: left;"><code>BARCODE_HIBC_AZTEC</code></td>
  1931. <td style="text-align: left;">HIBC Aztec Code</td>
  1932. </tr>
  1933. <tr>
  1934. <td style="text-align: left;">115</td>
  1935. <td style="text-align: left;"><code>BARCODE_DOTCODE</code></td>
  1936. <td style="text-align: left;">DotCode</td>
  1937. </tr>
  1938. <tr>
  1939. <td style="text-align: left;">116</td>
  1940. <td style="text-align: left;"><code>BARCODE_HANXIN</code></td>
  1941. <td style="text-align: left;">Han Xin (Chinese Sensible) Code</td>
  1942. </tr>
  1943. <tr>
  1944. <td style="text-align: left;">119</td>
  1945. <td style="text-align: left;"><code>BARCODE_MAILMARK_2D</code></td>
  1946. <td style="text-align: left;">Royal Mail 2D Mailmark (CMDM) (Data
  1947. Matrix)</td>
  1948. </tr>
  1949. <tr>
  1950. <td style="text-align: left;">121</td>
  1951. <td style="text-align: left;"><code>BARCODE_MAILMARK_4S</code></td>
  1952. <td style="text-align: left;">Royal Mail 4-State Mailmark</td>
  1953. </tr>
  1954. <tr>
  1955. <td style="text-align: left;">128</td>
  1956. <td style="text-align: left;"><code>BARCODE_AZRUNE</code></td>
  1957. <td style="text-align: left;">Aztec Runes</td>
  1958. </tr>
  1959. <tr>
  1960. <td style="text-align: left;">129</td>
  1961. <td style="text-align: left;"><code>BARCODE_CODE32</code></td>
  1962. <td style="text-align: left;">Code 32</td>
  1963. </tr>
  1964. <tr>
  1965. <td style="text-align: left;">130</td>
  1966. <td style="text-align: left;"><code>BARCODE_EANX_CC</code></td>
  1967. <td style="text-align: left;">GS1 Composite Symbol with EAN linear
  1968. component</td>
  1969. </tr>
  1970. <tr>
  1971. <td style="text-align: left;">131<code>*</code></td>
  1972. <td style="text-align: left;"><code>BARCODE_GS1_128_CC</code></td>
  1973. <td style="text-align: left;">GS1 Composite Symbol with GS1-128 linear
  1974. component</td>
  1975. </tr>
  1976. <tr>
  1977. <td style="text-align: left;">132<code>*</code></td>
  1978. <td style="text-align: left;"><code>BARCODE_DBAR_OMN_CC</code></td>
  1979. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  1980. Omnidirectional linear component</td>
  1981. </tr>
  1982. <tr>
  1983. <td style="text-align: left;">133<code>*</code></td>
  1984. <td style="text-align: left;"><code>BARCODE_DBAR_LTD_CC</code></td>
  1985. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  1986. Limited linear component</td>
  1987. </tr>
  1988. <tr>
  1989. <td style="text-align: left;">134<code>*</code></td>
  1990. <td style="text-align: left;"><code>BARCODE_DBAR_EXP_CC</code></td>
  1991. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  1992. Expanded linear component</td>
  1993. </tr>
  1994. <tr>
  1995. <td style="text-align: left;">135</td>
  1996. <td style="text-align: left;"><code>BARCODE_UPCA_CC</code></td>
  1997. <td style="text-align: left;">GS1 Composite Symbol with UPC-A linear
  1998. component</td>
  1999. </tr>
  2000. <tr>
  2001. <td style="text-align: left;">136</td>
  2002. <td style="text-align: left;"><code>BARCODE_UPCE_CC</code></td>
  2003. <td style="text-align: left;">GS1 Composite Symbol with UPC-E linear
  2004. component</td>
  2005. </tr>
  2006. <tr>
  2007. <td style="text-align: left;">137<code>*</code></td>
  2008. <td style="text-align: left;"><code>BARCODE_DBAR_STK_CC</code></td>
  2009. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  2010. Stacked component</td>
  2011. </tr>
  2012. <tr>
  2013. <td style="text-align: left;">138<code>*</code></td>
  2014. <td style="text-align: left;"><code>BARCODE_DBAR_OMNSTK_CC</code></td>
  2015. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  2016. Stacked Omnidirectional component</td>
  2017. </tr>
  2018. <tr>
  2019. <td style="text-align: left;">139<code>*</code></td>
  2020. <td style="text-align: left;"><code>BARCODE_DBAR_EXPSTK_CC</code></td>
  2021. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  2022. Expanded Stacked component</td>
  2023. </tr>
  2024. <tr>
  2025. <td style="text-align: left;">140</td>
  2026. <td style="text-align: left;"><code>BARCODE_CHANNEL</code></td>
  2027. <td style="text-align: left;">Channel Code</td>
  2028. </tr>
  2029. <tr>
  2030. <td style="text-align: left;">141</td>
  2031. <td style="text-align: left;"><code>BARCODE_CODEONE</code></td>
  2032. <td style="text-align: left;">Code One</td>
  2033. </tr>
  2034. <tr>
  2035. <td style="text-align: left;">142</td>
  2036. <td style="text-align: left;"><code>BARCODE_GRIDMATRIX</code></td>
  2037. <td style="text-align: left;">Grid Matrix</td>
  2038. </tr>
  2039. <tr>
  2040. <td style="text-align: left;">143</td>
  2041. <td style="text-align: left;"><code>BARCODE_UPNQR</code></td>
  2042. <td style="text-align: left;">UPNQR (Univerzalnega Plačilnega Naloga
  2043. QR)</td>
  2044. </tr>
  2045. <tr>
  2046. <td style="text-align: left;">144</td>
  2047. <td style="text-align: left;"><code>BARCODE_ULTRA</code></td>
  2048. <td style="text-align: left;">Ultracode</td>
  2049. </tr>
  2050. <tr>
  2051. <td style="text-align: left;">145</td>
  2052. <td style="text-align: left;"><code>BARCODE_RMQR</code></td>
  2053. <td style="text-align: left;">Rectangular Micro QR Code (rMQR)</td>
  2054. </tr>
  2055. <tr>
  2056. <td style="text-align: left;">146</td>
  2057. <td style="text-align: left;"><code>BARCODE_BC412</code></td>
  2058. <td style="text-align: left;">IBM BC412 (SEMI T1-95)</td>
  2059. </tr>
  2060. <tr>
  2061. <td style="text-align: left;">147</td>
  2062. <td style="text-align: left;"><code>BARCODE_DXFILMEDGE</code></td>
  2063. <td style="text-align: left;">DX Film Edge Barcode</td>
  2064. </tr>
  2065. </tbody>
  2066. </table>
  2067. </div>
  2068. <h2 id="adjusting-height">4.4 Adjusting Height</h2>
  2069. <p>The height of a symbol (except those with a fixed width-to-height
  2070. ratio) can be adjusted using the <code>--height</code> switch. For
  2071. example:</p>
  2072. <div class="sourceCode" id="cb23"><pre
  2073. class="sourceCode bash"><code class="sourceCode bash"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--height</span><span class="op">=</span>100 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  2074. <p>This specifies a symbol height of 100 times the X-dimension of the
  2075. symbol.</p>
  2076. <p>The default height of most linear barcodes is 50.0X, but this can be
  2077. changed for barcodes whose specifications give a standard height by
  2078. using the switch <code>--compliantheight</code>. For instance</p>
  2079. <div class="sourceCode" id="cb24"><pre
  2080. class="sourceCode bash"><code class="sourceCode bash"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> LOGMARS <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span> <span class="at">--compliantheight</span></span></code></pre></div>
  2081. <p>will produce a barcode of height 45.455X instead of the normal
  2082. default of 50.0X. The flag also causes Zint to return a warning if a
  2083. non-compliant height is given:</p>
  2084. <div class="sourceCode" id="cb25"><pre
  2085. class="sourceCode bash"><code class="sourceCode bash"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> LOGMARS <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span> <span class="at">--compliantheight</span> <span class="at">--height</span><span class="op">=</span>6.2</span>
  2086. <span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a><span class="ex">Warning</span> 247: Height not compliant with standards</span></code></pre></div>
  2087. <p>Another switch is <code>--heightperrow</code>, which can be useful
  2088. for symbologies that have a variable number of linear rows, namely
  2089. Codablock-F, Code 16K, Code 49, GS1 DataBar Expanded Stacked,
  2090. MicroPDF417 and PDF417, as it changes the treatment of the height value
  2091. from overall height to per-row height, allowing you to specify a
  2092. consistent height for each linear row without having to know how many
  2093. there are. For instance</p>
  2094. <div class="sourceCode" id="cb26"><pre
  2095. class="sourceCode bash"><code class="sourceCode bash"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> PDF417 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span> <span class="at">--height</span><span class="op">=</span>4 <span class="at">--heightperrow</span></span></code></pre></div>
  2096. <figure>
  2097. <img src="images/pdf417_heightperrow.svg" title="fig:" class="lin"
  2098. alt="zint -b PDF417 -d &quot;This Text&quot; --height=4 --heightperrow" />
  2099. <figcaption
  2100. aria-hidden="true"><code>zint -b PDF417 -d "This Text" --height=4 --heightperrow</code></figcaption>
  2101. </figure>
  2102. <p>will produce a barcode of height 32X, with each of the 8 rows 4X
  2103. high.</p>
  2104. <h2 id="adjusting-whitespace">4.5 Adjusting Whitespace</h2>
  2105. <p>The amount of horizontal whitespace to the left and right of the
  2106. generated barcode can be altered using the <code>-w</code> or
  2107. <code>--whitesp</code> switch, in integral multiples of the X-dimension.
  2108. For example:</p>
  2109. <div class="sourceCode" id="cb27"><pre
  2110. class="sourceCode bash"><code class="sourceCode bash"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-w</span> 10 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  2111. <p>This specifies a whitespace width of 10 times the X-dimension of the
  2112. symbol both to the left and to the right of the barcode.</p>
  2113. <p>The amount of vertical whitespace above and below the barcode can be
  2114. altered using the <code>--vwhitesp</code> switch, in integral multiples
  2115. of the X-dimension. For example for 3 times the X-dimension:</p>
  2116. <div class="sourceCode" id="cb28"><pre
  2117. class="sourceCode bash"><code class="sourceCode bash"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--vwhitesp</span><span class="op">=</span>3 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  2118. <p>Note that the whitespace at the bottom appears below the text, if
  2119. any.</p>
  2120. <p>Horizontal and vertical whitespace can of course be used
  2121. together:</p>
  2122. <div class="sourceCode" id="cb29"><pre
  2123. class="sourceCode bash"><code class="sourceCode bash"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> DATAMATRIX <span class="at">--whitesp</span><span class="op">=</span>1 <span class="at">--vwhitesp</span><span class="op">=</span>1 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  2124. <p>A <code>--quietzones</code> option is also available which adds quiet
  2125. zones compliant with the symbology’s specification. This is in addition
  2126. to any whitespace specified with the <code>--whitesp</code> or
  2127. <code>--vwhitesp</code> switches.</p>
  2128. <p>Note that Codablock-F, Code 16K, Code 49, ITF-14, EAN-2 to EAN-13,
  2129. ISBN, UPC-A and UPC-E have compliant quiet zones added by default. This
  2130. can be disabled with the option <code>--noquietzones</code>.</p>
  2131. <h2 id="adding-boundary-bars-and-boxes">4.6 Adding Boundary Bars and
  2132. Boxes</h2>
  2133. <p>Zint allows the symbol to be bound with ‘boundary bars’ (also known
  2134. as ‘bearer bars’) using the option <code>--bind</code>. These bars help
  2135. to prevent misreading of the symbol by corrupting a scan if the scanning
  2136. beam strays off the top or bottom of the symbol. Zint can also put a
  2137. border right around the symbol and its horizontal whitespace with the
  2138. <code>--box</code> option.</p>
  2139. <p>The width of the boundary bars or box borders, in integral multiples
  2140. of the X-dimension, must be specified using the <code>--border</code>
  2141. switch. For example:</p>
  2142. <div class="sourceCode" id="cb30"><pre
  2143. class="sourceCode bash"><code class="sourceCode bash"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--box</span> <span class="at">--border</span><span class="op">=</span>10 <span class="at">-w</span> 10 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  2144. <figure>
  2145. <img src="images/code128_box.svg" title="fig:" class="lin"
  2146. alt="zint --border=10 --box -d &quot;This Text&quot; -w 10" />
  2147. <figcaption
  2148. aria-hidden="true"><code>zint --border=10 --box -d "This Text" -w 10</code></figcaption>
  2149. </figure>
  2150. <p>gives a box with a width 10 times the X-dimension of the symbol. Note
  2151. that when specifying a box, horizontal whitespace is usually required in
  2152. order to create a quiet zone between the barcode and the sides of the
  2153. box. To add a boundary bar to the top only use
  2154. <code>--bindtop</code>.</p>
  2155. <p>For linear symbols, horizontal boundary bars appear tight against the
  2156. barcode, inside any vertical whitespace (or text). For matrix symbols,
  2157. however, where they are decorative rather than functional, boundary bars
  2158. appear outside any whitespace.</p>
  2159. <figure>
  2160. <img src="images/qrcode_box.svg" title="fig:" class="i2d"
  2161. alt="zint -b QRCODE --border=1 --box -d &quot;This Text&quot; --quietzones" />
  2162. <figcaption
  2163. aria-hidden="true"><code>zint -b QRCODE --border=1 --box -d "This Text" --quietzones</code></figcaption>
  2164. </figure>
  2165. <p>Codablock-F, Code 16K and Code 49 always have boundary bars, and
  2166. default to particular horizontal whitespace values. Special
  2167. considerations apply to ITF-14 and DPD - see <a href="#itf-14">6.1.2.6
  2168. ITF-14</a> and <a href="#dpd-code">6.1.10.7 DPD Code</a> for those
  2169. symbologies.</p>
  2170. <h2 id="using-colour">4.7 Using Colour</h2>
  2171. <p>The default colours of a symbol are a black symbol on a white
  2172. background. Zint allows you to change this. The <code>-r</code> or
  2173. <code>--reverse</code> switch allows the default colours to be inverted
  2174. so that a white symbol is shown on a black background (known as
  2175. “reflectance reversal” or “reversed reflectance”). For example the
  2176. command</p>
  2177. <div class="sourceCode" id="cb31"><pre
  2178. class="sourceCode bash"><code class="sourceCode bash"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-r</span> <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  2179. <p>gives an inverted Code 128 symbol. This is not practical for most
  2180. symbologies but white-on-black is allowed by the Aztec Code, Data
  2181. Matrix, DotCode, Han Xin Code, Grid Matrix and QR Code symbology
  2182. specifications.</p>
  2183. <p>For more specific needs the foreground (ink) and background (paper)
  2184. colours can be specified using the <code>--fg</code> and
  2185. <code>--bg</code> options followed by a number in <code>"RRGGBB"</code>
  2186. hexadecimal notation (the same system used in HTML) or in
  2187. <code>"C,M,Y,K"</code> decimal percentages format (the latter normally
  2188. used with the <code>--cmyk</code> option - see below). For example the
  2189. command</p>
  2190. <div class="sourceCode" id="cb32"><pre
  2191. class="sourceCode bash"><code class="sourceCode bash"><span id="cb32-1"><a href="#cb32-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--fg</span><span class="op">=</span>00FF00 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  2192. <p>alters the symbol to a bright green.</p>
  2193. <figure>
  2194. <img src="images/code128_green.svg" title="fig:" class="lin"
  2195. alt="zint -d &quot;This Text&quot; --fg=00FF00" />
  2196. <figcaption
  2197. aria-hidden="true"><code>zint -d "This Text" --fg=00FF00</code></figcaption>
  2198. </figure>
  2199. <p>Zint also supports RGBA colour information for those output file
  2200. formats which support alpha channels (currently only GIF, PCX, PNG, SVG
  2201. and TIF, with GIF supporting either a background or foreground alpha but
  2202. not both) in a <code>"RRGGBBAA"</code> format. For example:</p>
  2203. <div class="sourceCode" id="cb33"><pre
  2204. class="sourceCode bash"><code class="sourceCode bash"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--fg</span><span class="op">=</span>00ff0055 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
  2205. <figure>
  2206. <img src="images/code128_green_alpha.svg" title="fig:" class="lin"
  2207. alt="zint -d &quot;This Text&quot; --fg=00FF0055" />
  2208. <figcaption
  2209. aria-hidden="true"><code>zint -d "This Text" --fg=00FF0055</code></figcaption>
  2210. </figure>
  2211. <p>will produce a semi-transparent green foreground with a standard
  2212. (white) background. Note that transparency is treated differently by
  2213. raster and vector (SVG) output formats, as for vector output the
  2214. background will “shine through” a transparent foreground. For
  2215. instance</p>
  2216. <div class="sourceCode" id="cb34"><pre
  2217. class="sourceCode bash"><code class="sourceCode bash"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--bg</span><span class="op">=</span>ff0000 <span class="at">--fg</span><span class="op">=</span>ffffff00 ...</span></code></pre></div>
  2218. <p>will give different results for PNG and SVG. Experimentation is
  2219. advised!</p>
  2220. <p>In addition the <code>--nobackground</code> option will remove the
  2221. background from all output formats except BMP.<a href="#fn4"
  2222. class="footnote-ref" id="fnref4" role="doc-noteref"><sup>4</sup></a></p>
  2223. <p>The <code>--cmyk</code> option is specific to output in Encapsulated
  2224. PostScript (EPS) and TIF, and selects the CMYK colour space. Custom
  2225. colours should then usually be given in the comma-separated
  2226. <code>"C,M,Y,K"</code> format, where <code>C</code>, <code>M</code>,
  2227. <code>Y</code> and <code>K</code> are expressed as decimal percentage
  2228. values from 0 to 100. RGB values may still be used, in which case they
  2229. will be converted formulaically to CMYK approximations.</p>
  2230. <h2 id="rotating-the-symbol">4.8 Rotating the Symbol</h2>
  2231. <p>The symbol can be rotated through four orientations using the
  2232. <code>--rotate</code> option followed by the angle of rotation as shown
  2233. below.</p>
  2234. <pre><code>--rotate=0 (default)
  2235. --rotate=90
  2236. --rotate=180
  2237. --rotate=270</code></pre>
  2238. <figure>
  2239. <img src="images/code128_rotate90.svg" title="fig:" class="lin"
  2240. alt="zint -d &quot;This Text&quot; --rotate=90" />
  2241. <figcaption
  2242. aria-hidden="true"><code>zint -d "This Text" --rotate=90</code></figcaption>
  2243. </figure>
  2244. <h2 id="adjusting-image-size-x-dimension">4.9 Adjusting Image Size
  2245. (X-dimension)</h2>
  2246. <p>The size of the image can be altered using the <code>--scale</code>
  2247. option, which sets the X-dimension. The default scale is 1.0.</p>
  2248. <p>The scale is multiplied by 2 (with the exception of MaxiCode) before
  2249. being applied to the X-dimension. For MaxiCode, it is multiplied by 10
  2250. for raster output, by 40 for EMF vector output, and by 2 otherwise
  2251. (non-EMF vector output).</p>
  2252. <p>For non-MaxiCode raster output, the default scale of 1 results in an
  2253. X-dimension of 2 pixels. For example for non-MaxiCode PNG images a scale
  2254. of 5 will increase the X-dimension to 10 pixels. For MaxiCode, see <a
  2255. href="#maxicode-raster-scaling">4.9.3 MaxiCode Raster Scaling</a>
  2256. below.</p>
  2257. <p>Scales for non-MaxiCode raster output should be given in increments
  2258. of 0.5, i.e. 0.5, 1, 1.5, 2, 2.5, 3, 3.5, etc., to avoid the X-dimension
  2259. varying across the symbol due to interpolation. 0.5 increments are also
  2260. faster to render.</p>
  2261. <p>The minimum scale for non-MaxiCode raster output in non-dotty mode is
  2262. 0.5, giving a minimum X-dimension of 1 pixel. For MaxiCode, it is 0.2.
  2263. The minimum scale for raster output in dotty mode is 1 (see <a
  2264. href="#working-with-dots">4.15 Working with Dots</a>). For raster
  2265. output, text will not be printed for scales less than 1.</p>
  2266. <p>The minimum scale for vector output is 0.1, giving a minimum
  2267. X-dimension of 0.2 (or for MaxiCode EMF output, 4). The maximum scale
  2268. for both raster and vector is 200.</p>
  2269. <p>To summarize the more intricate details:</p>
  2270. <div id="tbl:scaling_multiplers" class="tablenos">
  2271. <table id="tbl:scaling_multiplers" style="width:92%;"
  2272. data-tag=": Scaling Multipliers and Minima">
  2273. <caption><span>Table : Scaling Multipliers and Minima</span> </caption>
  2274. <colgroup>
  2275. <col style="width: 15%" />
  2276. <col style="width: 25%" />
  2277. <col style="width: 16%" />
  2278. <col style="width: 19%" />
  2279. <col style="width: 15%" />
  2280. </colgroup>
  2281. <thead>
  2282. <tr>
  2283. <th>MaxiCode?</th>
  2284. <th style="text-align: left;">Output</th>
  2285. <th>Multiplier</th>
  2286. <th style="text-align: left;">Min. Scale (non-dotty)</th>
  2287. <th style="text-align: left;">Min. Scale (dotty)</th>
  2288. </tr>
  2289. </thead>
  2290. <tbody>
  2291. <tr>
  2292. <td>No</td>
  2293. <td style="text-align: left;">Raster</td>
  2294. <td>2</td>
  2295. <td style="text-align: left;">0.5</td>
  2296. <td style="text-align: left;">1</td>
  2297. </tr>
  2298. <tr>
  2299. <td>No</td>
  2300. <td style="text-align: left;">Vector</td>
  2301. <td>2</td>
  2302. <td style="text-align: left;">0.1</td>
  2303. <td style="text-align: left;">0.1</td>
  2304. </tr>
  2305. <tr>
  2306. <td>Yes</td>
  2307. <td style="text-align: left;">Raster</td>
  2308. <td>10</td>
  2309. <td style="text-align: left;">0.2</td>
  2310. <td style="text-align: left;">N/A</td>
  2311. </tr>
  2312. <tr>
  2313. <td>Yes</td>
  2314. <td style="text-align: left;">Vector (non-EMF)</td>
  2315. <td>2</td>
  2316. <td style="text-align: left;">0.1</td>
  2317. <td style="text-align: left;">N/A</td>
  2318. </tr>
  2319. <tr>
  2320. <td>Yes</td>
  2321. <td style="text-align: left;">EMF</td>
  2322. <td>40</td>
  2323. <td style="text-align: left;">0.1</td>
  2324. <td style="text-align: left;">N/A</td>
  2325. </tr>
  2326. </tbody>
  2327. </table>
  2328. </div>
  2329. <h3 id="scaling-by-x-dimension-and-resolution">4.9.1 Scaling by
  2330. X-dimension and Resolution</h3>
  2331. <p>An alternative way to specify the scale, which takes the above
  2332. details into account, is to specify measurable units using the
  2333. <code>--scalexdimdp</code> option, which has the format</p>
  2334. <pre><code>--scalexdimdp=X[,R]</code></pre>
  2335. <p>where <code>X</code> is the X-dimension (in mm by default) and
  2336. <code>R</code> is the resolution (in dpmm, dots per mm, by default).
  2337. <code>R</code> is optional, and defaults to 12 dpmm, and <code>X</code>
  2338. may be zero, in which case it uses a symbology-specific default. The
  2339. units may be given in inches for <code>X</code> by appending
  2340. <code>"in"</code>, and in dpi (dots per inch) for <code>R</code> by
  2341. appending <code>"dpi"</code>. For example</p>
  2342. <div class="sourceCode" id="cb37"><pre
  2343. class="sourceCode bash"><code class="sourceCode bash"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&quot;1234&quot;</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0.013in,300dpi</span></code></pre></div>
  2344. <p>Explicit metric units may also be given by appending
  2345. <code>"mm"</code> and <code>"dpmm"</code> as appropriate, and may be
  2346. mixed with U.S. units:</p>
  2347. <div class="sourceCode" id="cb38"><pre
  2348. class="sourceCode bash"><code class="sourceCode bash"><span id="cb38-1"><a href="#cb38-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&quot;1234&quot;</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0.33mm,300dpi</span></code></pre></div>
  2349. <h3 id="scaling-example">4.9.2 Scaling Example</h3>
  2350. <p>The GS1 General Specifications Section 5.2.6.6 ‘Symbol dimensions at
  2351. nominal size’ gives an example of an EAN-13 barcode using the
  2352. X-dimension of 0.33mm. To print that example as a PNG at 12 dpmm, the
  2353. approximate equivalent of 300 dpi (<code>dpi = dpmm * 25.4</code>),
  2354. specify a scale of 2, since <code>0.33 * 12 = 3.96</code> pixels, or 4
  2355. pixels rounding to the nearest pixel:</p>
  2356. <div class="sourceCode" id="cb39"><pre
  2357. class="sourceCode bash"><code class="sourceCode bash"><span id="cb39-1"><a href="#cb39-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">&quot;501234567890&quot;</span> <span class="at">--compliantheight</span> <span class="at">--scale</span><span class="op">=</span>2</span></code></pre></div>
  2358. <p>This will result in output of 37.29mm x 25.56mm (WxH) at 12 dpmm. The
  2359. same result can be achieved using the <code>--scalexdimdp</code> option
  2360. with</p>
  2361. <div class="sourceCode" id="cb40"><pre
  2362. class="sourceCode bash"><code class="sourceCode bash"><span id="cb40-1"><a href="#cb40-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">&quot;501234567890&quot;</span> <span class="at">--compliantheight</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0</span></code></pre></div>
  2363. <p>as 0.33mm is the default X-dimension for EAN, and 12 dpmm the default
  2364. resolution.</p>
  2365. <h3 id="maxicode-raster-scaling">4.9.3 MaxiCode Raster Scaling</h3>
  2366. <p>For MaxiCode symbols, which use hexagons, the scale for raster output
  2367. is multiplied by 10 before being applied. The 0.5 increment recommended
  2368. for normal raster output does not apply.</p>
  2369. <p>The minimum scale is 0.2, so the minimum X-dimension is 2 pixels.
  2370. However scales below 0.5 are not recommended and may produce symbols
  2371. that are not within the following size ranges.</p>
  2372. <p>MaxiCode symbols have fixed size ranges of 24.82mm to 27.93mm in
  2373. width, and 23.71mm to 26.69mm in height, excluding quiet zones. The
  2374. default X-dimension is 0.88mm. For example, to output at the default
  2375. X-dimension at 600 dpi specify:</p>
  2376. <div class="sourceCode" id="cb41"><pre
  2377. class="sourceCode bash"><code class="sourceCode bash"><span id="cb41-1"><a href="#cb41-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> MAXICODE <span class="at">-d</span> <span class="st">&quot;MaxiCode (19 chars)&quot;</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0,600dpi</span></code></pre></div>
  2378. <h2 id="human-readable-text-hrt-options">4.10 Human Readable Text (HRT)
  2379. Options</h2>
  2380. <p>For linear barcodes the text present in the output image can be
  2381. removed by using the <code>--notext</code> option. Note also that for
  2382. raster output text will not be printed for scales less than 1 (see <a
  2383. href="#adjusting-image-size-x-dimension">4.9 Adjusting Image Size
  2384. (X-dimension)</a>).</p>
  2385. <p>Text can be set to bold using the <code>--bold</code> option, or a
  2386. smaller font can be substituted using the <code>--small</code> option.
  2387. The <code>--bold</code> and <code>--small</code> options can be used
  2388. together if required, but only for vector output.</p>
  2389. <figure>
  2390. <img src="images/code128_small_bold.svg" title="fig:" class="lin"
  2391. alt="zint --bold -d &quot;This Text&quot; --small" />
  2392. <figcaption
  2393. aria-hidden="true"><code>zint --bold -d "This Text" --small</code></figcaption>
  2394. </figure>
  2395. <p>The gap between the barcode and the text can be adjusted using the
  2396. <code>--textgap</code> option, where the gap is given in X-dimensions,
  2397. and may be negative (minimum -5.0X, maximum 10.0X). The default gap is
  2398. 1X. Note that a very small gap may cause accented texts to overlap with
  2399. the barcode:</p>
  2400. <figure>
  2401. <img src="images/code128_textgap.svg" title="fig:" class="lin"
  2402. alt="zint -d &quot;Áccent&quot; --textgap=0.1" />
  2403. <figcaption
  2404. aria-hidden="true"><code>zint -d "Áccent" --textgap=0.1</code></figcaption>
  2405. </figure>
  2406. <p>For SVG output, the font preferred by Zint (monospaced “OCR-B” for
  2407. EAN/UPC, “Arimo” - a proportional sans-serif font metrically compatible
  2408. with “Arial” - for all others) can be embedded in the file for
  2409. portability using the <code>--embedfont</code> option:</p>
  2410. <figure>
  2411. <img src="images/code128_embedfont.svg" title="fig:" class="lin"
  2412. alt="zint -d &quot;Áccent&quot; --embedfont" />
  2413. <figcaption
  2414. aria-hidden="true"><code>zint -d "Áccent" --embedfont</code></figcaption>
  2415. </figure>
  2416. <h2 id="input-modes">4.11 Input Modes</h2>
  2417. <h3 id="unicode-data-and-gs1-modes">4.11.1 Unicode, Data, and GS1
  2418. Modes</h3>
  2419. <p>By default all CLI input data is assumed to be encoded in UTF-8
  2420. format. Many barcode symbologies encode data using the Latin-1 (ISO/IEC
  2421. 8859-1 plus ASCII) character set, so input is converted from UTF-8 to
  2422. Latin-1 before being put in the symbol. In addition QR Code and its
  2423. variants and Han Xin Code can by default encode Japanese (Kanji) or
  2424. Chinese (Hanzi) characters which are also converted from UTF-8.</p>
  2425. <p>There are two exceptions to the Latin-1 default: Grid Matrix, whose
  2426. default character set is GB 2312 (Chinese); and UPNQR, whose default
  2427. character set is Latin-2 (ISO/IEC 8859-2 plus ASCII).</p>
  2428. <div id="tbl:default_character_sets" class="tablenos">
  2429. <table id="tbl:default_character_sets"
  2430. data-tag=": Default Character Sets">
  2431. <caption><span>Table : Default Character Sets</span> </caption>
  2432. <thead>
  2433. <tr>
  2434. <th style="text-align: left;">Symbology</th>
  2435. <th style="text-align: left;">Default character sets</th>
  2436. <th>Alternate if input not Latin-1</th>
  2437. </tr>
  2438. </thead>
  2439. <tbody>
  2440. <tr>
  2441. <td style="text-align: left;">Aztec Code</td>
  2442. <td style="text-align: left;">Latin-1</td>
  2443. <td>None</td>
  2444. </tr>
  2445. <tr>
  2446. <td style="text-align: left;">Codablock-F</td>
  2447. <td style="text-align: left;">Latin-1</td>
  2448. <td>None</td>
  2449. </tr>
  2450. <tr>
  2451. <td style="text-align: left;">Code 128</td>
  2452. <td style="text-align: left;">Latin-1</td>
  2453. <td>None</td>
  2454. </tr>
  2455. <tr>
  2456. <td style="text-align: left;">Code 16K</td>
  2457. <td style="text-align: left;">Latin-1</td>
  2458. <td>None</td>
  2459. </tr>
  2460. <tr>
  2461. <td style="text-align: left;">Code One</td>
  2462. <td style="text-align: left;">Latin-1</td>
  2463. <td>None</td>
  2464. </tr>
  2465. <tr>
  2466. <td style="text-align: left;">Data Matrix</td>
  2467. <td style="text-align: left;">Latin-1</td>
  2468. <td>None</td>
  2469. </tr>
  2470. <tr>
  2471. <td style="text-align: left;">DotCode</td>
  2472. <td style="text-align: left;">Latin-1</td>
  2473. <td>None</td>
  2474. </tr>
  2475. <tr>
  2476. <td style="text-align: left;">Grid Matrix</td>
  2477. <td style="text-align: left;">GB 2312 (includes ASCII)</td>
  2478. <td>N/A</td>
  2479. </tr>
  2480. <tr>
  2481. <td style="text-align: left;">Han Xin</td>
  2482. <td style="text-align: left;">Latin-1</td>
  2483. <td>GB 18030 (includes ASCII)</td>
  2484. </tr>
  2485. <tr>
  2486. <td style="text-align: left;">MaxiCode</td>
  2487. <td style="text-align: left;">Latin-1</td>
  2488. <td>None</td>
  2489. </tr>
  2490. <tr>
  2491. <td style="text-align: left;">MicroPDF417</td>
  2492. <td style="text-align: left;">Latin-1</td>
  2493. <td>None</td>
  2494. </tr>
  2495. <tr>
  2496. <td style="text-align: left;">Micro QR Code</td>
  2497. <td style="text-align: left;">Latin-1</td>
  2498. <td>Shift JIS (includes ASCII<a href="#fn5" class="footnote-ref"
  2499. id="fnref5" role="doc-noteref"><sup>5</sup></a>)</td>
  2500. </tr>
  2501. <tr>
  2502. <td style="text-align: left;">PDF417</td>
  2503. <td style="text-align: left;">Latin-1</td>
  2504. <td>None</td>
  2505. </tr>
  2506. <tr>
  2507. <td style="text-align: left;">QR Code</td>
  2508. <td style="text-align: left;">Latin-1</td>
  2509. <td>Shift JIS (see above)</td>
  2510. </tr>
  2511. <tr>
  2512. <td style="text-align: left;">rMQR</td>
  2513. <td style="text-align: left;">Latin-1</td>
  2514. <td>Shift JIS (see above)</td>
  2515. </tr>
  2516. <tr>
  2517. <td style="text-align: left;">Ultracode</td>
  2518. <td style="text-align: left;">Latin-1</td>
  2519. <td>None</td>
  2520. </tr>
  2521. <tr>
  2522. <td style="text-align: left;">UPNQR</td>
  2523. <td style="text-align: left;">Latin-2</td>
  2524. <td>N/A</td>
  2525. </tr>
  2526. <tr>
  2527. <td style="text-align: left;">All others</td>
  2528. <td style="text-align: left;">ASCII</td>
  2529. <td>N/A</td>
  2530. </tr>
  2531. </tbody>
  2532. </table>
  2533. </div>
  2534. <p>If Zint encounters characters which can not be encoded using the
  2535. default character encoding then it will take advantage of the ECI
  2536. (Extended Channel Interpretations) mechanism to encode the data if the
  2537. symbology supports it - see <a href="#input-modes-and-eci">4.11.2 Input
  2538. Modes and ECI</a> below.</p>
  2539. <p>GS1 data can be encoded in a number of symbologies. Application
  2540. Identifiers (AIs) should be enclosed in <code>[square brackets]</code>
  2541. followed by the data to be encoded (see <a href="#gs1-128">6.1.10.3
  2542. GS1-128</a>). To encode GS1 data use the <code>--gs1</code> option. GS1
  2543. mode is assumed (and doesn’t need to be set) for GS1-128, EAN-14, GS1
  2544. DataBar and GS1 Composite symbologies but is also available for Aztec
  2545. Code, Code 16K, Code 49, Code One, Data Matrix, DotCode, QR Code and
  2546. Ultracode.</p>
  2547. <p>Health Industry Barcode (HIBC) data may also be encoded in the
  2548. symbologies Aztec Code, Codablock-F, Code 128, Code 39, Data Matrix,
  2549. MicroPDF417, PDF417 and QR Code. Within this mode, the leading
  2550. <code>'+'</code> and the check character are automatically added by
  2551. Zint, conforming to HIBC Labeler Identification Code (HIBC LIC). For
  2552. HIBC Provider Applications Standard (HIBC PAS), preface the data with a
  2553. slash <code>'/'</code>.</p>
  2554. <p>The <code>--binary</code> option encodes the input data as given.
  2555. Automatic code page translation to an ECI page is disabled, and no
  2556. validation of the data’s encoding takes place. This may be used for raw
  2557. binary or binary encrypted data. This switch plays together with the
  2558. built-in ECI logic and examples may be found below.</p>
  2559. <p>The <code>--fullmultibyte</code> option uses the multibyte modes of
  2560. QR Code, Micro QR Code, Rectangular Micro QR Code, Han Xin Code and Grid
  2561. Matrix for non-ASCII data, maximizing density. This is achieved by using
  2562. compression designed for Kanji/Hanzi characters; however some decoders
  2563. take blocks which are encoded this way and interpret them as Kanji/Hanzi
  2564. characters, thus causing data corruption. Symbols encoded with this
  2565. option should be checked against decoders before they are used. The
  2566. popular open-source ZXing decoder is known to exhibit this
  2567. behaviour.</p>
  2568. <h3 id="input-modes-and-eci">4.11.2 Input Modes and ECI</h3>
  2569. <p>If your data contains characters that are not in the default
  2570. character set, you may encode it using an ECI-aware symbology and an ECI
  2571. value from Table <a href="#tbl:eci_codes">: ECI Codes</a> below. The ECI
  2572. information is added to your code symbol as prefix data. The symbologies
  2573. that support ECI are</p>
  2574. <div id="tbl:eci_aware_symbologies" class="tablenos">
  2575. <table id="tbl:eci_aware_symbologies"
  2576. data-tag=": ECI-Aware Symbologies">
  2577. <caption><span>Table : ECI-Aware Symbologies</span> </caption>
  2578. <tbody>
  2579. <tr>
  2580. <td style="text-align: left;">Aztec Code</td>
  2581. <td style="text-align: left;">Grid Matrix</td>
  2582. <td style="text-align: left;">PDF417</td>
  2583. </tr>
  2584. <tr>
  2585. <td style="text-align: left;">Code One</td>
  2586. <td style="text-align: left;">Han Xin Code</td>
  2587. <td style="text-align: left;">QR Code</td>
  2588. </tr>
  2589. <tr>
  2590. <td style="text-align: left;">Data Matrix</td>
  2591. <td style="text-align: left;">MaxiCode</td>
  2592. <td style="text-align: left;">rMQR</td>
  2593. </tr>
  2594. <tr>
  2595. <td style="text-align: left;">DotCode</td>
  2596. <td style="text-align: left;">MicroPDF417</td>
  2597. <td style="text-align: left;">Ultracode</td>
  2598. </tr>
  2599. </tbody>
  2600. </table>
  2601. </div>
  2602. <p>Be aware that not all barcode readers support ECI mode, so this can
  2603. sometimes lead to unreadable barcodes. If you are using characters
  2604. beyond those supported by the default character set then you should
  2605. check that the resulting barcode can be understood by your target
  2606. barcode reader.</p>
  2607. <p>The ECI value may be specified with the <code>--eci</code> switch,
  2608. followed by the value in the column <code>"ECI Code"</code> in the table
  2609. below. The input data should be UTF-8 formatted. Zint automatically
  2610. translates the data into the target encoding.</p>
  2611. <div id="tbl:eci_codes" class="tablenos">
  2612. <table id="tbl:eci_codes" data-tag=": ECI Codes">
  2613. <caption><span>Table : ECI Codes</span> </caption>
  2614. <thead>
  2615. <tr>
  2616. <th>ECI Code</th>
  2617. <th>Character Encoding Scheme (ISO/IEC 8859 schemes include ASCII)</th>
  2618. </tr>
  2619. </thead>
  2620. <tbody>
  2621. <tr>
  2622. <td>3</td>
  2623. <td>ISO/IEC 8859-1 - Latin alphabet No. 1</td>
  2624. </tr>
  2625. <tr>
  2626. <td>4</td>
  2627. <td>ISO/IEC 8859-2 - Latin alphabet No. 2</td>
  2628. </tr>
  2629. <tr>
  2630. <td>5</td>
  2631. <td>ISO/IEC 8859-3 - Latin alphabet No. 3</td>
  2632. </tr>
  2633. <tr>
  2634. <td>6</td>
  2635. <td>ISO/IEC 8859-4 - Latin alphabet No. 4</td>
  2636. </tr>
  2637. <tr>
  2638. <td>7</td>
  2639. <td>ISO/IEC 8859-5 - Latin/Cyrillic alphabet</td>
  2640. </tr>
  2641. <tr>
  2642. <td>8</td>
  2643. <td>ISO/IEC 8859-6 - Latin/Arabic alphabet</td>
  2644. </tr>
  2645. <tr>
  2646. <td>9</td>
  2647. <td>ISO/IEC 8859-7 - Latin/Greek alphabet</td>
  2648. </tr>
  2649. <tr>
  2650. <td>10</td>
  2651. <td>ISO/IEC 8859-8 - Latin/Hebrew alphabet</td>
  2652. </tr>
  2653. <tr>
  2654. <td>11</td>
  2655. <td>ISO/IEC 8859-9 - Latin alphabet No. 5 (Turkish)</td>
  2656. </tr>
  2657. <tr>
  2658. <td>12</td>
  2659. <td>ISO/IEC 8859-10 - Latin alphabet No. 6 (Nordic)</td>
  2660. </tr>
  2661. <tr>
  2662. <td>13</td>
  2663. <td>ISO/IEC 8859-11 - Latin/Thai alphabet</td>
  2664. </tr>
  2665. <tr>
  2666. <td>15</td>
  2667. <td>ISO/IEC 8859-13 - Latin alphabet No. 7 (Baltic)</td>
  2668. </tr>
  2669. <tr>
  2670. <td>16</td>
  2671. <td>ISO/IEC 8859-14 - Latin alphabet No. 8 (Celtic)</td>
  2672. </tr>
  2673. <tr>
  2674. <td>17</td>
  2675. <td>ISO/IEC 8859-15 - Latin alphabet No. 9</td>
  2676. </tr>
  2677. <tr>
  2678. <td>18</td>
  2679. <td>ISO/IEC 8859-16 - Latin alphabet No. 10</td>
  2680. </tr>
  2681. <tr>
  2682. <td>20</td>
  2683. <td>Shift JIS (JIS X 0208 and JIS X 0201)</td>
  2684. </tr>
  2685. <tr>
  2686. <td>21</td>
  2687. <td>Windows 1250 - Latin 2 (Central Europe)</td>
  2688. </tr>
  2689. <tr>
  2690. <td>22</td>
  2691. <td>Windows 1251 - Cyrillic</td>
  2692. </tr>
  2693. <tr>
  2694. <td>23</td>
  2695. <td>Windows 1252 - Latin 1</td>
  2696. </tr>
  2697. <tr>
  2698. <td>24</td>
  2699. <td>Windows 1256 - Arabic</td>
  2700. </tr>
  2701. <tr>
  2702. <td>25</td>
  2703. <td>UTF-16BE (High order byte first)</td>
  2704. </tr>
  2705. <tr>
  2706. <td>26</td>
  2707. <td>UTF-8</td>
  2708. </tr>
  2709. <tr>
  2710. <td>27</td>
  2711. <td>ASCII (ISO/IEC 646 IRV)</td>
  2712. </tr>
  2713. <tr>
  2714. <td>28</td>
  2715. <td>Big5 (Taiwan) Chinese Character Set</td>
  2716. </tr>
  2717. <tr>
  2718. <td>29</td>
  2719. <td>GB 2312 (PRC) Chinese Character Set</td>
  2720. </tr>
  2721. <tr>
  2722. <td>30</td>
  2723. <td>Korean Character Set EUC-KR (KS X 1001:2002)</td>
  2724. </tr>
  2725. <tr>
  2726. <td>31</td>
  2727. <td>GBK Chinese Character Set</td>
  2728. </tr>
  2729. <tr>
  2730. <td>32</td>
  2731. <td>GB 18030 Chinese Character Set</td>
  2732. </tr>
  2733. <tr>
  2734. <td>33</td>
  2735. <td>UTF-16LE (Low order byte first)</td>
  2736. </tr>
  2737. <tr>
  2738. <td>34</td>
  2739. <td>UTF-32BE (High order bytes first)</td>
  2740. </tr>
  2741. <tr>
  2742. <td>35</td>
  2743. <td>UTF-32LE (Low order bytes first)</td>
  2744. </tr>
  2745. <tr>
  2746. <td>170</td>
  2747. <td>ISO/IEC 646 Invariant<a href="#fn6" class="footnote-ref" id="fnref6"
  2748. role="doc-noteref"><sup>6</sup></a></td>
  2749. </tr>
  2750. <tr>
  2751. <td>899</td>
  2752. <td>8-bit binary data</td>
  2753. </tr>
  2754. </tbody>
  2755. </table>
  2756. </div>
  2757. <p>An ECI value of 0 does not encode any ECI information in the code
  2758. symbol (unless the data contains non-default character set characters).
  2759. In this case, the default character set applies (see Table <a
  2760. href="#tbl:default_character_sets">: Default Character Sets</a>
  2761. above).</p>
  2762. <p>If no ECI is specified or a value of 0 is given, and the data does
  2763. contain characters other than in the default character set, then Zint
  2764. will automatically insert the appropriate single-byte ECI if possible
  2765. (ECIs 3 to 24, excluding ECI 20), or failing that ECI 26 (UTF-8). A
  2766. warning will be generated. This mechanism is not applied if the
  2767. <code>--binary</code> option is given.</p>
  2768. <p>Multiple ECIs can be specified using the <code>--segN</code> options
  2769. - see <a href="#multiple-segments">4.16 Multiple Segments</a>.</p>
  2770. <p>Note: the <code>--eci=3</code> specification should only be used for
  2771. special purposes. Using this parameter, the ECI information is
  2772. explicitly added to the symbol. Nevertheless, for ECI Code 3, this is
  2773. not usually required, as this is the default encoding for most barcodes,
  2774. which is also active without any ECI information.</p>
  2775. <h4 id="input-modes-and-eci-example-1">4.11.2.1 Input Modes and ECI
  2776. Example 1</h4>
  2777. <p>The Euro sign U+20AC can be encoded in ISO/IEC 8859-15. The Euro sign
  2778. has the ISO/IEC 8859-15 codepoint hex <code>"A4"</code>. It is encoded
  2779. in UTF-8 as the hex sequence: <code>"E2 82 AC"</code>. Those 3 bytes are
  2780. contained in the file <code>"utf8euro.txt"</code>. This command will
  2781. generate the corresponding code:</p>
  2782. <div class="sourceCode" id="cb42"><pre
  2783. class="sourceCode bash"><code class="sourceCode bash"><span id="cb42-1"><a href="#cb42-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">-i</span> utf8euro.txt</span></code></pre></div>
  2784. <p>This is equivalent to the commands (using the <code>--esc</code>
  2785. switch):</p>
  2786. <div class="sourceCode" id="cb43"><pre
  2787. class="sourceCode bash"><code class="sourceCode bash"><span id="cb43-1"><a href="#cb43-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">&quot;\xE2\x82\xAC&quot;</span></span>
  2788. <span id="cb43-2"><a href="#cb43-2" aria-hidden="true" tabindex="-1"></a></span>
  2789. <span id="cb43-3"><a href="#cb43-3" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">&quot;\u20AC&quot;</span></span></code></pre></div>
  2790. <p>and to the command:</p>
  2791. <div class="sourceCode" id="cb44"><pre
  2792. class="sourceCode bash"><code class="sourceCode bash"><span id="cb44-1"><a href="#cb44-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">-d</span> <span class="st">&quot;€&quot;</span></span></code></pre></div>
  2793. <figure>
  2794. <img src="images/datamatrix_euro.svg" title="fig:" class="i2d"
  2795. alt="zint -b DATAMATRIX --eci=17 -d &quot;€&quot;" />
  2796. <figcaption
  2797. aria-hidden="true"><code>zint -b DATAMATRIX --eci=17 -d "€"</code></figcaption>
  2798. </figure>
  2799. <h4 id="input-modes-and-eci-example-2">4.11.2.2 Input Modes and ECI
  2800. Example 2</h4>
  2801. <p>The Chinese character with the Unicode codepoint U+5E38 can be
  2802. encoded in Big5 encoding. The Big5 representation of this character is
  2803. the two hex bytes: <code>"B1 60"</code> (contained in the file
  2804. <code>"big5char.txt"</code>). The generation command for Data Matrix
  2805. is:</p>
  2806. <div class="sourceCode" id="cb45"><pre
  2807. class="sourceCode bash"><code class="sourceCode bash"><span id="cb45-1"><a href="#cb45-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--binary</span> <span class="at">-i</span> big5char.txt</span></code></pre></div>
  2808. <p>This is equivalent to the command (using the <code>--esc</code>
  2809. switch):</p>
  2810. <div class="sourceCode" id="cb46"><pre
  2811. class="sourceCode bash"><code class="sourceCode bash"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--binary</span> <span class="at">--esc</span> <span class="at">-d</span> <span class="st">&quot;\xB1\x60&quot;</span></span></code></pre></div>
  2812. <p>and to the commands (no <code>--binary</code> switch so conversion
  2813. occurs):</p>
  2814. <div class="sourceCode" id="cb47"><pre
  2815. class="sourceCode bash"><code class="sourceCode bash"><span id="cb47-1"><a href="#cb47-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">&quot;\xE5\xB8\xB8&quot;</span></span>
  2816. <span id="cb47-2"><a href="#cb47-2" aria-hidden="true" tabindex="-1"></a></span>
  2817. <span id="cb47-3"><a href="#cb47-3" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">&quot;\u5E38&quot;</span></span>
  2818. <span id="cb47-4"><a href="#cb47-4" aria-hidden="true" tabindex="-1"></a></span>
  2819. <span id="cb47-5"><a href="#cb47-5" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">-d</span> <span class="st">&quot;常&quot;</span></span></code></pre></div>
  2820. <figure>
  2821. <img src="images/datamatrix_big5.svg" title="fig:" class="i2d"
  2822. alt="zint -b DATAMATRIX --eci=28 -d &quot;\u5E38&quot; --esc" />
  2823. <figcaption
  2824. aria-hidden="true"><code>zint -b DATAMATRIX --eci=28 -d "\u5E38" --esc</code></figcaption>
  2825. </figure>
  2826. <h4 id="input-modes-and-eci-example-3">4.11.2.3 Input Modes and ECI
  2827. Example 3</h4>
  2828. <p>Some decoders (in particular mobile app ones) for QR Code assume
  2829. UTF-8 encoding by default and do not support ECI. In this case supply
  2830. UTF-8 data and use the <code>--binary</code> switch so that the data
  2831. will be encoded as UTF-8 without conversion:</p>
  2832. <div class="sourceCode" id="cb48"><pre
  2833. class="sourceCode bash"><code class="sourceCode bash"><span id="cb48-1"><a href="#cb48-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 58 <span class="at">--binary</span> <span class="at">-d</span> <span class="st">&quot;UTF-8 data&quot;</span></span></code></pre></div>
  2834. <figure>
  2835. <img src="images/qrcode_binary_utf8.svg" title="fig:" class="i2d"
  2836. alt="zint -b QRCODE --binary -d &quot;\xE2\x82\xAC\xE5\xB8\xB8&quot; --esc" />
  2837. <figcaption
  2838. aria-hidden="true"><code>zint -b QRCODE --binary -d "\xE2\x82\xAC\xE5\xB8\xB8" --esc</code></figcaption>
  2839. </figure>
  2840. <h2 id="batch-processing">4.12 Batch Processing</h2>
  2841. <p>Data can be batch processed by reading from a text file and producing
  2842. a separate barcode image for each line of text in that file. To do this
  2843. use the <code>--batch</code> switch together with <code>-i</code> to
  2844. select the input file from which to read data. For example</p>
  2845. <div class="sourceCode" id="cb49"><pre
  2846. class="sourceCode bash"><code class="sourceCode bash"><span id="cb49-1"><a href="#cb49-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">--batch</span> <span class="at">-i</span> ean13nos.txt</span></code></pre></div>
  2847. <p>where <code>"ean13nos.txt"</code> contains a list of EAN-13 numbers
  2848. (GTINs), each on its own line. Zint will automatically detect the end of
  2849. a line of text (in either Unix or Windows formatted text files) and
  2850. produce a symbol each time it finds this.</p>
  2851. <p>Input files should end with a line feed character - if this is not
  2852. present then Zint will not encode the last line of text, and will warn
  2853. you that there is a problem.</p>
  2854. <p>By default Zint will output numbered filenames starting with
  2855. <code>00001.png</code>, <code>00002.png</code> etc. To change this
  2856. behaviour specify the <code>-o</code> option using special characters in
  2857. the output filename as shown in the table below:</p>
  2858. <div id="tbl:batch_filename_formatting" class="tablenos">
  2859. <table id="tbl:batch_filename_formatting"
  2860. data-tag=": Batch Filename Formatting">
  2861. <caption><span>Table : Batch Filename Formatting</span> </caption>
  2862. <thead>
  2863. <tr>
  2864. <th>Input Character</th>
  2865. <th style="text-align: left;">Interpretation</th>
  2866. </tr>
  2867. </thead>
  2868. <tbody>
  2869. <tr>
  2870. <td><code>~</code></td>
  2871. <td style="text-align: left;">Insert a number or 0</td>
  2872. </tr>
  2873. <tr>
  2874. <td><code>#</code></td>
  2875. <td style="text-align: left;">Insert a number or space</td>
  2876. </tr>
  2877. <tr>
  2878. <td><code>@</code></td>
  2879. <td style="text-align: left;">Insert a number or <code>*</code> (or
  2880. <code>+</code> on Windows)</td>
  2881. </tr>
  2882. <tr>
  2883. <td>Any other</td>
  2884. <td style="text-align: left;">Insert literally</td>
  2885. </tr>
  2886. </tbody>
  2887. </table>
  2888. </div>
  2889. <p>For instance</p>
  2890. <div class="sourceCode" id="cb50"><pre
  2891. class="sourceCode bash"><code class="sourceCode bash"><span id="cb50-1"><a href="#cb50-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">--batch</span> <span class="at">-i</span> ean13nos.txt <span class="at">-o</span> file~~~.svg</span></code></pre></div>
  2892. <p>The following table shows some examples to clarify this method:</p>
  2893. <div id="tbl:batch_filename_examples" class="tablenos">
  2894. <table id="tbl:batch_filename_examples"
  2895. data-tag=": Batch Filename Examples">
  2896. <caption><span>Table : Batch Filename Examples</span> </caption>
  2897. <thead>
  2898. <tr>
  2899. <th style="text-align: left;">Input</th>
  2900. <th style="text-align: left;">Filenames Generated</th>
  2901. </tr>
  2902. </thead>
  2903. <tbody>
  2904. <tr>
  2905. <td style="text-align: left;"><code>-o file~~~.svg</code></td>
  2906. <td style="text-align: left;"><code>"file001.svg"</code>,
  2907. <code>"file002.svg"</code>, <code>"file003.svg"</code></td>
  2908. </tr>
  2909. <tr>
  2910. <td style="text-align: left;"><code>-o @@@@bar.png</code></td>
  2911. <td style="text-align: left;"><code>"***1.png"</code>,
  2912. <code>"***2.png"</code>, <code>"***3.png"</code> (except Windows)</td>
  2913. </tr>
  2914. <tr>
  2915. <td style="text-align: left;"><code>-o @@@@bar.png</code></td>
  2916. <td style="text-align: left;"><code>"+++1.png"</code>,
  2917. <code>"+++2.png"</code>, <code>"+++3.png"</code> (on Windows)</td>
  2918. </tr>
  2919. <tr>
  2920. <td style="text-align: left;"><code>-o my~~~bar.eps</code></td>
  2921. <td style="text-align: left;"><code>"my001bar.eps"</code>,
  2922. <code>"my002bar.eps"</code>, <code>"my003bar.eps"</code></td>
  2923. </tr>
  2924. <tr>
  2925. <td style="text-align: left;"><code>-o t#es~t~.png</code></td>
  2926. <td style="text-align: left;"><code>"t es0t1.png"</code>,
  2927. <code>"t es0t2.png"</code>, <code>"t es0t3.png"</code></td>
  2928. </tr>
  2929. </tbody>
  2930. </table>
  2931. </div>
  2932. <p>The special characters can span directories also, which is useful
  2933. when creating a large number of barcodes:</p>
  2934. <div id="tbl:batch_dir_examples" class="tablenos">
  2935. <table id="tbl:batch_dir_examples"
  2936. data-tag=": Batch Directory Examples">
  2937. <caption><span>Table : Batch Directory Examples</span> </caption>
  2938. <thead>
  2939. <tr>
  2940. <th style="text-align: left;">Input</th>
  2941. <th style="text-align: left;">Filenames Generated</th>
  2942. </tr>
  2943. </thead>
  2944. <tbody>
  2945. <tr>
  2946. <td style="text-align: left;"><code>-o dir~/file~~~.svg</code></td>
  2947. <td style="text-align: left;"><code>"dir0/file001.svg"</code>,
  2948. <code>"dir0/file002.svg"</code>, …</td>
  2949. </tr>
  2950. <tr>
  2951. <td style="text-align: left;"></td>
  2952. <td style="text-align: left;">, <code>"dir0/file999.svg"</code>,
  2953. <code>"dir1/file000.svg"</code>, …</td>
  2954. </tr>
  2955. </tbody>
  2956. </table>
  2957. </div>
  2958. <p>For an alternative method of naming output files see the
  2959. <code>--mirror</code> option in <a href="#automatic-filenames">4.14
  2960. Automatic Filenames</a> below.</p>
  2961. <h2 id="direct-output-to-stdout">4.13 Direct Output to stdout</h2>
  2962. <p>The finished image files can be output directly to stdout for use as
  2963. part of a pipe by using the <code>--direct</code> option. By default
  2964. <code>--direct</code> will output data as a PNG image (or GIF image if
  2965. <code>libpng</code> is not present), but this can be altered by
  2966. supplementing the <code>--direct</code> option with a
  2967. <code>--filetype</code> option followed by the suffix of the file type
  2968. required. For example:</p>
  2969. <div class="sourceCode" id="cb51"><pre
  2970. class="sourceCode bash"><code class="sourceCode bash"><span id="cb51-1"><a href="#cb51-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 84 <span class="at">--direct</span> <span class="at">--filetype</span><span class="op">=</span>pcx <span class="at">-d</span> <span class="st">&quot;Data to encode&quot;</span></span></code></pre></div>
  2971. <p>This command will output the symbol as a PCX file to stdout. For the
  2972. supported output file formats see Table <a
  2973. href="#tbl:output_file_formats">: Output File Formats</a>.</p>
  2974. <hr />
  2975. <p>CAUTION: Outputting binary files to the command shell without
  2976. catching that data in a pipe can have unpredictable results. Use with
  2977. care!</p>
  2978. <hr />
  2979. <h2 id="automatic-filenames">4.14 Automatic Filenames</h2>
  2980. <p>The <code>--mirror</code> option instructs Zint to use the data to be
  2981. encoded as an indicator of the filename to be used. This is particularly
  2982. useful if you are processing batch data. For example the input data
  2983. <code>"1234567"</code> will result in a file named
  2984. <code>"1234567.png"</code>.</p>
  2985. <p>There are restrictions, however, on what characters can be stored in
  2986. a filename, so the filename may vary from the data if the data includes
  2987. non-printable characters, for example, and may be shortened if the data
  2988. input is long.</p>
  2989. <p>To set the output file format use the <code>--filetype</code> option
  2990. as detailed above in <a href="#direct-output-to-stdout">4.13 Direct
  2991. Output to stdout</a>. To output to a specific directory use the
  2992. <code>-o</code> option giving the name of the directory (any filename
  2993. will be ignored, unless <code>--filetype</code> is not specified, in
  2994. which case the filename’s extension will be used).</p>
  2995. <h2 id="working-with-dots">4.15 Working with Dots</h2>
  2996. <p>Matrix codes can be rendered as a series of dots or circles rather
  2997. than the normal squares by using the <code>--dotty</code> option. This
  2998. option is only available for matrix symbologies, and is automatically
  2999. selected for DotCode. The size of the dots can be adjusted using the
  3000. <code>--dotsize</code> option followed by the diameter of the dot, where
  3001. that diameter is in X-dimensions. The minimum dot size is 0.01, the
  3002. maximum is 20. The default size is 0.8.</p>
  3003. <p>The default and minimum scale for raster output in dotty mode is
  3004. 1.</p>
  3005. <figure>
  3006. <img src="images/codeone_s_dotty.svg" title="fig:" class="dotty"
  3007. alt="zint -b CODEONE -d &quot;123456789012345678&quot; --dotty --vers=9" />
  3008. <figcaption
  3009. aria-hidden="true"><code>zint -b CODEONE -d "123456789012345678" --dotty --vers=9</code></figcaption>
  3010. </figure>
  3011. <h2 id="multiple-segments">4.16 Multiple Segments</h2>
  3012. <p>If you need to specify different ECIs for different sections of the
  3013. input data, the <code>--seg1</code> to <code>--seg9</code> options can
  3014. be used. Each option is of the form <code>--segN=ECI,data</code> where
  3015. <code>ECI</code> is the ECI code (see Table <a href="#tbl:eci_codes">:
  3016. ECI Codes</a>) and <code>data</code> is the data to which this applies.
  3017. This is in addition to the ECI and data specified using the
  3018. <code>--eci</code> and <code>-d</code> options which must still be
  3019. present and which in effect constitute segment 0. For instance</p>
  3020. <div class="sourceCode" id="cb52"><pre
  3021. class="sourceCode bash"><code class="sourceCode bash"><span id="cb52-1"><a href="#cb52-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> AZTEC_CODE <span class="at">--eci</span><span class="op">=</span>9 <span class="at">-d</span> <span class="st">&quot;Κείμενο&quot;</span> <span class="at">--seg1</span><span class="op">=</span>7,<span class="st">&quot;Текст&quot;</span> <span class="at">--seg2</span><span class="op">=</span>20,<span class="st">&quot;文章&quot;</span></span></code></pre></div>
  3022. <p>specifies 3 segments: segment 0 with ECI 9 (Greek), segment 1 with
  3023. ECI 7 (Cyrillic), and segment 2 with ECI 20 (Shift JIS). Segments must
  3024. be consecutive.</p>
  3025. <p>Naturally the symbology must be ECI-aware (see Table <a
  3026. href="#tbl:eci_aware_symbologies">: ECI-Aware Symbologies</a>).</p>
  3027. <figure>
  3028. <img src="images/aztec_segs.svg" title="fig:" class="i2d"
  3029. alt="zint -b AZTEC --eci=9 -d &quot;Κείμενο&quot; --seg1=7,&quot;Текст&quot; --seg2=20,&quot;文章&quot;" />
  3030. <figcaption
  3031. aria-hidden="true"><code>zint -b AZTEC --eci=9 -d "Κείμενο" --seg1=7,"Текст" --seg2=20,"文章"</code></figcaption>
  3032. </figure>
  3033. <p>ECIs of zero may be given, in which case Zint will automatically
  3034. determine an ECI if necessary, as described in section <a
  3035. href="#input-modes-and-eci">4.11.2 Input Modes and ECI</a>.</p>
  3036. <p>Multiple segments are not currently supported for use with GS1
  3037. data.</p>
  3038. <h2 id="structured-append">4.17 Structured Append</h2>
  3039. <p>Structured Append is a method of splitting data among several symbols
  3040. so that they form a sequence that can be scanned and re-assembled in the
  3041. correct order on reading, and is available for Aztec Code, Code One,
  3042. Data Matrix, DotCode, Grid Matrix, MaxiCode, MicroPDF417, PDF417, QR
  3043. Code and Ultracode.</p>
  3044. <p>The <code>--structapp</code> option marks a symbol as part of a
  3045. Structured Append sequence, and has the format</p>
  3046. <pre><code>--structapp=I,C[,ID]</code></pre>
  3047. <figure>
  3048. <img src="images/datamatrix_structapp.svg" title="fig:" class="i2d"
  3049. alt="zint -b DATAMATRIX -d &quot;2nd of 3&quot; --structapp=&quot;2,3,5006&quot;" />
  3050. <figcaption
  3051. aria-hidden="true"><code>zint -b DATAMATRIX -d "2nd of 3" --structapp="2,3,5006"</code></figcaption>
  3052. </figure>
  3053. <p>where <code>I</code> is the index (position) of the symbol in the
  3054. Structured Append sequence, <code>C</code> is the count or total number
  3055. of symbols in the sequence, and <code>ID</code> is an optional
  3056. identifier (not available for Code One, DotCode or MaxiCode) that is the
  3057. same for all symbols belonging to the same sequence. The index is
  3058. 1-based and goes from 1 to count. Count must be 2 or more. See the
  3059. individual symbologies for further details.</p>
  3060. <h2 id="help-options">4.18 Help Options</h2>
  3061. <p>There are three help options which give information about how to use
  3062. the command line. The <code>-h</code> or <code>--help</code> option will
  3063. display a list of all of the valid options available, and also gives the
  3064. exact version of the software (the version by itself can be displayed
  3065. with <code>-v</code> or <code>--version</code>).</p>
  3066. <p>The <code>-t</code> or <code>--types</code> option gives the table of
  3067. symbologies along with the symbol ID numbers and names.</p>
  3068. <p>The <code>-e</code> or <code>--ecinos</code> option gives a list of
  3069. the ECI codes.</p>
  3070. <h2 id="other-options">4.19 Other Options</h2>
  3071. <p>Zint can output a representation of the symbol data as a set of
  3072. hexadecimal values if asked to output to a text file
  3073. (<code>"*.txt"</code>) or if given the option
  3074. <code>--filetype=txt</code>. This can be used for test and diagnostic
  3075. purposes.</p>
  3076. <p>Additional options are available which are specific to certain
  3077. symbologies. These may, for example, control the amount of error
  3078. correction data or the size of the symbol. These options are discussed
  3079. in section <a href="#types-of-symbology">6. Types of Symbology</a> of
  3080. this guide.</p>
  3081. <h1 id="using-the-api">5. Using the API</h1>
  3082. <p>Zint has been written using the C language and has an API for use
  3083. with C/C++ language programs. A Qt interface (see <a
  3084. href="#annex-b.-qt-backend-qzint">Annex B. Qt Backend QZint</a>) is
  3085. available in the <code>"backend_qt"</code> sub-directory, and a Tcl
  3086. interface is available in the <code>"backend_tcl"</code> sub-directory
  3087. (see <a href="#annex-c.-tcl-backend-binding">Annex C. Tcl Backend
  3088. Binding</a>).</p>
  3089. <p>The <code>libzint</code> API has been designed to be very similar to
  3090. that used by the GNU Barcode package. This allows easy migration from
  3091. GNU Barcode to Zint. Zint, however, uses none of the same function names
  3092. or option names as GNU Barcode. This allows you to use both packages in
  3093. your application without conflict if you wish.</p>
  3094. <h2 id="creating-and-deleting-symbols">5.1 Creating and Deleting
  3095. Symbols</h2>
  3096. <p>The symbols manipulated by Zint are held in a
  3097. <code>zint_symbol</code> structure defined in <code>"zint.h"</code>.
  3098. These symbol structures are created with the
  3099. <code>ZBarcode_Create()</code> function and deleted using the
  3100. <code>ZBarcode_Delete()</code> function. For example the following code
  3101. creates and then deletes a symbol:</p>
  3102. <div class="sourceCode" id="cb54"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb54-1"><a href="#cb54-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
  3103. <span id="cb54-2"><a href="#cb54-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;stdio.h&gt;</span></span>
  3104. <span id="cb54-3"><a href="#cb54-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">()</span></span>
  3105. <span id="cb54-4"><a href="#cb54-4" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
  3106. <span id="cb54-5"><a href="#cb54-5" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
  3107. <span id="cb54-6"><a href="#cb54-6" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
  3108. <span id="cb54-7"><a href="#cb54-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>my_symbol <span class="op">!=</span> NULL<span class="op">)</span> <span class="op">{</span></span>
  3109. <span id="cb54-8"><a href="#cb54-8" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;Symbol successfully created!</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
  3110. <span id="cb54-9"><a href="#cb54-9" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
  3111. <span id="cb54-10"><a href="#cb54-10" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
  3112. <span id="cb54-11"><a href="#cb54-11" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
  3113. <span id="cb54-12"><a href="#cb54-12" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  3114. <p>When compiling this code it will need to be linked with the
  3115. <code>libzint</code> library using the <code>-lzint</code> option:</p>
  3116. <div class="sourceCode" id="cb55"><pre
  3117. class="sourceCode bash"><code class="sourceCode bash"><span id="cb55-1"><a href="#cb55-1" aria-hidden="true" tabindex="-1"></a><span class="fu">gcc</span> <span class="at">-o</span> simple simple.c <span class="at">-lzint</span></span></code></pre></div>
  3118. <h2 id="encoding-and-saving-to-file">5.2 Encoding and Saving to
  3119. File</h2>
  3120. <p>To encode data in a barcode use the <code>ZBarcode_Encode()</code>
  3121. function. To write the symbol to a file use the
  3122. <code>ZBarcode_Print()</code> function. For example the following code
  3123. takes a string from the command line and outputs a Code 128 symbol to a
  3124. PNG file named <code>"out.png"</code> (or a GIF file
  3125. <code>"out.gif"</code> if <code>libpng</code> is not present) in the
  3126. current working directory:</p>
  3127. <div class="sourceCode" id="cb56"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb56-1"><a href="#cb56-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
  3128. <span id="cb56-2"><a href="#cb56-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
  3129. <span id="cb56-3"><a href="#cb56-3" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
  3130. <span id="cb56-4"><a href="#cb56-4" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
  3131. <span id="cb56-5"><a href="#cb56-5" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
  3132. <span id="cb56-6"><a href="#cb56-6" aria-hidden="true" tabindex="-1"></a> ZBarcode_Encode<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">);</span></span>
  3133. <span id="cb56-7"><a href="#cb56-7" aria-hidden="true" tabindex="-1"></a> ZBarcode_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
  3134. <span id="cb56-8"><a href="#cb56-8" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
  3135. <span id="cb56-9"><a href="#cb56-9" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
  3136. <span id="cb56-10"><a href="#cb56-10" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  3137. <p>This can also be done in one stage using the
  3138. <code>ZBarcode_Encode_and_Print()</code> function as shown in the next
  3139. example:</p>
  3140. <div class="sourceCode" id="cb57"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb57-1"><a href="#cb57-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
  3141. <span id="cb57-2"><a href="#cb57-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
  3142. <span id="cb57-3"><a href="#cb57-3" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
  3143. <span id="cb57-4"><a href="#cb57-4" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
  3144. <span id="cb57-5"><a href="#cb57-5" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
  3145. <span id="cb57-6"><a href="#cb57-6" aria-hidden="true" tabindex="-1"></a> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
  3146. <span id="cb57-7"><a href="#cb57-7" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
  3147. <span id="cb57-8"><a href="#cb57-8" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
  3148. <span id="cb57-9"><a href="#cb57-9" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  3149. <p>Note that when using the API, the input data is assumed to be 8-bit
  3150. binary unless the <code>input_mode</code> member of the
  3151. <code>zint_symbol</code> structure is set - see <a
  3152. href="#setting-the-input-mode">5.11 Setting the Input Mode</a> for
  3153. details.</p>
  3154. <h2 id="encoding-and-printing-functions-in-depth">5.3 Encoding and
  3155. Printing Functions in Depth</h2>
  3156. <p>The functions for encoding and printing barcodes are defined as:</p>
  3157. <div class="sourceCode" id="cb58"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb58-1"><a href="#cb58-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  3158. <span id="cb58-2"><a href="#cb58-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">);</span></span>
  3159. <span id="cb58-3"><a href="#cb58-3" aria-hidden="true" tabindex="-1"></a></span>
  3160. <span id="cb58-4"><a href="#cb58-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  3161. <span id="cb58-5"><a href="#cb58-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">);</span></span>
  3162. <span id="cb58-6"><a href="#cb58-6" aria-hidden="true" tabindex="-1"></a></span>
  3163. <span id="cb58-7"><a href="#cb58-7" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
  3164. <span id="cb58-8"><a href="#cb58-8" aria-hidden="true" tabindex="-1"></a></span>
  3165. <span id="cb58-9"><a href="#cb58-9" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_and_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  3166. <span id="cb58-10"><a href="#cb58-10" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
  3167. <span id="cb58-11"><a href="#cb58-11" aria-hidden="true" tabindex="-1"></a></span>
  3168. <span id="cb58-12"><a href="#cb58-12" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File_and_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  3169. <span id="cb58-13"><a href="#cb58-13" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div>
  3170. <p>In these definitions <code>length</code> can be used to set the
  3171. length of the input string. This allows the encoding of <code>NUL</code>
  3172. (ASCII 0) characters in those symbologies which allow this. A value of 0
  3173. (or less than 0) will disable this usage and Zint will encode data up to
  3174. the first <code>NUL</code> character in the input string, which must be
  3175. present.</p>
  3176. <p>The <code>rotate_angle</code> value can be used to rotate the image
  3177. when outputting. Valid values are 0, 90, 180 and 270.</p>
  3178. <p>The <code>ZBarcode_Encode_File()</code> and
  3179. <code>ZBarcode_Encode_File_and_Print()</code> functions can be used to
  3180. encode data read directly from a text file where the filename is given
  3181. in the <code>NUL</code>-terminated <code>filename</code> string. The
  3182. special filename <code>"-"</code> (single hyphen) can be used to read
  3183. from stdin. Note that on Windows, filenames are assumed to be UTF-8
  3184. encoded.</p>
  3185. <p>If printing more than one barcode, the <code>zint_symbol</code>
  3186. structure may be re-used by calling the <code>ZBarcode_Clear()</code>
  3187. function after each barcode to free any output buffers allocated. The
  3188. <code>zint_symbol</code> input members must be reset. To fully restore
  3189. <code>zint_symbol</code> to its default state, call
  3190. <code>ZBarcode_Reset()</code> instead.</p>
  3191. <h2 id="buffering-symbols-in-memory-raster">5.4 Buffering Symbols in
  3192. Memory (raster)</h2>
  3193. <p>In addition to saving barcode images to file Zint allows you to
  3194. access a representation of the resulting bitmap image in memory. The
  3195. following functions allow you to do this:</p>
  3196. <div class="sourceCode" id="cb59"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb59-1"><a href="#cb59-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
  3197. <span id="cb59-2"><a href="#cb59-2" aria-hidden="true" tabindex="-1"></a></span>
  3198. <span id="cb59-3"><a href="#cb59-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_and_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  3199. <span id="cb59-4"><a href="#cb59-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
  3200. <span id="cb59-5"><a href="#cb59-5" aria-hidden="true" tabindex="-1"></a></span>
  3201. <span id="cb59-6"><a href="#cb59-6" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File_and_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  3202. <span id="cb59-7"><a href="#cb59-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div>
  3203. <p>The arguments here are the same as above, and rotation and colour
  3204. options can be used with the buffer functions in the same way as when
  3205. saving to a file. The difference is that instead of saving the image to
  3206. a file it is placed in a byte (<code>unsigned char</code>) array pointed
  3207. to by the <code>bitmap</code> member, with <code>bitmap_width</code> set
  3208. to the number of columns and <code>bitmap_height</code> set to the
  3209. number of rows.</p>
  3210. <p>The RGB channels are split into 3 consecutive red, green, blue bytes
  3211. per pixel, and there are <code>bitmap_width</code> pixels per row and
  3212. <code>bitmap_height</code> rows, so the total size of the
  3213. <code>bitmap</code> array is
  3214. <code>3 * bitmap_width * bitmap_height</code>.</p>
  3215. <p>If the background and/or foreground are RGBA then the byte array
  3216. <code>alphamap</code> will also be set, with a single alpha value for
  3217. each pixel. Its total size will be
  3218. <code>bitmap_width * bitmap_height</code>.</p>
  3219. <p>The pixel data can be extracted from the array (or arrays) by the
  3220. method shown in the example below, where <code>render_rgb()</code> and
  3221. <code>render_rgba()</code> are assumed to be functions for drawing an
  3222. RGB and RGBA pixel on the screen implemented by the client
  3223. application:</p>
  3224. <div class="sourceCode" id="cb60"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb60-1"><a href="#cb60-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> row<span class="op">,</span> col<span class="op">,</span> i <span class="op">=</span> <span class="dv">0</span><span class="op">,</span> j <span class="op">=</span> <span class="dv">0</span><span class="op">;</span></span>
  3225. <span id="cb60-2"><a href="#cb60-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> red<span class="op">,</span> blue<span class="op">,</span> green<span class="op">,</span> alpha<span class="op">;</span></span>
  3226. <span id="cb60-3"><a href="#cb60-3" aria-hidden="true" tabindex="-1"></a></span>
  3227. <span id="cb60-4"><a href="#cb60-4" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>row <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> row <span class="op">&lt;</span> my_symbol<span class="op">-&gt;</span>bitmap_height<span class="op">;</span> row<span class="op">++)</span> <span class="op">{</span></span>
  3228. <span id="cb60-5"><a href="#cb60-5" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> <span class="op">(</span>col <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> col <span class="op">&lt;</span> my_symbol<span class="op">-&gt;</span>bitmap_width<span class="op">;</span> col<span class="op">++)</span> <span class="op">{</span></span>
  3229. <span id="cb60-6"><a href="#cb60-6" aria-hidden="true" tabindex="-1"></a> red <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-&gt;</span>bitmap<span class="op">[</span>i<span class="op">];</span></span>
  3230. <span id="cb60-7"><a href="#cb60-7" aria-hidden="true" tabindex="-1"></a> green <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-&gt;</span>bitmap<span class="op">[</span>i <span class="op">+</span> <span class="dv">1</span><span class="op">];</span></span>
  3231. <span id="cb60-8"><a href="#cb60-8" aria-hidden="true" tabindex="-1"></a> blue <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-&gt;</span>bitmap<span class="op">[</span>i <span class="op">+</span> <span class="dv">2</span><span class="op">];</span></span>
  3232. <span id="cb60-9"><a href="#cb60-9" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>my_symbol<span class="op">-&gt;</span>alphamap<span class="op">)</span> <span class="op">{</span></span>
  3233. <span id="cb60-10"><a href="#cb60-10" aria-hidden="true" tabindex="-1"></a> alpha <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-&gt;</span>alphamap<span class="op">[</span>j<span class="op">];</span></span>
  3234. <span id="cb60-11"><a href="#cb60-11" aria-hidden="true" tabindex="-1"></a> render_rgba<span class="op">(</span>row<span class="op">,</span> col<span class="op">,</span> red<span class="op">,</span> green<span class="op">,</span> blue<span class="op">,</span> alpha<span class="op">);</span></span>
  3235. <span id="cb60-12"><a href="#cb60-12" aria-hidden="true" tabindex="-1"></a> j<span class="op">++;</span></span>
  3236. <span id="cb60-13"><a href="#cb60-13" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span>
  3237. <span id="cb60-14"><a href="#cb60-14" aria-hidden="true" tabindex="-1"></a> render_rgb<span class="op">(</span>row<span class="op">,</span> col<span class="op">,</span> red<span class="op">,</span> green<span class="op">,</span> blue<span class="op">);</span></span>
  3238. <span id="cb60-15"><a href="#cb60-15" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
  3239. <span id="cb60-16"><a href="#cb60-16" aria-hidden="true" tabindex="-1"></a> i <span class="op">+=</span> <span class="dv">3</span><span class="op">;</span></span>
  3240. <span id="cb60-17"><a href="#cb60-17" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
  3241. <span id="cb60-18"><a href="#cb60-18" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  3242. <p>Where speed is important, the buffer can be returned instead in a
  3243. more compact intermediate form using the output option
  3244. <code>OUT_BUFFER_INTERMEDIATE</code>. Here each byte is an ASCII value:
  3245. <code>'1'</code> for foreground colour and <code>'0'</code> for
  3246. background colour, except for Ultracode, which also uses colour codes:
  3247. <code>'W'</code> for white, <code>'C'</code> for cyan, <code>'B'</code>
  3248. for blue, <code>'M'</code> for magenta, <code>'R'</code> for red,
  3249. <code>'Y'</code> for yellow, <code>'G'</code> for green, and
  3250. <code>'K'</code> for black. Alpha values are not reported
  3251. (<code>alphamap</code> will always be <code>NULL</code>). The loop for
  3252. accessing the data is then:</p>
  3253. <div class="sourceCode" id="cb61"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb61-1"><a href="#cb61-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> row<span class="op">,</span> col<span class="op">,</span> i <span class="op">=</span> <span class="dv">0</span><span class="op">;</span></span>
  3254. <span id="cb61-2"><a href="#cb61-2" aria-hidden="true" tabindex="-1"></a></span>
  3255. <span id="cb61-3"><a href="#cb61-3" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>row <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> row <span class="op">&lt;</span> my_symbol<span class="op">-&gt;</span>bitmap_height<span class="op">;</span> row<span class="op">++)</span> <span class="op">{</span></span>
  3256. <span id="cb61-4"><a href="#cb61-4" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> <span class="op">(</span>col <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> col <span class="op">&lt;</span> my_symbol<span class="op">-&gt;</span>bitmap_width<span class="op">;</span> col<span class="op">++)</span> <span class="op">{</span></span>
  3257. <span id="cb61-5"><a href="#cb61-5" aria-hidden="true" tabindex="-1"></a> render_pixel<span class="op">(</span>row<span class="op">,</span> col<span class="op">,</span> my_symbol<span class="op">-&gt;</span>bitmap<span class="op">[</span>i<span class="op">]);</span></span>
  3258. <span id="cb61-6"><a href="#cb61-6" aria-hidden="true" tabindex="-1"></a> i<span class="op">++;</span></span>
  3259. <span id="cb61-7"><a href="#cb61-7" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
  3260. <span id="cb61-8"><a href="#cb61-8" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  3261. <h2 id="buffering-symbols-in-memory-vector">5.5 Buffering Symbols in
  3262. Memory (vector)</h2>
  3263. <p>Symbols can also be saved to memory in a vector representation as
  3264. well as a bitmap one. The following functions, exactly analogous to the
  3265. ones above, allow you to do this:</p>
  3266. <div class="sourceCode" id="cb62"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb62-1"><a href="#cb62-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
  3267. <span id="cb62-2"><a href="#cb62-2" aria-hidden="true" tabindex="-1"></a></span>
  3268. <span id="cb62-3"><a href="#cb62-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_and_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  3269. <span id="cb62-4"><a href="#cb62-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
  3270. <span id="cb62-5"><a href="#cb62-5" aria-hidden="true" tabindex="-1"></a></span>
  3271. <span id="cb62-6"><a href="#cb62-6" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File_and_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  3272. <span id="cb62-7"><a href="#cb62-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div>
  3273. <p>Here the <code>vector</code> member is set to point to a
  3274. <code>zint_vector</code> header structure which contains pointers to
  3275. lists of structures representing the various elements of the barcode:
  3276. rectangles, hexagons, strings and circles. To draw the barcode, each of
  3277. the element types is iterated in turn, and using the information stored
  3278. is drawn by a rendering system. For instance, to draw a barcode using a
  3279. rendering system with <code>prepare_canvas()</code>,
  3280. <code>draw_rect()</code>, <code>draw_hexagon()</code>,
  3281. <code>draw_string()</code>, and <code>draw_circle()</code> routines
  3282. available:</p>
  3283. <div class="sourceCode" id="cb63"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb63-1"><a href="#cb63-1" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_rect <span class="op">*</span>rect<span class="op">;</span></span>
  3284. <span id="cb63-2"><a href="#cb63-2" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_hexagon <span class="op">*</span>hex<span class="op">;</span></span>
  3285. <span id="cb63-3"><a href="#cb63-3" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_string <span class="op">*</span>string<span class="op">;</span></span>
  3286. <span id="cb63-4"><a href="#cb63-4" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_circle <span class="op">*</span>circle<span class="op">;</span></span>
  3287. <span id="cb63-5"><a href="#cb63-5" aria-hidden="true" tabindex="-1"></a></span>
  3288. <span id="cb63-6"><a href="#cb63-6" aria-hidden="true" tabindex="-1"></a>prepare_canvas<span class="op">(</span>my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>width<span class="op">,</span> my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>height<span class="op">,</span></span>
  3289. <span id="cb63-7"><a href="#cb63-7" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-&gt;</span>scale<span class="op">,</span> my_symbol<span class="op">-&gt;</span>fgcolour<span class="op">,</span> my_symbol<span class="op">-&gt;</span>bgcolour<span class="op">,</span></span>
  3290. <span id="cb63-8"><a href="#cb63-8" aria-hidden="true" tabindex="-1"></a> rotate_angle<span class="op">);</span></span>
  3291. <span id="cb63-9"><a href="#cb63-9" aria-hidden="true" tabindex="-1"></a></span>
  3292. <span id="cb63-10"><a href="#cb63-10" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>rect <span class="op">=</span> my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>rectangles<span class="op">;</span> rect<span class="op">;</span> rect <span class="op">=</span> rect<span class="op">-&gt;</span>next<span class="op">)</span> <span class="op">{</span></span>
  3293. <span id="cb63-11"><a href="#cb63-11" aria-hidden="true" tabindex="-1"></a> draw_rect<span class="op">(</span>rect<span class="op">-&gt;</span>x<span class="op">,</span> rect<span class="op">-&gt;</span>y<span class="op">,</span> rect<span class="op">-&gt;</span>width<span class="op">,</span> rect<span class="op">-&gt;</span>height<span class="op">,</span></span>
  3294. <span id="cb63-12"><a href="#cb63-12" aria-hidden="true" tabindex="-1"></a> rect<span class="op">-&gt;</span>colour<span class="op">);</span></span>
  3295. <span id="cb63-13"><a href="#cb63-13" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span>
  3296. <span id="cb63-14"><a href="#cb63-14" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>hex <span class="op">=</span> my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>hexagons<span class="op">;</span> hex<span class="op">;</span> hex <span class="op">=</span> hex<span class="op">-&gt;</span>next<span class="op">)</span> <span class="op">{</span></span>
  3297. <span id="cb63-15"><a href="#cb63-15" aria-hidden="true" tabindex="-1"></a> draw_hexagon<span class="op">(</span>hex<span class="op">-&gt;</span>x<span class="op">,</span> hex<span class="op">-&gt;</span>y<span class="op">,</span> hex<span class="op">-&gt;</span>diameter<span class="op">,</span> hex<span class="op">-&gt;</span>rotation<span class="op">);</span></span>
  3298. <span id="cb63-16"><a href="#cb63-16" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span>
  3299. <span id="cb63-17"><a href="#cb63-17" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>string <span class="op">=</span> my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>strings<span class="op">;</span> string<span class="op">;</span> string <span class="op">=</span> string<span class="op">-&gt;</span>next<span class="op">)</span> <span class="op">{</span></span>
  3300. <span id="cb63-18"><a href="#cb63-18" aria-hidden="true" tabindex="-1"></a> draw_string<span class="op">(</span>string<span class="op">-&gt;</span>x<span class="op">,</span> string<span class="op">-&gt;</span>y<span class="op">,</span> string<span class="op">-&gt;</span>fsize<span class="op">,</span></span>
  3301. <span id="cb63-19"><a href="#cb63-19" aria-hidden="true" tabindex="-1"></a> string<span class="op">-&gt;</span>rotation<span class="op">,</span> string<span class="op">-&gt;</span>halign<span class="op">,</span></span>
  3302. <span id="cb63-20"><a href="#cb63-20" aria-hidden="true" tabindex="-1"></a> string<span class="op">-&gt;</span>text<span class="op">,</span> string<span class="op">-&gt;</span>length<span class="op">);</span></span>
  3303. <span id="cb63-21"><a href="#cb63-21" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span>
  3304. <span id="cb63-22"><a href="#cb63-22" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>circle <span class="op">=</span> my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>circles<span class="op">;</span> circle<span class="op">;</span> circle <span class="op">=</span> circle<span class="op">-&gt;</span>next<span class="op">)</span> <span class="op">{</span></span>
  3305. <span id="cb63-23"><a href="#cb63-23" aria-hidden="true" tabindex="-1"></a> draw_circle<span class="op">(</span>circle<span class="op">-&gt;</span>x<span class="op">,</span> circle<span class="op">-&gt;</span>y<span class="op">,</span> circle<span class="op">-&gt;</span>diameter<span class="op">,</span> circle<span class="op">-&gt;</span>width<span class="op">);</span></span>
  3306. <span id="cb63-24"><a href="#cb63-24" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  3307. <h2 id="buffering-symbols-in-memory-memfile">5.6 Buffering Symbols in
  3308. Memory (memfile)</h2>
  3309. <p>Symbols can also be stored as “in-memory” file buffers by giving the
  3310. <code>BARCODE_MEMORY_FILE</code> option to the
  3311. <code>output_options</code> member, which saves the print output to
  3312. member <code>memfile</code> instead of to the output file
  3313. <code>outfile</code>. The length of the buffer is given in
  3314. <code>memfile_size</code>. For instance:</p>
  3315. <div class="sourceCode" id="cb64"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb64-1"><a href="#cb64-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
  3316. <span id="cb64-2"><a href="#cb64-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;stdio.h&gt;</span></span>
  3317. <span id="cb64-3"><a href="#cb64-3" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;string.h&gt;</span></span>
  3318. <span id="cb64-4"><a href="#cb64-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
  3319. <span id="cb64-5"><a href="#cb64-5" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
  3320. <span id="cb64-6"><a href="#cb64-6" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
  3321. <span id="cb64-7"><a href="#cb64-7" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
  3322. <span id="cb64-8"><a href="#cb64-8" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-&gt;</span>output_options <span class="op">|=</span> BARCODE_MEMORY_FILE<span class="op">;</span></span>
  3323. <span id="cb64-9"><a href="#cb64-9" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Only the extension is used, to determine output format */</span></span>
  3324. <span id="cb64-10"><a href="#cb64-10" aria-hidden="true" tabindex="-1"></a> strcpy<span class="op">(</span>my_symbol<span class="op">-&gt;</span>outfile<span class="op">,</span> <span class="st">&quot;mem.svg&quot;</span><span class="op">);</span></span>
  3325. <span id="cb64-11"><a href="#cb64-11" aria-hidden="true" tabindex="-1"></a> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
  3326. <span id="cb64-12"><a href="#cb64-12" aria-hidden="true" tabindex="-1"></a> <span class="co">/* `my_symbol-&gt;memfile` now contains the SVG output */</span></span>
  3327. <span id="cb64-13"><a href="#cb64-13" aria-hidden="true" tabindex="-1"></a> fwrite<span class="op">(</span>my_symbol<span class="op">-&gt;</span>memfile<span class="op">,</span> <span class="dv">1</span><span class="op">,</span> my_symbol<span class="op">-&gt;</span>memfile_size<span class="op">,</span> stdout<span class="op">);</span></span>
  3328. <span id="cb64-14"><a href="#cb64-14" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
  3329. <span id="cb64-15"><a href="#cb64-15" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
  3330. <span id="cb64-16"><a href="#cb64-16" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  3331. <p>will print the SVG output to <code>stdout</code> (the file “mem.svg”
  3332. is not created). This is particularly useful for the textual formats EPS
  3333. and SVG,<a href="#fn7" class="footnote-ref" id="fnref7"
  3334. role="doc-noteref"><sup>7</sup></a> allowing the output to be
  3335. manipulated and processed by the client.</p>
  3336. <h2 id="setting-options">5.7 Setting Options</h2>
  3337. <p>So far our application is not very useful unless we plan to only make
  3338. Code 128 symbols and we don’t mind that they only save to
  3339. <code>"out.png"</code> (or to memory, as above). As with the CLI
  3340. program, of course, these options can be altered. The way this is done
  3341. is by altering the contents of the <code>zint_symbol</code> structure
  3342. between the creation and encoding stages. The <code>zint_symbol</code>
  3343. structure consists of the following members:</p>
  3344. <div id="tbl:api_structure_zint_symbol" class="tablenos">
  3345. <table id="tbl:api_structure_zint_symbol" data-tag="$ $">
  3346. <caption><span>Table <span class="math inline"> </span>:</span> API
  3347. Structure <code>zint_symbol</code> </caption>
  3348. <colgroup>
  3349. <col style="width: 26%" />
  3350. <col style="width: 15%" />
  3351. <col style="width: 34%" />
  3352. <col style="width: 23%" />
  3353. </colgroup>
  3354. <thead>
  3355. <tr>
  3356. <th style="text-align: left;">Member Name</th>
  3357. <th style="text-align: left;">Type</th>
  3358. <th style="text-align: left;">Meaning</th>
  3359. <th style="text-align: left;">Default Value</th>
  3360. </tr>
  3361. </thead>
  3362. <tbody>
  3363. <tr>
  3364. <td style="text-align: left;"><code>symbology</code></td>
  3365. <td style="text-align: left;">integer</td>
  3366. <td style="text-align: left;">Symbol to use - see <a
  3367. href="#specifying-a-symbology">5.9 Specifying a Symbology</a>.</td>
  3368. <td style="text-align: left;"><code>BARCODE_CODE128</code></td>
  3369. </tr>
  3370. <tr>
  3371. <td style="text-align: left;"><code>height</code></td>
  3372. <td style="text-align: left;">float</td>
  3373. <td style="text-align: left;">Symbol height in X-dimensions, excluding
  3374. fixed width-to-height symbols.<a href="#fn8" class="footnote-ref"
  3375. id="fnref8" role="doc-noteref"><sup>8</sup></a></td>
  3376. <td style="text-align: left;">Symbol dependent</td>
  3377. </tr>
  3378. <tr>
  3379. <td style="text-align: left;"><code>scale</code></td>
  3380. <td style="text-align: left;">float</td>
  3381. <td style="text-align: left;">Scale factor for adjusting size of image
  3382. (sets X-dimension).</td>
  3383. <td style="text-align: left;">1.0</td>
  3384. </tr>
  3385. <tr>
  3386. <td style="text-align: left;"><code>whitespace_width</code></td>
  3387. <td style="text-align: left;">integer</td>
  3388. <td style="text-align: left;">Horizontal whitespace width in
  3389. X-dimensions.</td>
  3390. <td style="text-align: left;">0</td>
  3391. </tr>
  3392. <tr>
  3393. <td style="text-align: left;"><code>whitespace_height</code></td>
  3394. <td style="text-align: left;">integer</td>
  3395. <td style="text-align: left;">Vertical whitespace height in
  3396. X-dimensions.</td>
  3397. <td style="text-align: left;">0</td>
  3398. </tr>
  3399. <tr>
  3400. <td style="text-align: left;"><code>border_width</code></td>
  3401. <td style="text-align: left;">integer</td>
  3402. <td style="text-align: left;">Border width in X-dimensions.</td>
  3403. <td style="text-align: left;">0</td>
  3404. </tr>
  3405. <tr>
  3406. <td style="text-align: left;"><code>output_options</code></td>
  3407. <td style="text-align: left;">integer</td>
  3408. <td style="text-align: left;">Set various output parameters - see <a
  3409. href="#adjusting-output-options">5.10 Adjusting Output Options</a>.</td>
  3410. <td style="text-align: left;">0 (none)</td>
  3411. </tr>
  3412. <tr>
  3413. <td style="text-align: left;"><code>fgcolour</code></td>
  3414. <td style="text-align: left;">character string</td>
  3415. <td style="text-align: left;">Foreground (ink) colour as RGB/RGBA
  3416. hexadecimal string or <code>"C,M,Y,K"</code> decimal percentages string,
  3417. with a terminating <code>NUL</code>.</td>
  3418. <td style="text-align: left;"><code>"000000"</code></td>
  3419. </tr>
  3420. <tr>
  3421. <td style="text-align: left;"><code>bgcolour</code></td>
  3422. <td style="text-align: left;">character string</td>
  3423. <td style="text-align: left;">Background (paper) colour as RGB/RGBA
  3424. hexadecimal string or <code>"C,M,Y,K"</code> decimal percentages string,
  3425. with a terminating <code>NUL</code>.</td>
  3426. <td style="text-align: left;"><code>"ffffff"</code></td>
  3427. </tr>
  3428. <tr>
  3429. <td style="text-align: left;"><code>fgcolor</code></td>
  3430. <td style="text-align: left;">pointer</td>
  3431. <td style="text-align: left;">Points to fgcolour allowing alternate
  3432. spelling.</td>
  3433. <td style="text-align: left;"></td>
  3434. </tr>
  3435. <tr>
  3436. <td style="text-align: left;"><code>bgcolor</code></td>
  3437. <td style="text-align: left;">pointer</td>
  3438. <td style="text-align: left;">Points to bgcolour allowing alternate
  3439. spelling.</td>
  3440. <td style="text-align: left;"></td>
  3441. </tr>
  3442. <tr>
  3443. <td style="text-align: left;"><code>outfile</code></td>
  3444. <td style="text-align: left;">character string</td>
  3445. <td style="text-align: left;">Contains the name of the file to output a
  3446. resulting barcode symbol to. Must end in <code>.png</code>,
  3447. <code>.gif</code>, <code>.bmp</code>, <code>.emf</code>,
  3448. <code>.eps</code>, <code>.pcx</code>, <code>.svg</code>,
  3449. <code>.tif</code> or <code>.txt</code> followed by a terminating
  3450. <code>NUL</code>.<a href="#fn9" class="footnote-ref" id="fnref9"
  3451. role="doc-noteref"><sup>9</sup></a></td>
  3452. <td style="text-align: left;"><code>"out.png"</code></td>
  3453. </tr>
  3454. <tr>
  3455. <td style="text-align: left;"><code>primary</code></td>
  3456. <td style="text-align: left;">character string</td>
  3457. <td style="text-align: left;">Primary message data for more complex
  3458. symbols, with a terminating <code>NUL</code>.</td>
  3459. <td style="text-align: left;"><code>""</code> (empty)</td>
  3460. </tr>
  3461. <tr>
  3462. <td style="text-align: left;"><code>option_1</code></td>
  3463. <td style="text-align: left;">integer</td>
  3464. <td style="text-align: left;">Symbol specific options.</td>
  3465. <td style="text-align: left;">-1</td>
  3466. </tr>
  3467. <tr>
  3468. <td style="text-align: left;"><code>option_2</code></td>
  3469. <td style="text-align: left;">integer</td>
  3470. <td style="text-align: left;">Symbol specific options.</td>
  3471. <td style="text-align: left;">0</td>
  3472. </tr>
  3473. <tr>
  3474. <td style="text-align: left;"><code>option_3</code></td>
  3475. <td style="text-align: left;">integer</td>
  3476. <td style="text-align: left;">Symbol specific options.</td>
  3477. <td style="text-align: left;">0</td>
  3478. </tr>
  3479. <tr>
  3480. <td style="text-align: left;"><code>show_hrt</code></td>
  3481. <td style="text-align: left;">integer</td>
  3482. <td style="text-align: left;">Set to 0 to hide Human Readable Text
  3483. (HRT).</td>
  3484. <td style="text-align: left;">1</td>
  3485. </tr>
  3486. <tr>
  3487. <td style="text-align: left;"><code>input_mode</code></td>
  3488. <td style="text-align: left;">integer</td>
  3489. <td style="text-align: left;">Set encoding of input data - see <a
  3490. href="#setting-the-input-mode">5.11 Setting the Input Mode</a>.</td>
  3491. <td style="text-align: left;"><code>DATA_MODE</code></td>
  3492. </tr>
  3493. <tr>
  3494. <td style="text-align: left;"><code>eci</code></td>
  3495. <td style="text-align: left;">integer</td>
  3496. <td style="text-align: left;">Extended Channel Interpretation code.</td>
  3497. <td style="text-align: left;">0 (none)</td>
  3498. </tr>
  3499. <tr>
  3500. <td style="text-align: left;"><code>dpmm</code></td>
  3501. <td style="text-align: left;">float</td>
  3502. <td style="text-align: left;">Resolution of output in dots per mm (BMP,
  3503. EMF, PCX, PNG and TIF only).</td>
  3504. <td style="text-align: left;">0 (none)</td>
  3505. </tr>
  3506. <tr>
  3507. <td style="text-align: left;"><code>dot_size</code></td>
  3508. <td style="text-align: left;">float</td>
  3509. <td style="text-align: left;">Diameter of dots used in dotty mode (in
  3510. X-dimensions).</td>
  3511. <td style="text-align: left;">0.8</td>
  3512. </tr>
  3513. <tr>
  3514. <td style="text-align: left;"><code>text_gap</code></td>
  3515. <td style="text-align: left;">float</td>
  3516. <td style="text-align: left;">Gap between barcode and text (HRT) in
  3517. X-dimensions.</td>
  3518. <td style="text-align: left;">1.0</td>
  3519. </tr>
  3520. <tr>
  3521. <td style="text-align: left;"><code>guard_descent</code></td>
  3522. <td style="text-align: left;">float</td>
  3523. <td style="text-align: left;">Height of guard bar descent (EAN/UPC only)
  3524. in X-dimensions.</td>
  3525. <td style="text-align: left;">5.0</td>
  3526. </tr>
  3527. <tr>
  3528. <td style="text-align: left;"><code>structapp</code></td>
  3529. <td style="text-align: left;">Structured Append structure</td>
  3530. <td style="text-align: left;">Mark a symbol as part of a sequence of
  3531. symbols.</td>
  3532. <td style="text-align: left;">count 0 (disabled)</td>
  3533. </tr>
  3534. <tr>
  3535. <td style="text-align: left;"><code>debug</code></td>
  3536. <td style="text-align: left;">integer</td>
  3537. <td style="text-align: left;">Debugging flags.</td>
  3538. <td style="text-align: left;">0</td>
  3539. </tr>
  3540. <tr>
  3541. <td style="text-align: left;"><code>warn_level</code></td>
  3542. <td style="text-align: left;">integer</td>
  3543. <td style="text-align: left;">Affects error/warning value returned by
  3544. Zint API - see <a href="#handling-errors">5.8 Handling Errors</a>.</td>
  3545. <td style="text-align: left;"><code>WARN_DEFAULT</code></td>
  3546. </tr>
  3547. <tr>
  3548. <td style="text-align: left;"><code>text</code></td>
  3549. <td style="text-align: left;">unsigned character string</td>
  3550. <td style="text-align: left;">Human Readable Text, which usually
  3551. consists of input data plus one more check digit. Uses UTF-8 formatting,
  3552. with a terminating <code>NUL</code>.</td>
  3553. <td style="text-align: left;"><code>""</code> (empty) (output only)</td>
  3554. </tr>
  3555. <tr>
  3556. <td style="text-align: left;"><code>rows</code></td>
  3557. <td style="text-align: left;">integer</td>
  3558. <td style="text-align: left;">Number of rows used by the symbol.</td>
  3559. <td style="text-align: left;">(output only)</td>
  3560. </tr>
  3561. <tr>
  3562. <td style="text-align: left;"><code>width</code></td>
  3563. <td style="text-align: left;">integer</td>
  3564. <td style="text-align: left;">Width of the generated symbol.</td>
  3565. <td style="text-align: left;">(output only)</td>
  3566. </tr>
  3567. <tr>
  3568. <td style="text-align: left;"><code>encoded_data</code></td>
  3569. <td style="text-align: left;">array of unsigned character arrays</td>
  3570. <td style="text-align: left;">Representation of the encoded data.</td>
  3571. <td style="text-align: left;">(output only)</td>
  3572. </tr>
  3573. <tr>
  3574. <td style="text-align: left;"><code>row_height</code></td>
  3575. <td style="text-align: left;">array of floats</td>
  3576. <td style="text-align: left;">Heights of each row.</td>
  3577. <td style="text-align: left;">(output only)</td>
  3578. </tr>
  3579. <tr>
  3580. <td style="text-align: left;"><code>errtxt</code></td>
  3581. <td style="text-align: left;">character string</td>
  3582. <td style="text-align: left;">Error message in the event that an error
  3583. occurred, with a terminating <code>NUL</code> - see <a
  3584. href="#handling-errors">5.8 Handling Errors</a>.</td>
  3585. <td style="text-align: left;">(output only)</td>
  3586. </tr>
  3587. <tr>
  3588. <td style="text-align: left;"><code>bitmap</code></td>
  3589. <td style="text-align: left;">pointer to unsigned character array</td>
  3590. <td style="text-align: left;">Pointer to stored bitmap image - see <a
  3591. href="#buffering-symbols-in-memory-raster">5.4 Buffering Symbols in
  3592. Memory (raster)</a>.</td>
  3593. <td style="text-align: left;">(output only)</td>
  3594. </tr>
  3595. <tr>
  3596. <td style="text-align: left;"><code>bitmap_width</code></td>
  3597. <td style="text-align: left;">integer</td>
  3598. <td style="text-align: left;">Width of stored bitmap image (in pixels) -
  3599. see <code>bitmap</code> member.</td>
  3600. <td style="text-align: left;">(output only)</td>
  3601. </tr>
  3602. <tr>
  3603. <td style="text-align: left;"><code>bitmap_height</code></td>
  3604. <td style="text-align: left;">integer</td>
  3605. <td style="text-align: left;">Height of stored bitmap image (in pixels)
  3606. - see <code>bitmap</code> member.</td>
  3607. <td style="text-align: left;">(output only)</td>
  3608. </tr>
  3609. <tr>
  3610. <td style="text-align: left;"><code>alphamap</code></td>
  3611. <td style="text-align: left;">pointer to unsigned character array</td>
  3612. <td style="text-align: left;">Pointer to array representing alpha
  3613. channel of stored bitmap image (or <code>NULL</code> if no alpha channel
  3614. used) - see <code>bitmap</code> member.</td>
  3615. <td style="text-align: left;">(output only)</td>
  3616. </tr>
  3617. <tr>
  3618. <td style="text-align: left;"><code>vector</code></td>
  3619. <td style="text-align: left;">pointer to vector structure</td>
  3620. <td style="text-align: left;">Pointer to vector header containing
  3621. pointers to vector elements - see <a
  3622. href="#buffering-symbols-in-memory-vector">5.5 Buffering Symbols in
  3623. Memory (vector)</a>.</td>
  3624. <td style="text-align: left;">(output only)</td>
  3625. </tr>
  3626. <tr>
  3627. <td style="text-align: left;"><code>memfile</code></td>
  3628. <td style="text-align: left;">pointer to unsigned character array</td>
  3629. <td style="text-align: left;">Pointer to in-memory file buffer if
  3630. <code>BARCODE_MEMORY_FILE</code> set in <code>output_options</code> -
  3631. see <a href="#buffering-symbols-in-memory-memfile">5.6 Buffering Symbols
  3632. in Memory (memfile)</a>.</td>
  3633. <td style="text-align: left;">(output only)</td>
  3634. </tr>
  3635. <tr>
  3636. <td style="text-align: left;"><code>memfile_size</code></td>
  3637. <td style="text-align: left;">integer</td>
  3638. <td style="text-align: left;">Length of in-memory file buffer.</td>
  3639. <td style="text-align: left;">(output only)</td>
  3640. </tr>
  3641. </tbody>
  3642. </table>
  3643. </div>
  3644. <p>To alter these values use the syntax shown in the example below. This
  3645. code has the same result as the previous example except the output is
  3646. now taller and plotted in green.</p>
  3647. <div class="sourceCode" id="cb65"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb65-1"><a href="#cb65-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
  3648. <span id="cb65-2"><a href="#cb65-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;string.h&gt;</span></span>
  3649. <span id="cb65-3"><a href="#cb65-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
  3650. <span id="cb65-4"><a href="#cb65-4" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
  3651. <span id="cb65-5"><a href="#cb65-5" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
  3652. <span id="cb65-6"><a href="#cb65-6" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
  3653. <span id="cb65-7"><a href="#cb65-7" aria-hidden="true" tabindex="-1"></a> strcpy<span class="op">(</span>my_symbol<span class="op">-&gt;</span>fgcolour<span class="op">,</span> <span class="st">&quot;00ff00&quot;</span><span class="op">);</span></span>
  3654. <span id="cb65-8"><a href="#cb65-8" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-&gt;</span>height <span class="op">=</span> <span class="fl">400.0</span><span class="bu">f</span><span class="op">;</span></span>
  3655. <span id="cb65-9"><a href="#cb65-9" aria-hidden="true" tabindex="-1"></a> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
  3656. <span id="cb65-10"><a href="#cb65-10" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
  3657. <span id="cb65-11"><a href="#cb65-11" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
  3658. <span id="cb65-12"><a href="#cb65-12" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  3659. <p>Note that background removal for all outputs except BMP can be
  3660. achieved by setting the background alpha to <code>"00"</code> where the
  3661. values for R, G and B will be ignored:</p>
  3662. <div class="sourceCode" id="cb66"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb66-1"><a href="#cb66-1" aria-hidden="true" tabindex="-1"></a> strcpy<span class="op">(</span>my_symbol<span class="op">-&gt;</span>bgcolour<span class="op">,</span> <span class="st">&quot;55555500&quot;</span><span class="op">);</span></span></code></pre></div>
  3663. <p>This is what the CLI option <code>--nobackground</code> does - see <a
  3664. href="#using-colour">4.7 Using Colour</a>.</p>
  3665. <h2 id="handling-errors">5.8 Handling Errors</h2>
  3666. <p>If errors occur during encoding a non-zero integer value is passed
  3667. back to the calling application. In addition the <code>errtxt</code>
  3668. member is set to a message detailing the nature of the error. The errors
  3669. generated by Zint are:</p>
  3670. <div id="tbl:api_warnings_errors" class="tablenos">
  3671. <table id="tbl:api_warnings_errors"
  3672. data-tag=": API Warning and Error Return Values">
  3673. <caption><span>Table : API Warning and Error Return Values</span>
  3674. </caption>
  3675. <colgroup>
  3676. <col style="width: 39%" />
  3677. <col style="width: 60%" />
  3678. </colgroup>
  3679. <thead>
  3680. <tr>
  3681. <th style="text-align: left;">Return Value</th>
  3682. <th style="text-align: left;">Meaning</th>
  3683. </tr>
  3684. </thead>
  3685. <tbody>
  3686. <tr>
  3687. <td style="text-align: left;"><code>ZINT_WARN_HRT_TRUNCATED</code></td>
  3688. <td style="text-align: left;">The Human Readable Text returned in
  3689. <code>text</code> was truncated (maximum 255 bytes).</td>
  3690. </tr>
  3691. <tr>
  3692. <td style="text-align: left;"><code>ZINT_WARN_INVALID_OPTION</code></td>
  3693. <td style="text-align: left;">One of the values in
  3694. <code>zint_struct</code> was set incorrectly but Zint has made a guess
  3695. at what it should have been and generated a barcode accordingly.</td>
  3696. </tr>
  3697. <tr>
  3698. <td style="text-align: left;"><code>ZINT_WARN_USES_ECI</code></td>
  3699. <td style="text-align: left;">Zint has automatically inserted an ECI
  3700. character. The symbol may not be readable with some readers.</td>
  3701. </tr>
  3702. <tr>
  3703. <td style="text-align: left;"><code>ZINT_WARN_NONCOMPLIANT</code></td>
  3704. <td style="text-align: left;">The symbol was created but is not
  3705. compliant with certain standards set in its specification (e.g. height,
  3706. GS1 AI data lengths).</td>
  3707. </tr>
  3708. <tr>
  3709. <td style="text-align: left;"><code>ZINT_ERROR</code></td>
  3710. <td style="text-align: left;">Marks the divide between warnings and
  3711. errors. For return values greater than or equal to this no symbol (or
  3712. only an incomplete symbol) is generated.</td>
  3713. </tr>
  3714. <tr>
  3715. <td style="text-align: left;"><code>ZINT_ERROR_TOO_LONG</code></td>
  3716. <td style="text-align: left;">The input data is too long or too short
  3717. for the selected symbology. No symbol has been generated.</td>
  3718. </tr>
  3719. <tr>
  3720. <td style="text-align: left;"><code>ZINT_ERROR_INVALID_DATA</code></td>
  3721. <td style="text-align: left;">The data to be encoded includes characters
  3722. which are not permitted by the selected symbology (e.g. alphabetic
  3723. characters in an EAN symbol). No symbol has been generated.</td>
  3724. </tr>
  3725. <tr>
  3726. <td style="text-align: left;"><code>ZINT_ERROR_INVALID_CHECK</code></td>
  3727. <td style="text-align: left;">Data with an incorrect check digit has
  3728. been entered. No symbol has been generated.</td>
  3729. </tr>
  3730. <tr>
  3731. <td
  3732. style="text-align: left;"><code>ZINT_ERROR_INVALID_OPTION</code></td>
  3733. <td style="text-align: left;">One of the values in
  3734. <code>zint_struct</code> was set incorrectly and Zint was unable (or
  3735. unwilling) to guess what it should have been. No symbol has been
  3736. generated.</td>
  3737. </tr>
  3738. <tr>
  3739. <td
  3740. style="text-align: left;"><code>ZINT_ERROR_ENCODING_PROBLEM</code></td>
  3741. <td style="text-align: left;">A problem has occurred during encoding of
  3742. the data. This should never happen. Please contact the developer if you
  3743. encounter this error.</td>
  3744. </tr>
  3745. <tr>
  3746. <td style="text-align: left;"><code>ZINT_ERROR_FILE_ACCESS</code></td>
  3747. <td style="text-align: left;">Zint was unable to open the requested
  3748. output file. This is usually a file permissions problem.</td>
  3749. </tr>
  3750. <tr>
  3751. <td style="text-align: left;"><code>ZINT_ERROR_MEMORY</code></td>
  3752. <td style="text-align: left;">Zint ran out of memory. This should only
  3753. be a problem with legacy systems.</td>
  3754. </tr>
  3755. <tr>
  3756. <td style="text-align: left;"><code>ZINT_ERROR_FILE_WRITE</code></td>
  3757. <td style="text-align: left;">Zint failed to write all contents to the
  3758. requested output file. This should only occur if the output device
  3759. becomes full.</td>
  3760. </tr>
  3761. <tr>
  3762. <td style="text-align: left;"><code>ZINT_ERROR_USES_ECI</code></td>
  3763. <td style="text-align: left;">Returned if <code>warn_level</code> set to
  3764. <code>WARN_FAIL_ALL</code> and <code>ZINT_WARN_USES_ECI</code>
  3765. occurs.</td>
  3766. </tr>
  3767. <tr>
  3768. <td style="text-align: left;"><code>ZINT_ERROR_NONCOMPLIANT</code></td>
  3769. <td style="text-align: left;">Returned if <code>warn_level</code> set to
  3770. <code>WARN_FAIL_ALL</code> and <code>ZINT_WARN_NONCOMPLIANT</code>
  3771. occurs.</td>
  3772. </tr>
  3773. <tr>
  3774. <td style="text-align: left;"><code>ZINT_ERROR_HRT_TRUNCATED</code></td>
  3775. <td style="text-align: left;">Returned if <code>warn_level</code> set to
  3776. <code>WARN_FAIL_ALL</code> and <code>ZINT_WARN_HRT_TRUNCATED</code>
  3777. occurs.</td>
  3778. </tr>
  3779. </tbody>
  3780. </table>
  3781. </div>
  3782. <p>To catch errors use an integer variable as shown in the code
  3783. below:</p>
  3784. <div class="sourceCode" id="cb67"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb67-1"><a href="#cb67-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
  3785. <span id="cb67-2"><a href="#cb67-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;stdio.h&gt;</span></span>
  3786. <span id="cb67-3"><a href="#cb67-3" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;string.h&gt;</span></span>
  3787. <span id="cb67-4"><a href="#cb67-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
  3788. <span id="cb67-5"><a href="#cb67-5" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
  3789. <span id="cb67-6"><a href="#cb67-6" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
  3790. <span id="cb67-7"><a href="#cb67-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> error<span class="op">;</span></span>
  3791. <span id="cb67-8"><a href="#cb67-8" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
  3792. <span id="cb67-9"><a href="#cb67-9" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Set invalid foreground colour */</span></span>
  3793. <span id="cb67-10"><a href="#cb67-10" aria-hidden="true" tabindex="-1"></a> strcpy<span class="op">(</span>my_symbol<span class="op">-&gt;</span>fgcolour<span class="op">,</span> <span class="st">&quot;nonsense&quot;</span><span class="op">);</span></span>
  3794. <span id="cb67-11"><a href="#cb67-11" aria-hidden="true" tabindex="-1"></a> error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
  3795. <span id="cb67-12"><a href="#cb67-12" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>error <span class="op">!=</span> <span class="dv">0</span><span class="op">)</span> <span class="op">{</span></span>
  3796. <span id="cb67-13"><a href="#cb67-13" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Some warning or error occurred */</span></span>
  3797. <span id="cb67-14"><a href="#cb67-14" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">%s\n</span><span class="st">&quot;</span><span class="op">,</span> my_symbol<span class="op">-&gt;</span>errtxt<span class="op">);</span></span>
  3798. <span id="cb67-15"><a href="#cb67-15" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>error <span class="op">&gt;=</span> ZINT_ERROR<span class="op">)</span> <span class="op">{</span></span>
  3799. <span id="cb67-16"><a href="#cb67-16" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Stop now */</span></span>
  3800. <span id="cb67-17"><a href="#cb67-17" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
  3801. <span id="cb67-18"><a href="#cb67-18" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">1</span><span class="op">;</span></span>
  3802. <span id="cb67-19"><a href="#cb67-19" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
  3803. <span id="cb67-20"><a href="#cb67-20" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span>
  3804. <span id="cb67-21"><a href="#cb67-21" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Otherwise carry on with the rest of the application */</span></span>
  3805. <span id="cb67-22"><a href="#cb67-22" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
  3806. <span id="cb67-23"><a href="#cb67-23" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
  3807. <span id="cb67-24"><a href="#cb67-24" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  3808. <p>This code will exit with the appropriate message:</p>
  3809. <pre><code>Error 881: Malformed foreground RGB colour &#39;nonsense&#39; (hexadecimal only)</code></pre>
  3810. <p>To treat all warnings as errors, set
  3811. <code>symbol-&gt;warn_level</code> to <code>WARN_FAIL_ALL</code>.</p>
  3812. <h2 id="specifying-a-symbology">5.9 Specifying a Symbology</h2>
  3813. <p>Symbologies can be specified by number or by name as shown in the
  3814. Table <a href="#tbl:barcode_types">: Barcode Types (Symbologies)</a>.
  3815. For example</p>
  3816. <div class="sourceCode" id="cb69"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb69-1"><a href="#cb69-1" aria-hidden="true" tabindex="-1"></a>symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_LOGMARS<span class="op">;</span></span></code></pre></div>
  3817. <p>means the same as</p>
  3818. <div class="sourceCode" id="cb70"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb70-1"><a href="#cb70-1" aria-hidden="true" tabindex="-1"></a>symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> <span class="dv">50</span><span class="op">;</span></span></code></pre></div>
  3819. <h2 id="adjusting-output-options">5.10 Adjusting Output Options</h2>
  3820. <p>The <code>output_options</code> member can be used to adjust various
  3821. aspects of the output file. To select more than one option from the
  3822. table below simply <code>OR</code> them together when adjusting this
  3823. value:</p>
  3824. <div class="sourceCode" id="cb71"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb71-1"><a href="#cb71-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>output_options <span class="op">|=</span> BARCODE_BIND <span class="op">|</span> READER_INIT<span class="op">;</span></span></code></pre></div>
  3825. <div id="tbl:api_output_options" class="tablenos">
  3826. <table id="tbl:api_output_options" data-tag="$ $">
  3827. <caption><span>Table <span class="math inline"> </span>:</span> API
  3828. <code>output_options</code> Values </caption>
  3829. <colgroup>
  3830. <col style="width: 34%" />
  3831. <col style="width: 65%" />
  3832. </colgroup>
  3833. <thead>
  3834. <tr>
  3835. <th style="text-align: left;">Value</th>
  3836. <th style="text-align: left;">Effect</th>
  3837. </tr>
  3838. </thead>
  3839. <tbody>
  3840. <tr>
  3841. <td style="text-align: left;">0</td>
  3842. <td style="text-align: left;">No options selected.</td>
  3843. </tr>
  3844. <tr>
  3845. <td style="text-align: left;"><code>BARCODE_BIND_TOP</code></td>
  3846. <td style="text-align: left;">Boundary bar above the symbol only.<a
  3847. href="#fn10" class="footnote-ref" id="fnref10"
  3848. role="doc-noteref"><sup>10</sup></a></td>
  3849. </tr>
  3850. <tr>
  3851. <td style="text-align: left;"><code>BARCODE_BIND</code></td>
  3852. <td style="text-align: left;">Boundary bars above and below the symbol
  3853. and between rows if stacking multiple symbols.<a href="#fn11"
  3854. class="footnote-ref" id="fnref11"
  3855. role="doc-noteref"><sup>11</sup></a></td>
  3856. </tr>
  3857. <tr>
  3858. <td style="text-align: left;"><code>BARCODE_BOX</code></td>
  3859. <td style="text-align: left;">Add a box surrounding the symbol and
  3860. whitespace.</td>
  3861. </tr>
  3862. <tr>
  3863. <td style="text-align: left;"><code>BARCODE_STDOUT</code></td>
  3864. <td style="text-align: left;">Output the file to stdout.</td>
  3865. </tr>
  3866. <tr>
  3867. <td style="text-align: left;"><code>READER_INIT</code></td>
  3868. <td style="text-align: left;">Create as a Reader Initialisation
  3869. (Programming) symbol.</td>
  3870. </tr>
  3871. <tr>
  3872. <td style="text-align: left;"><code>SMALL_TEXT</code></td>
  3873. <td style="text-align: left;">Use a smaller font for the Human Readable
  3874. Text.</td>
  3875. </tr>
  3876. <tr>
  3877. <td style="text-align: left;"><code>BOLD_TEXT</code></td>
  3878. <td style="text-align: left;">Embolden the Human Readable Text.</td>
  3879. </tr>
  3880. <tr>
  3881. <td style="text-align: left;"><code>CMYK_COLOUR</code></td>
  3882. <td style="text-align: left;">Select the CMYK colour space option for
  3883. Encapsulated PostScript and TIF files.</td>
  3884. </tr>
  3885. <tr>
  3886. <td style="text-align: left;"><code>BARCODE_DOTTY_MODE</code></td>
  3887. <td style="text-align: left;">Plot a matrix symbol using dots rather
  3888. than squares.</td>
  3889. </tr>
  3890. <tr>
  3891. <td style="text-align: left;"><code>GS1_GS_SEPARATOR</code></td>
  3892. <td style="text-align: left;">Use GS (Group Separator) instead of FNC1
  3893. as GS1 separator (Data Matrix only).</td>
  3894. </tr>
  3895. <tr>
  3896. <td style="text-align: left;"><code>OUT_BUFFER_INTERMEDIATE</code></td>
  3897. <td style="text-align: left;">Return the bitmap buffer as ASCII values
  3898. instead of separate colour channels - see <a
  3899. href="#buffering-symbols-in-memory-raster">5.4 Buffering Symbols in
  3900. Memory (raster)</a>.</td>
  3901. </tr>
  3902. <tr>
  3903. <td style="text-align: left;"><code>BARCODE_QUIET_ZONES</code></td>
  3904. <td style="text-align: left;">Add compliant quiet zones (additional to
  3905. any specified whitespace).<a href="#fn12" class="footnote-ref"
  3906. id="fnref12" role="doc-noteref"><sup>12</sup></a></td>
  3907. </tr>
  3908. <tr>
  3909. <td style="text-align: left;"><code>BARCODE_NO_QUIET_ZONES</code></td>
  3910. <td style="text-align: left;">Disable quiet zones, notably those with
  3911. defaults.</td>
  3912. </tr>
  3913. <tr>
  3914. <td style="text-align: left;"><code>COMPLIANT_HEIGHT</code></td>
  3915. <td style="text-align: left;">Warn if height specified not compliant, or
  3916. use standard height (if any) as default.</td>
  3917. </tr>
  3918. <tr>
  3919. <td style="text-align: left;"><code>EANUPC_GUARD_WHITESPACE</code></td>
  3920. <td style="text-align: left;">Add quiet zone indicators (“&lt;” and/or
  3921. “&gt;”) to HRT whitespace (EAN/UPC).</td>
  3922. </tr>
  3923. <tr>
  3924. <td style="text-align: left;"><code>EMBED_VECTOR_FONT</code></td>
  3925. <td style="text-align: left;">Embed font in vector output - currently
  3926. available for SVG output only.</td>
  3927. </tr>
  3928. <tr>
  3929. <td style="text-align: left;"><code>BARCODE_MEMORY_FILE</code></td>
  3930. <td style="text-align: left;">Write output to in-memory buffer
  3931. <code>symbol-&gt;memfile</code> instead of to <code>outfile</code>
  3932. file.</td>
  3933. </tr>
  3934. </tbody>
  3935. </table>
  3936. </div>
  3937. <h2 id="setting-the-input-mode">5.11 Setting the Input Mode</h2>
  3938. <p>The way in which the input data is encoded can be set using the
  3939. <code>input_mode</code> member. Valid values are shown in the table
  3940. below.</p>
  3941. <div id="tbl:api_input_mode" class="tablenos">
  3942. <table id="tbl:api_input_mode" data-tag="$ $">
  3943. <caption><span>Table <span class="math inline"> </span>:</span> API
  3944. <code>input_mode</code> Values </caption>
  3945. <colgroup>
  3946. <col style="width: 25%" />
  3947. <col style="width: 74%" />
  3948. </colgroup>
  3949. <thead>
  3950. <tr>
  3951. <th style="text-align: left;">Value</th>
  3952. <th style="text-align: left;">Effect</th>
  3953. </tr>
  3954. </thead>
  3955. <tbody>
  3956. <tr>
  3957. <td style="text-align: left;"><code>DATA_MODE</code></td>
  3958. <td style="text-align: left;">Uses full 8-bit range interpreted as
  3959. binary data.</td>
  3960. </tr>
  3961. <tr>
  3962. <td style="text-align: left;"><code>UNICODE_MODE</code></td>
  3963. <td style="text-align: left;">Uses UTF-8 input.</td>
  3964. </tr>
  3965. <tr>
  3966. <td style="text-align: left;"><code>GS1_MODE</code></td>
  3967. <td style="text-align: left;">Encodes GS1 data using FNC1
  3968. characters.</td>
  3969. </tr>
  3970. <tr>
  3971. <td style="text-align: left;"></td>
  3972. <td style="text-align: left;"><em>The above are exclusive, the following
  3973. optional and OR-ed.</em></td>
  3974. </tr>
  3975. <tr>
  3976. <td style="text-align: left;"><code>ESCAPE_MODE</code></td>
  3977. <td style="text-align: left;">Process input data for escape
  3978. sequences.</td>
  3979. </tr>
  3980. <tr>
  3981. <td style="text-align: left;"><code>GS1PARENS_MODE</code></td>
  3982. <td style="text-align: left;">Parentheses (round brackets) used in GS1
  3983. data instead of square brackets to delimit Application Identifiers
  3984. (parentheses must not otherwise occur in the data).</td>
  3985. </tr>
  3986. <tr>
  3987. <td style="text-align: left;"><code>GS1NOCHECK_MODE</code></td>
  3988. <td style="text-align: left;">Do not check GS1 data for validity,
  3989. i.e. suppress checks for valid AIs and data lengths. Invalid characters
  3990. (e.g. control characters, extended ASCII characters) are still checked
  3991. for.</td>
  3992. </tr>
  3993. <tr>
  3994. <td style="text-align: left;"><code>HEIGHTPERROW_MODE</code></td>
  3995. <td style="text-align: left;">Interpret the <code>height</code> member
  3996. as per-row rather than as overall height.</td>
  3997. </tr>
  3998. <tr>
  3999. <td style="text-align: left;"><code>FAST_MODE</code></td>
  4000. <td style="text-align: left;">Use faster if less optimal encodation or
  4001. other shortcuts if available (affects <code>DATAMATRIX</code>,
  4002. <code>MICROPDF417</code>, <code>PDF417</code>, <code>QRCODE</code> and
  4003. <code>UPNQR</code> only).</td>
  4004. </tr>
  4005. <tr>
  4006. <td style="text-align: left;"><code>EXTRA_ESCAPE_MODE</code></td>
  4007. <td style="text-align: left;">Process special symbology-specific escape
  4008. sequences (<code>CODE128</code> only).</td>
  4009. </tr>
  4010. </tbody>
  4011. </table>
  4012. </div>
  4013. <p>The default mode is <code>DATA_MODE</code>. (Note that this differs
  4014. from the default for the CLI and GUI, which is
  4015. <code>UNICODE_MODE</code>.)</p>
  4016. <p><code>DATA_MODE</code>, <code>UNICODE_MODE</code> and
  4017. <code>GS1_MODE</code> are mutually exclusive, whereas
  4018. <code>ESCAPE_MODE</code>, <code>GS1PARENS_MODE</code>,
  4019. <code>GS1NOCHECK_MODE</code>, <code>HEIGHTPERROW_MODE</code>,
  4020. <code>FAST_MODE</code> and <code>EXTRA_ESCAPE_MODE</code> are optional.
  4021. So, for example, you can set</p>
  4022. <div class="sourceCode" id="cb72"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb72-1"><a href="#cb72-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>input_mode <span class="op">=</span> UNICODE_MODE <span class="op">|</span> ESCAPE_MODE<span class="op">;</span></span></code></pre></div>
  4023. <p>or</p>
  4024. <div class="sourceCode" id="cb73"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb73-1"><a href="#cb73-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>input_mode <span class="op">=</span> GS1_MODE <span class="op">|</span> GS1PARENS_MODE <span class="op">|</span> GS1NOCHECK_MODE<span class="op">;</span></span></code></pre></div>
  4025. <p>whereas</p>
  4026. <div class="sourceCode" id="cb74"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb74-1"><a href="#cb74-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>input_mode <span class="op">=</span> DATA_MODE <span class="op">|</span> GS1_MODE<span class="op">;</span></span></code></pre></div>
  4027. <p>is not valid.</p>
  4028. <p>Permissible escape sequences (<code>ESCAPE_MODE</code>) are listed in
  4029. Table <a href="#tbl:escape_sequences">: Escape Sequences</a>, and the
  4030. special Code 128-only <code>EXTRA_ESCAPE_MODE</code> escape sequences
  4031. are given in <a href="#standard-code-128-iso-15417">6.1.10.1 Standard
  4032. Code 128 (ISO 15417)</a>. An example of <code>GS1PARENS_MODE</code>
  4033. usage is given in section <a href="#gs1-128">6.1.10.3 GS1-128</a>.</p>
  4034. <p><code>GS1NOCHECK_MODE</code> is for use with legacy systems that have
  4035. data that does not conform to the current GS1 standard. Printable ASCII
  4036. input is still checked for, as is the validity of GS1 data specified
  4037. without AIs (e.g. linear data for GS1 DataBar
  4038. Omnidirectional/Limited/etc.). Also checked is GS1 DataBar Expanded and
  4039. GS1 Composite input that is not in the GS1 encodable character set 82
  4040. (see GS1 General Specifications Figure 7.11.1 ‘GS1 AI encodable
  4041. character set 82’), otherwise encodation would fail.</p>
  4042. <p>For <code>HEIGHTPERROW_MODE</code>, see <code>--heightperrow</code>
  4043. in section <a href="#adjusting-height">4.4 Adjusting Height</a>. The
  4044. <code>height</code> member should be set to the desired per-row value on
  4045. input (it will be set to the overall height on output).</p>
  4046. <p><code>FAST_MODE</code> causes a less optimal encodation scheme to be
  4047. used for Data Matrix, MicroPDF417 and PDF417. For QR Code and UPNQR, it
  4048. affects Zint’s automatic mask selection - see <a
  4049. href="#qr-code-iso-18004">6.6.3 QR Code (ISO 18004)</a> for details.</p>
  4050. <h2 id="multiple-segments-1">5.12 Multiple Segments</h2>
  4051. <p>For input data requiring multiple ECIs, the following functions may
  4052. be used:</p>
  4053. <div class="sourceCode" id="cb75"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb75-1"><a href="#cb75-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  4054. <span id="cb75-2"><a href="#cb75-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">);</span></span>
  4055. <span id="cb75-3"><a href="#cb75-3" aria-hidden="true" tabindex="-1"></a></span>
  4056. <span id="cb75-4"><a href="#cb75-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs_and_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  4057. <span id="cb75-5"><a href="#cb75-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
  4058. <span id="cb75-6"><a href="#cb75-6" aria-hidden="true" tabindex="-1"></a></span>
  4059. <span id="cb75-7"><a href="#cb75-7" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs_and_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  4060. <span id="cb75-8"><a href="#cb75-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
  4061. <span id="cb75-9"><a href="#cb75-9" aria-hidden="true" tabindex="-1"></a></span>
  4062. <span id="cb75-10"><a href="#cb75-10" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs_and_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
  4063. <span id="cb75-11"><a href="#cb75-11" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div>
  4064. <p>These are direct analogues of the previously mentioned
  4065. <code>ZBarcode_Encode()</code>,
  4066. <code>ZBarcode_Encode_and_Print()</code>,
  4067. <code>ZBarcode_Encode_and_Buffer()</code> and
  4068. <code>ZBarcode_Encode_and_Buffer_Vector()</code> respectively, where
  4069. instead of a pair consisting of <code>"source, length"</code>, a pair
  4070. consisting of <code>"segs, seg_count"</code> is given, with
  4071. <code>segs</code> being an array of <code>struct zint_seg</code>
  4072. segments and <code>seg_count</code> being the number of elements it
  4073. contains. The zint_seg structure is of the form:</p>
  4074. <div class="sourceCode" id="cb76"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb76-1"><a href="#cb76-1" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_seg <span class="op">{</span></span>
  4075. <span id="cb76-2"><a href="#cb76-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">;</span> <span class="co">/* Data to encode */</span></span>
  4076. <span id="cb76-3"><a href="#cb76-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> length<span class="op">;</span> <span class="co">/* Length of `source`. If 0, `source` must be</span></span>
  4077. <span id="cb76-4"><a href="#cb76-4" aria-hidden="true" tabindex="-1"></a><span class="co"> NUL-terminated */</span></span>
  4078. <span id="cb76-5"><a href="#cb76-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> eci<span class="op">;</span> <span class="co">/* Extended Channel Interpretation */</span></span>
  4079. <span id="cb76-6"><a href="#cb76-6" aria-hidden="true" tabindex="-1"></a><span class="op">};</span></span></code></pre></div>
  4080. <p>The symbology must support ECIs (see Table <a
  4081. href="#tbl:eci_aware_symbologies">: ECI-Aware Symbologies</a>). For
  4082. example:</p>
  4083. <div class="sourceCode" id="cb77"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb77-1"><a href="#cb77-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
  4084. <span id="cb77-2"><a href="#cb77-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
  4085. <span id="cb77-3"><a href="#cb77-3" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
  4086. <span id="cb77-4"><a href="#cb77-4" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_seg segs<span class="op">[]</span> <span class="op">=</span> <span class="op">{</span></span>
  4087. <span id="cb77-5"><a href="#cb77-5" aria-hidden="true" tabindex="-1"></a> <span class="op">{</span> <span class="st">&quot;Κείμενο&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">9</span> <span class="op">},</span></span>
  4088. <span id="cb77-6"><a href="#cb77-6" aria-hidden="true" tabindex="-1"></a> <span class="op">{</span> <span class="st">&quot;Текст&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">7</span> <span class="op">},</span></span>
  4089. <span id="cb77-7"><a href="#cb77-7" aria-hidden="true" tabindex="-1"></a> <span class="op">{</span> <span class="st">&quot;文章&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">20</span> <span class="op">}</span></span>
  4090. <span id="cb77-8"><a href="#cb77-8" aria-hidden="true" tabindex="-1"></a> <span class="op">};</span></span>
  4091. <span id="cb77-9"><a href="#cb77-9" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
  4092. <span id="cb77-10"><a href="#cb77-10" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
  4093. <span id="cb77-11"><a href="#cb77-11" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_AZTEC<span class="op">;</span></span>
  4094. <span id="cb77-12"><a href="#cb77-12" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-&gt;</span>input_mode <span class="op">=</span> UNICODE_MODE<span class="op">;</span></span>
  4095. <span id="cb77-13"><a href="#cb77-13" aria-hidden="true" tabindex="-1"></a> ZBarcode_Encode_Segs<span class="op">(</span>my_symbol<span class="op">,</span> segs<span class="op">,</span> <span class="dv">3</span><span class="op">);</span></span>
  4096. <span id="cb77-14"><a href="#cb77-14" aria-hidden="true" tabindex="-1"></a> ZBarcode_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
  4097. <span id="cb77-15"><a href="#cb77-15" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
  4098. <span id="cb77-16"><a href="#cb77-16" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
  4099. <span id="cb77-17"><a href="#cb77-17" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  4100. <p>A maximum of 256 segments may be specified. Use of multiple segments
  4101. with GS1 data is not currently supported.</p>
  4102. <h2 id="scaling-helpers">5.13 Scaling Helpers</h2>
  4103. <p>To help with scaling the output, the following three function are
  4104. available:</p>
  4105. <div class="sourceCode" id="cb78"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb78-1"><a href="#cb78-1" aria-hidden="true" tabindex="-1"></a><span class="dt">float</span> ZBarcode_Default_Xdim<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">);</span></span>
  4106. <span id="cb78-2"><a href="#cb78-2" aria-hidden="true" tabindex="-1"></a></span>
  4107. <span id="cb78-3"><a href="#cb78-3" aria-hidden="true" tabindex="-1"></a><span class="dt">float</span> ZBarcode_Scale_From_XdimDp<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">float</span> x_dim_mm<span class="op">,</span> <span class="dt">float</span> dpmm<span class="op">,</span></span>
  4108. <span id="cb78-4"><a href="#cb78-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filetype<span class="op">)</span> <span class="op">{</span></span>
  4109. <span id="cb78-5"><a href="#cb78-5" aria-hidden="true" tabindex="-1"></a></span>
  4110. <span id="cb78-6"><a href="#cb78-6" aria-hidden="true" tabindex="-1"></a><span class="dt">float</span> ZBarcode_XdimDP_From_Scale<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">float</span> scale<span class="op">,</span></span>
  4111. <span id="cb78-7"><a href="#cb78-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">float</span> x_dim_mm_or_dpmm<span class="op">,</span> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filetype<span class="op">);</span></span></code></pre></div>
  4112. <p>The first <code>ZBarcode_Default_Xdim()</code> returns the default
  4113. X-dimension suggested by Zint for symbology <code>symbol_id</code>.</p>
  4114. <p>The second <code>ZBarcode_Scale_From_XdimDp()</code> returns the
  4115. scale to use to output to a file of type <code>filetype</code> with
  4116. X-dimension <code>x_dim_mm</code> at <code>dpmm</code> dots per mm. The
  4117. given X-dimension must be non-zero and less than or equal to 10mm,
  4118. however <code>dpmm</code> may be zero and defaults to 12 dpmm, and
  4119. <code>filetype</code> may be NULL or empty in which case a GIF filetype
  4120. is assumed. For raster output (BMP/GIF/PCX/PNG/TIF) the scale is rounded
  4121. to half-integer increments.</p>
  4122. <p>For example:</p>
  4123. <div class="sourceCode" id="cb79"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb79-1"><a href="#cb79-1" aria-hidden="true" tabindex="-1"></a><span class="co">/* Royal Mail 4-State Customer Code */</span></span>
  4124. <span id="cb79-2"><a href="#cb79-2" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_RM4SCC<span class="op">;</span></span>
  4125. <span id="cb79-3"><a href="#cb79-3" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>dpmm <span class="op">=</span> <span class="fl">600.0</span><span class="bu">f</span> <span class="op">/</span> <span class="fl">25.4</span><span class="bu">f</span><span class="op">;</span> <span class="co">/* 600 dpi */</span></span>
  4126. <span id="cb79-4"><a href="#cb79-4" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>scale <span class="op">=</span> ZBarcode_Scale_From_XdimDp<span class="op">(</span></span>
  4127. <span id="cb79-5"><a href="#cb79-5" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-&gt;</span>symbology<span class="op">,</span></span>
  4128. <span id="cb79-6"><a href="#cb79-6" aria-hidden="true" tabindex="-1"></a> ZBarcode_Default_Xdim<span class="op">(</span>my_symbol<span class="op">-&gt;</span>symbology<span class="op">),</span></span>
  4129. <span id="cb79-7"><a href="#cb79-7" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-&gt;</span>dpmm<span class="op">,</span> <span class="st">&quot;PNG&quot;</span><span class="op">);</span> <span class="co">/* Returns 7.5 */</span></span></code></pre></div>
  4130. <p>The third function <code>ZBarcode_XdimDP_From_Scale()</code> is the
  4131. “reverse” of <code>ZBarcode_Scale_From_XdimDp()</code>, returning the
  4132. X-dimension (in mm) or the dot density (in dpmm) given a scale
  4133. <code>scale</code>. Both <code>scale</code> and
  4134. <code>x_dim_mm_or_dpmm</code> must be non-zero. The returned value is
  4135. bound to the maximum value of dpmm (1000), so must be further bound to
  4136. 10 on return if the X-dimension is sought.</p>
  4137. <p>Note that the X-dimension to use is application dependent, and varies
  4138. not only due to the symbology, resolution and filetype but also due to
  4139. the type of scanner used, the intended scanning distance, and what media
  4140. (“substrates”) the barcode appears on.</p>
  4141. <h2 id="verifying-symbology-availability">5.14 Verifying Symbology
  4142. Availability</h2>
  4143. <p>An additional function available in the API is:</p>
  4144. <div class="sourceCode" id="cb80"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb80-1"><a href="#cb80-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_ValidID<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">);</span></span></code></pre></div>
  4145. <p>which allows you to check whether a given symbology is available,
  4146. returning a non-zero value if so. For example:</p>
  4147. <div class="sourceCode" id="cb81"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb81-1"><a href="#cb81-1" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>ZBarcode_ValidID<span class="op">(</span>BARCODE_PDF417<span class="op">)</span> <span class="op">!=</span> <span class="dv">0</span><span class="op">)</span> <span class="op">{</span></span>
  4148. <span id="cb81-2"><a href="#cb81-2" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;PDF417 available</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
  4149. <span id="cb81-3"><a href="#cb81-3" aria-hidden="true" tabindex="-1"></a><span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span>
  4150. <span id="cb81-4"><a href="#cb81-4" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;PDF417 not available</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
  4151. <span id="cb81-5"><a href="#cb81-5" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  4152. <p>Another function that may be useful is:</p>
  4153. <div class="sourceCode" id="cb82"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb82-1"><a href="#cb82-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_BarcodeName<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">char</span> name<span class="op">[</span><span class="dv">32</span><span class="op">]);</span></span></code></pre></div>
  4154. <p>which copies the name of a symbology into the supplied
  4155. <code>name</code> buffer, which should be 32 characters in length. The
  4156. name is <code>NUL</code>-terminated, and zero is returned on success.
  4157. For instance:</p>
  4158. <div class="sourceCode" id="cb83"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb83-1"><a href="#cb83-1" aria-hidden="true" tabindex="-1"></a><span class="dt">char</span> name<span class="op">[</span><span class="dv">32</span><span class="op">];</span></span>
  4159. <span id="cb83-2"><a href="#cb83-2" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>ZBarcode_BarcodeName<span class="op">(</span>BARCODE_PDF417<span class="op">,</span> name<span class="op">)</span> <span class="op">==</span> <span class="dv">0</span><span class="op">)</span> <span class="op">{</span></span>
  4160. <span id="cb83-3"><a href="#cb83-3" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">%s\n</span><span class="st">&quot;</span><span class="op">,</span> name<span class="op">);</span></span>
  4161. <span id="cb83-4"><a href="#cb83-4" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  4162. <p>will print <code>BARCODE_PDF417</code>.</p>
  4163. <h2 id="checking-symbology-capabilities">5.15 Checking Symbology
  4164. Capabilities</h2>
  4165. <p>It can be useful for frontend programs to know the capabilities of a
  4166. symbology. This can be determined using another additional function:</p>
  4167. <div class="sourceCode" id="cb84"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb84-1"><a href="#cb84-1" aria-hidden="true" tabindex="-1"></a><span class="dt">unsigned</span> <span class="dt">int</span> ZBarcode_Cap<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">unsigned</span> <span class="dt">int</span> cap_flag<span class="op">);</span></span></code></pre></div>
  4168. <p>by <code>OR</code>-ing the flags below in the <code>cap_flag</code>
  4169. argument and checking the return to see which are set.</p>
  4170. <div id="tbl:api_cap" class="tablenos">
  4171. <table id="tbl:api_cap" data-tag=": API Capability Flags">
  4172. <caption><span>Table : API Capability Flags</span> </caption>
  4173. <colgroup>
  4174. <col style="width: 35%" />
  4175. <col style="width: 64%" />
  4176. </colgroup>
  4177. <thead>
  4178. <tr>
  4179. <th style="text-align: left;">Value</th>
  4180. <th style="text-align: left;">Meaning</th>
  4181. </tr>
  4182. </thead>
  4183. <tbody>
  4184. <tr>
  4185. <td style="text-align: left;"><code>ZINT_CAP_HRT</code></td>
  4186. <td style="text-align: left;">Can the symbology print Human Readable
  4187. Text?</td>
  4188. </tr>
  4189. <tr>
  4190. <td style="text-align: left;"><code>ZINT_CAP_STACKABLE</code></td>
  4191. <td style="text-align: left;">Is the symbology stackable?</td>
  4192. </tr>
  4193. <tr>
  4194. <td style="text-align: left;"><code>ZINT_CAP_EANUPC</code><a
  4195. href="#fn13" class="footnote-ref" id="fnref13"
  4196. role="doc-noteref"><sup>13</sup></a></td>
  4197. <td style="text-align: left;">Is the symbology EAN/UPC?</td>
  4198. </tr>
  4199. <tr>
  4200. <td style="text-align: left;"><code>ZINT_CAP_COMPOSITE</code></td>
  4201. <td style="text-align: left;">Does the symbology support composite data?
  4202. (see <a href="#gs1-composite-symbols-iso-24723">6.3 GS1 Composite
  4203. Symbols (ISO 24723)</a> below)</td>
  4204. </tr>
  4205. <tr>
  4206. <td style="text-align: left;"><code>ZINT_CAP_ECI</code></td>
  4207. <td style="text-align: left;">Does the symbology support Extended
  4208. Channel Interpretations?</td>
  4209. </tr>
  4210. <tr>
  4211. <td style="text-align: left;"><code>ZINT_CAP_GS1</code></td>
  4212. <td style="text-align: left;">Does the symbology support GS1 data?</td>
  4213. </tr>
  4214. <tr>
  4215. <td style="text-align: left;"><code>ZINT_CAP_DOTTY</code></td>
  4216. <td style="text-align: left;">Can the symbology be outputted as
  4217. dots?</td>
  4218. </tr>
  4219. <tr>
  4220. <td style="text-align: left;"><code>ZINT_CAP_QUIET_ZONES</code></td>
  4221. <td style="text-align: left;">Does the symbology have default quiet
  4222. zones?</td>
  4223. </tr>
  4224. <tr>
  4225. <td style="text-align: left;"><code>ZINT_CAP_FIXED_RATIO</code></td>
  4226. <td style="text-align: left;">Does the symbology have a fixed
  4227. width-to-height (aspect) ratio?</td>
  4228. </tr>
  4229. <tr>
  4230. <td style="text-align: left;"><code>ZINT_CAP_READER_INIT</code></td>
  4231. <td style="text-align: left;">Does the symbology support Reader
  4232. Initialisation?</td>
  4233. </tr>
  4234. <tr>
  4235. <td style="text-align: left;"><code>ZINT_CAP_FULL_MULTIBYTE</code></td>
  4236. <td style="text-align: left;">Is the <code>ZINT_FULL_MULTIBYTE</code>
  4237. option applicable?</td>
  4238. </tr>
  4239. <tr>
  4240. <td style="text-align: left;"><code>ZINT_CAP_MASK</code></td>
  4241. <td style="text-align: left;">Is mask selection applicable?</td>
  4242. </tr>
  4243. <tr>
  4244. <td style="text-align: left;"><code>ZINT_CAP_STRUCTAPP</code></td>
  4245. <td style="text-align: left;">Does the symbology support Structured
  4246. Append?</td>
  4247. </tr>
  4248. <tr>
  4249. <td
  4250. style="text-align: left;"><code>ZINT_CAP_COMPLIANT_HEIGHT</code></td>
  4251. <td style="text-align: left;">Does the symbology have a compliant height
  4252. defined?</td>
  4253. </tr>
  4254. </tbody>
  4255. </table>
  4256. </div>
  4257. <p>For example:</p>
  4258. <div class="sourceCode" id="cb85"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb85-1"><a href="#cb85-1" aria-hidden="true" tabindex="-1"></a><span class="dt">unsigned</span> <span class="dt">int</span> cap<span class="op">;</span></span>
  4259. <span id="cb85-2"><a href="#cb85-2" aria-hidden="true" tabindex="-1"></a>cap <span class="op">=</span> ZBarcode_Cap<span class="op">(</span>BARCODE_PDF417<span class="op">,</span> ZINT_CAP_HRT <span class="op">|</span> ZINT_CAP_ECI<span class="op">);</span></span>
  4260. <span id="cb85-3"><a href="#cb85-3" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>cap <span class="op">&amp;</span> ZINT_CAP_HRT<span class="op">)</span> <span class="op">{</span></span>
  4261. <span id="cb85-4"><a href="#cb85-4" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;PDF417 supports HRT</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
  4262. <span id="cb85-5"><a href="#cb85-5" aria-hidden="true" tabindex="-1"></a><span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span>
  4263. <span id="cb85-6"><a href="#cb85-6" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;PDF417 does not support HRT</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
  4264. <span id="cb85-7"><a href="#cb85-7" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span>
  4265. <span id="cb85-8"><a href="#cb85-8" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>cap <span class="op">&amp;</span> ZINT_CAP_ECI<span class="op">)</span> <span class="op">{</span></span>
  4266. <span id="cb85-9"><a href="#cb85-9" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;PDF417 supports ECI</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
  4267. <span id="cb85-10"><a href="#cb85-10" aria-hidden="true" tabindex="-1"></a><span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span>
  4268. <span id="cb85-11"><a href="#cb85-11" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">&quot;PDF417 does not support ECI</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
  4269. <span id="cb85-12"><a href="#cb85-12" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
  4270. <h2 id="zint-version">5.16 Zint Version</h2>
  4271. <p>Whether the Zint library linked to was built with PNG support may be
  4272. determined with:</p>
  4273. <div class="sourceCode" id="cb86"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb86-1"><a href="#cb86-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_NoPng<span class="op">();</span></span></code></pre></div>
  4274. <p>which returns 1 if no PNG support is available, else zero.</p>
  4275. <p>Lastly, the version of the Zint library linked to is returned by:</p>
  4276. <div class="sourceCode" id="cb87"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb87-1"><a href="#cb87-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Version<span class="op">();</span></span></code></pre></div>
  4277. <p>The version parts are separated by hundreds. For instance, version
  4278. <code>"2.9.1"</code> is returned as <code>"20901"</code>.</p>
  4279. <h1 id="types-of-symbology">6. Types of Symbology</h1>
  4280. <h2 id="one-dimensional-symbols">6.1 One-Dimensional Symbols</h2>
  4281. <p>One-dimensional or linear symbols are what most people associate with
  4282. the term barcode. They consist of a number of bars and a number of
  4283. spaces of differing widths.</p>
  4284. <h3 id="code-11">6.1.1 Code 11</h3>
  4285. <figure>
  4286. <img src="images/code11.svg" title="fig:" class="lin"
  4287. alt="zint -b CODE11 -d &quot;9212320967&quot;" />
  4288. <figcaption
  4289. aria-hidden="true"><code>zint -b CODE11 -d "9212320967"</code></figcaption>
  4290. </figure>
  4291. <p>Developed by Intermec in 1977, Code 11 is similar to Code 2 of 5
  4292. Matrix and is primarily used in telecommunications. The symbol can
  4293. encode data consisting of the digits 0-9 and the dash character
  4294. (<code>-</code>) up to a maximum of 140 characters. Two modulo-11 check
  4295. digits are added by default. To add just one check digit, set
  4296. <code>--vers=1</code> (API <code>option_2 = 1</code>). To add no check
  4297. digits, set <code>--vers=2</code> (API <code>option_2 = 2</code>).</p>
  4298. <h3 id="code-2-of-5">6.1.2 Code 2 of 5</h3>
  4299. <p>Code 2 of 5 is a family of one-dimensional symbols, 8 of which are
  4300. supported by Zint. Note that the names given to these standards alters
  4301. from one source to another so you should take care to ensure that you
  4302. have the right barcode type before using these standards.</p>
  4303. <h4 id="standard-code-2-of-5">6.1.2.1 Standard Code 2 of 5</h4>
  4304. <figure>
  4305. <img src="images/c25standard.svg" title="fig:" class="lin"
  4306. alt="zint -b C25STANDARD -d &quot;9212320967&quot;" />
  4307. <figcaption
  4308. aria-hidden="true"><code>zint -b C25STANDARD -d "9212320967"</code></figcaption>
  4309. </figure>
  4310. <p>Also known as Code 2 of 5 Matrix, this is a self-checking code used
  4311. in industrial applications and photo development. Standard Code 2 of 5
  4312. will encode numeric input (digits 0-9) up to a maximum of 112 digits. No
  4313. check digit is added by default. To add a check digit, set
  4314. <code>--vers=1</code> (API <code>option_2 = 1</code>). To add a check
  4315. digit but not show it in the Human Readable Text, set
  4316. <code>--vers=2</code> (API <code>option_2 = 2</code>).</p>
  4317. <h4 id="iata-code-2-of-5">6.1.2.2 IATA Code 2 of 5</h4>
  4318. <figure>
  4319. <img src="images/c25iata.svg" title="fig:" class="lin"
  4320. alt="zint -b C25IATA -d &quot;9212320967&quot;" />
  4321. <figcaption
  4322. aria-hidden="true"><code>zint -b C25IATA -d "9212320967"</code></figcaption>
  4323. </figure>
  4324. <p>Used for baggage handling in the air-transport industry by the
  4325. International Air Transport Agency, this self-checking code will encode
  4326. numeric input (digits 0-9) up to a maximum of 80 digits. No check digit
  4327. is added by default, but can be set the same as for <a
  4328. href="#standard-code-2-of-5">6.1.2.1 Standard Code 2 of 5</a>.</p>
  4329. <h4 id="industrial-code-2-of-5">6.1.2.3 Industrial Code 2 of 5</h4>
  4330. <figure>
  4331. <img src="images/c25ind.svg" title="fig:" class="lin"
  4332. alt="zint -b C25IND -d &quot;9212320967&quot;" />
  4333. <figcaption
  4334. aria-hidden="true"><code>zint -b C25IND -d "9212320967"</code></figcaption>
  4335. </figure>
  4336. <p>Industrial Code 2 of 5 can encode numeric input (digits 0-9) up to a
  4337. maximum of 79 digits. No check digit is added by default, but can be set
  4338. the same as for <a href="#standard-code-2-of-5">6.1.2.1 Standard Code 2
  4339. of 5</a>.</p>
  4340. <h4 id="interleaved-code-2-of-5-iso-16390">6.1.2.4 Interleaved Code 2 of
  4341. 5 (ISO 16390)</h4>
  4342. <figure>
  4343. <img src="images/c25inter.svg" title="fig:" class="lin"
  4344. alt="zint -b C25INTER --compliantheight -d &quot;9212320967&quot;" />
  4345. <figcaption
  4346. aria-hidden="true"><code>zint -b C25INTER --compliantheight -d "9212320967"</code></figcaption>
  4347. </figure>
  4348. <p>This self-checking symbology encodes pairs of numbers, and so can
  4349. only encode an even number of digits (0-9). If an odd number of digits
  4350. is entered a leading zero is added by Zint. A maximum of 62 pairs (124
  4351. digits) can be encoded. No check digit is added by default, but can be
  4352. set the same as for <a href="#standard-code-2-of-5">6.1.2.1 Standard
  4353. Code 2 of 5</a>.</p>
  4354. <h4 id="code-2-of-5-data-logic">6.1.2.5 Code 2 of 5 Data Logic</h4>
  4355. <figure>
  4356. <img src="images/c25logic.svg" title="fig:" class="lin"
  4357. alt="zint -b C25LOGIC -d &quot;9212320967&quot;" />
  4358. <figcaption
  4359. aria-hidden="true"><code>zint -b C25LOGIC -d "9212320967"</code></figcaption>
  4360. </figure>
  4361. <p>Data Logic does not include a check digit by default and can encode
  4362. numeric input (digits 0-9) up to a maximum of 113 digits. Check digit
  4363. options are the same as for <a href="#standard-code-2-of-5">6.1.2.1
  4364. Standard Code 2 of 5</a>.</p>
  4365. <h4 id="itf-14">6.1.2.6 ITF-14</h4>
  4366. <figure>
  4367. <img src="images/itf14.svg" title="fig:" class="lin"
  4368. alt="zint -b ITF14 --compliantheight -d &quot;9212320967145&quot;" />
  4369. <figcaption
  4370. aria-hidden="true"><code>zint -b ITF14 --compliantheight -d "9212320967145"</code></figcaption>
  4371. </figure>
  4372. <p>ITF-14, also known as UPC Shipping Container Symbol or Case Code, is
  4373. based on Interleaved Code 2 of 5 and requires a 13-digit numeric input
  4374. (digits 0-9). One modulo-10 check digit is added by Zint.</p>
  4375. <p>If no border option is specified Zint defaults to adding a bounding
  4376. box with a border width of 5. This behaviour can be overridden by using
  4377. the <code>--bind</code> option (API
  4378. <code>output_options |= BARCODE_BIND</code>). Similarly the border width
  4379. can be overridden using <code>--border</code> (API
  4380. <code>border_width</code>). If a symbol with no border is required this
  4381. can be achieved by explicitly setting the border type to box (or bind or
  4382. bindtop) and leaving the border width 0.</p>
  4383. <figure>
  4384. <img src="images/itf14_border0.svg" title="fig:" class="lin"
  4385. alt="zint -b ITF14 --box --compliantheight -d &quot;9212320967145&quot;" />
  4386. <figcaption
  4387. aria-hidden="true"><code>zint -b ITF14 --box --compliantheight -d "9212320967145"</code></figcaption>
  4388. </figure>
  4389. <h4 id="deutsche-post-leitcode">6.1.2.7 Deutsche Post Leitcode</h4>
  4390. <figure>
  4391. <img src="images/dpleit.svg" title="fig:" class="lin"
  4392. alt="zint -b DPLEIT -d &quot;9212320967145&quot;" />
  4393. <figcaption
  4394. aria-hidden="true"><code>zint -b DPLEIT -d "9212320967145"</code></figcaption>
  4395. </figure>
  4396. <p>Leitcode is based on Interleaved Code 2 of 5 and is used by Deutsche
  4397. Post for routing purposes. Leitcode requires a 13-digit numerical input
  4398. to which Zint adds a check digit.</p>
  4399. <h4 id="deutsche-post-identcode">6.1.2.8 Deutsche Post Identcode</h4>
  4400. <figure>
  4401. <img src="images/dpident.svg" title="fig:" class="lin"
  4402. alt="zint -b DPIDENT -d &quot;91232096712&quot;" />
  4403. <figcaption
  4404. aria-hidden="true"><code>zint -b DPIDENT -d "91232096712"</code></figcaption>
  4405. </figure>
  4406. <p>Identcode is based on Interleaved Code 2 of 5 and is used by Deutsche
  4407. Post for identification purposes. Identcode requires an 11-digit
  4408. numerical input to which Zint adds a check digit.</p>
  4409. <h3 id="upc-universal-product-code-iso-15420">6.1.3 UPC (Universal
  4410. Product Code) (ISO 15420)</h3>
  4411. <h4 id="upc-version-a">6.1.3.1 UPC Version A</h4>
  4412. <figure>
  4413. <img src="images/upca.svg" title="fig:" class="upcean"
  4414. alt="zint -b UPCA --compliantheight -d &quot;72527270270&quot;" />
  4415. <figcaption
  4416. aria-hidden="true"><code>zint -b UPCA --compliantheight -d "72527270270"</code></figcaption>
  4417. </figure>
  4418. <p>UPC-A is used in the United States for retail applications. The
  4419. symbol requires an 11-digit article number. The check digit is
  4420. calculated by Zint. In addition EAN-2 and EAN-5 add-on symbols can be
  4421. added using the + character. For example, to draw a UPC-A symbol with
  4422. the data 72527270270 with an EAN-5 add-on showing the data 12345 use the
  4423. command:</p>
  4424. <div class="sourceCode" id="cb88"><pre
  4425. class="sourceCode bash"><code class="sourceCode bash"><span id="cb88-1"><a href="#cb88-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCA <span class="at">-d</span> <span class="st">&quot;72527270270+12345&quot;</span></span></code></pre></div>
  4426. <p>or using the API encode a data string with the + character
  4427. included:</p>
  4428. <div class="sourceCode" id="cb89"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb89-1"><a href="#cb89-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_UPCA<span class="op">;</span></span>
  4429. <span id="cb89-2"><a href="#cb89-2" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;72527270270+12345&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div>
  4430. <figure>
  4431. <img src="images/upca_5.svg" title="fig:" class="upcean"
  4432. alt="zint -b UPCA --compliantheight -d &quot;72527270270+12345&quot;" />
  4433. <figcaption
  4434. aria-hidden="true"><code>zint -b UPCA --compliantheight -d "72527270270+12345"</code></figcaption>
  4435. </figure>
  4436. <p>If your input data already includes the check digit symbology
  4437. <code>BARCODE_UPCA_CHK</code> (35) can be used which takes a 12-digit
  4438. input and validates the check digit before encoding.</p>
  4439. <p>A quiet zone indicator can be added to the HRT by setting
  4440. <code>--guardwhitespace</code> (API
  4441. <code>output_options |= EANUPC_GUARD_WHITESPACE</code>). For UPC, this
  4442. is only relevant when there is add-on:</p>
  4443. <div class="sourceCode" id="cb90"><pre
  4444. class="sourceCode bash"><code class="sourceCode bash"><span id="cb90-1"><a href="#cb90-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCA <span class="at">-d</span> <span class="st">&quot;72527270270+12345&quot;</span> <span class="at">--guardwhitespace</span></span></code></pre></div>
  4445. <p>or using the API:</p>
  4446. <div class="sourceCode" id="cb91"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb91-1"><a href="#cb91-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_UPCA<span class="op">;</span></span>
  4447. <span id="cb91-2"><a href="#cb91-2" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>output_options <span class="op">|=</span> EANUPC_GUARD_WHITESPACE<span class="op">;</span></span>
  4448. <span id="cb91-3"><a href="#cb91-3" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;72527270270+12345&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div>
  4449. <figure>
  4450. <img src="images/upca_5_gws.svg" title="fig:" class="upcean"
  4451. alt="zint -b UPCA --compliantheight -d &quot;72527270270+12345&quot; --guardwhitespace" />
  4452. <figcaption
  4453. aria-hidden="true"><code>zint -b UPCA --compliantheight -d "72527270270+12345" --guardwhitespace</code></figcaption>
  4454. </figure>
  4455. <p>You can adjust the gap between the main symbol and an add-on in
  4456. integral multiples of the X-dimension by setting <code>--addongap</code>
  4457. (API <code>option_2</code>) to a value between 9 (default) and 12. The
  4458. height in X-dimensions that the guard bars descend below the main bars
  4459. can be adjusted by setting <code>--guarddescent</code> (API
  4460. <code>guard_descent</code>) to a value between 0.0 and 20.0 (default
  4461. 5.0).</p>
  4462. <h4 id="upc-version-e">6.1.3.2 UPC Version E</h4>
  4463. <figure>
  4464. <img src="images/upce.svg" title="fig:" class="upcean"
  4465. alt="zint -b UPCE --compliantheight -d &quot;1123456&quot;" />
  4466. <figcaption
  4467. aria-hidden="true"><code>zint -b UPCE --compliantheight -d "1123456"</code></figcaption>
  4468. </figure>
  4469. <p>UPC-E is a zero-compressed version of UPC-A developed for smaller
  4470. packages. The code requires a 6-digit article number (digits 0-9). The
  4471. check digit is calculated by Zint. EAN-2 and EAN-5 add-on symbols can be
  4472. added using the + character as with UPC-A. In addition Zint also
  4473. supports Number System 1 encoding by entering a 7-digit article number
  4474. starting with the digit 1. For example:</p>
  4475. <div class="sourceCode" id="cb92"><pre
  4476. class="sourceCode bash"><code class="sourceCode bash"><span id="cb92-1"><a href="#cb92-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCE <span class="at">-d</span> <span class="st">&quot;1123456&quot;</span></span></code></pre></div>
  4477. <p>or</p>
  4478. <div class="sourceCode" id="cb93"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb93-1"><a href="#cb93-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_UPCE<span class="op">;</span></span>
  4479. <span id="cb93-2"><a href="#cb93-2" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;1123456&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div>
  4480. <p>If your input data already includes the check digit symbology
  4481. <code>BARCODE_UPCE_CHK</code> (38) can be used which takes a 7 or
  4482. 8-digit input and validates the check digit before encoding.</p>
  4483. <p>As with UPC-A, a quiet zone indicator can be added when there is an
  4484. add-on by setting <code>--guardwhitespace</code> (API
  4485. <code>output_options |= EANUPC_GUARD_WHITESPACE</code>):</p>
  4486. <div class="sourceCode" id="cb94"><pre
  4487. class="sourceCode bash"><code class="sourceCode bash"><span id="cb94-1"><a href="#cb94-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCE <span class="at">-d</span> <span class="st">&quot;1123456+12&quot;</span> <span class="at">--guardwhitespace</span></span></code></pre></div>
  4488. <figure>
  4489. <img src="images/upce_2_gws.svg" title="fig:" class="upcean"
  4490. alt="zint -b UPCE --compliantheight -d &quot;1123456+12&quot; --guardwhitespace" />
  4491. <figcaption
  4492. aria-hidden="true"><code>zint -b UPCE --compliantheight -d "1123456+12" --guardwhitespace</code></figcaption>
  4493. </figure>
  4494. <p>You can adjust the gap between the main symbol and an add-on in
  4495. integral multiples of the X-dimension by setting <code>--addongap</code>
  4496. (API <code>option_2</code>) to a value between 7 (default) and 12. The
  4497. height in X-dimensions that the guard bars descend below the main bars
  4498. can be adjusted by setting <code>--guarddescent</code> (API
  4499. <code>guard_descent</code>) to a value between 0.0 and 20.0 (default
  4500. 5.0).</p>
  4501. <h3 id="ean-european-article-number-iso-15420">6.1.4 EAN (European
  4502. Article Number) (ISO 15420)</h3>
  4503. <h4 id="ean-2-ean-5-ean-8-and-ean-13">6.1.4.1 EAN-2, EAN-5, EAN-8 and
  4504. EAN-13</h4>
  4505. <figure>
  4506. <img src="images/eanx13.svg" title="fig:" class="upcean"
  4507. alt="zint -b EANX --compliantheight -d &quot;4512345678906&quot;" />
  4508. <figcaption
  4509. aria-hidden="true"><code>zint -b EANX --compliantheight -d "4512345678906"</code></figcaption>
  4510. </figure>
  4511. <p>The EAN system is used in retail across Europe and includes standards
  4512. for EAN-2, EAN-5, EAN-8 and EAN-13 which encode 2, 5, 7 or 12-digit
  4513. numbers respectively. Zint will decide which symbology to use depending
  4514. on the length of the input data. In addition EAN-2 and EAN-5 add-on
  4515. symbols can be added to EAN-8 and EAN-13 symbols using the + character
  4516. as with UPC symbols. For example:</p>
  4517. <div class="sourceCode" id="cb95"><pre
  4518. class="sourceCode bash"><code class="sourceCode bash"><span id="cb95-1"><a href="#cb95-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">&quot;54321&quot;</span></span></code></pre></div>
  4519. <figure>
  4520. <img src="images/eanx5.svg" title="fig:" class="upcean"
  4521. alt="zint -b EANX --compliantheight -d &quot;54321&quot;" />
  4522. <figcaption
  4523. aria-hidden="true"><code>zint -b EANX --compliantheight -d "54321"</code></figcaption>
  4524. </figure>
  4525. <p>will encode a stand-alone EAN-5, whereas</p>
  4526. <div class="sourceCode" id="cb96"><pre
  4527. class="sourceCode bash"><code class="sourceCode bash"><span id="cb96-1"><a href="#cb96-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">&quot;7432365+54321&quot;</span></span></code></pre></div>
  4528. <p>will encode an EAN-8 symbol with an EAN-5 add-on. As before these
  4529. results can be achieved using the API:</p>
  4530. <div class="sourceCode" id="cb97"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb97-1"><a href="#cb97-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_EANX<span class="op">;</span></span>
  4531. <span id="cb97-2"><a href="#cb97-2" aria-hidden="true" tabindex="-1"></a></span>
  4532. <span id="cb97-3"><a href="#cb97-3" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;54321&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
  4533. <span id="cb97-4"><a href="#cb97-4" aria-hidden="true" tabindex="-1"></a></span>
  4534. <span id="cb97-5"><a href="#cb97-5" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;7432365+54321&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div>
  4535. <figure>
  4536. <img src="images/eanx8_5.svg" title="fig:" class="upcean"
  4537. alt="zint -b EANX --compliantheight -d &quot;7432365+54321&quot;" />
  4538. <figcaption
  4539. aria-hidden="true"><code>zint -b EANX --compliantheight -d "7432365+54321"</code></figcaption>
  4540. </figure>
  4541. <p>All of the EAN symbols include check digits which are added by
  4542. Zint.</p>
  4543. <p>If you are encoding an EAN-8 or EAN-13 symbol and your data already
  4544. includes the check digit then you can use symbology
  4545. <code>BARCODE_EANX_CHK</code> (14) which takes an 8 or 13-digit input
  4546. and validates the check digit before encoding.</p>
  4547. <p>Options to add quiet zone indicators and to adjust the add-on gap and
  4548. the guard bar descent height are the same as for <a
  4549. href="#upc-version-e">6.1.3.2 UPC Version E</a>. For instance:</p>
  4550. <div class="sourceCode" id="cb98"><pre
  4551. class="sourceCode bash"><code class="sourceCode bash"><span id="cb98-1"><a href="#cb98-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX_CHK <span class="at">-d</span> <span class="st">&quot;74323654&quot;</span> <span class="at">--guardwhitespace</span></span></code></pre></div>
  4552. <figure>
  4553. <img src="images/eanx8_gws.svg" title="fig:" class="upcean"
  4554. alt="zint -b EANX_CHK --compliantheight -d &quot;74323654&quot; –guardwhitespace" />
  4555. <figcaption
  4556. aria-hidden="true"><code>zint -b EANX_CHK --compliantheight -d "74323654"</code>
  4557. –guardwhitespace</figcaption>
  4558. </figure>
  4559. <h4 id="sbn-isbn-and-isbn-13">6.1.4.2 SBN, ISBN and ISBN-13</h4>
  4560. <figure>
  4561. <img src="images/isbnx.svg" title="fig:" class="upcean"
  4562. alt="zint -b ISBNX --compliantheight -d &quot;9789295055124&quot;" />
  4563. <figcaption
  4564. aria-hidden="true"><code>zint -b ISBNX --compliantheight -d "9789295055124"</code></figcaption>
  4565. </figure>
  4566. <p>EAN-13 symbols (also known as Bookland EAN-13) can also be produced
  4567. from 9-digit SBN, 10-digit ISBN or 13-digit ISBN-13 data. The relevant
  4568. check digit needs to be present in the input data and will be verified
  4569. before the symbol is generated.</p>
  4570. <p>As with EAN-13, a quiet zone indicator can be added using
  4571. <code>--guardwhitespace</code>:</p>
  4572. <figure>
  4573. <img src="images/isbnx_gws.svg" title="fig:" class="upcean"
  4574. alt="zint -b ISBNX --compliantheight -d &quot;9789295055124&quot; --guardwhitespace" />
  4575. <figcaption
  4576. aria-hidden="true"><code>zint -b ISBNX --compliantheight -d "9789295055124" --guardwhitespace</code></figcaption>
  4577. </figure>
  4578. <p>EAN-2 and EAN-5 add-on symbols can be added using the + character,
  4579. and there are options to adjust the add-on gap and the guard bar descent
  4580. height - see <a href="#upc-version-e">6.1.3.2 UPC Version E</a>.</p>
  4581. <h3 id="plessey">6.1.5 Plessey</h3>
  4582. <h4 id="uk-plessey">6.1.5.1 UK Plessey</h4>
  4583. <figure>
  4584. <img src="images/plessey.svg" title="fig:" class="lin"
  4585. alt="zint -b PLESSEY -d &quot;C64&quot;" />
  4586. <figcaption
  4587. aria-hidden="true"><code>zint -b PLESSEY -d "C64"</code></figcaption>
  4588. </figure>
  4589. <p>Also known as Plessey Code, this symbology was developed by the
  4590. Plessey Company Ltd. in the UK. The symbol can encode data consisting of
  4591. digits (0-9) or letters A-F up to a maximum of 67 characters and
  4592. includes a hidden CRC check digit.</p>
  4593. <h4 id="msi-plessey">6.1.5.2 MSI Plessey</h4>
  4594. <figure>
  4595. <img src="images/msi_plessey.svg" title="fig:" class="lin"
  4596. alt="zint -b MSI_PLESSEY -d &quot;6502&quot; --vers=2" />
  4597. <figcaption
  4598. aria-hidden="true"><code>zint -b MSI_PLESSEY -d "6502" --vers=2</code></figcaption>
  4599. </figure>
  4600. <p>Based on Plessey and developed by MSI Data Corporation, MSI Plessey
  4601. can encode numeric (digits 0-9) input of up to 92 digits. It has a range
  4602. of check digit options that are selectable by setting
  4603. <code>--vers</code> (API <code>option_2</code>), shown in the table
  4604. below:</p>
  4605. <div id="tbl:msi_plessey_check_digits" class="tablenos">
  4606. <table id="tbl:msi_plessey_check_digits"
  4607. data-tag=": MSI Plessey Check Digit Options">
  4608. <caption><span>Table : MSI Plessey Check Digit Options</span>
  4609. </caption>
  4610. <thead>
  4611. <tr>
  4612. <th>Value</th>
  4613. <th style="text-align: left;">Check Digits</th>
  4614. </tr>
  4615. </thead>
  4616. <tbody>
  4617. <tr>
  4618. <td>0</td>
  4619. <td style="text-align: left;">None</td>
  4620. </tr>
  4621. <tr>
  4622. <td>1</td>
  4623. <td style="text-align: left;">Modulo-10 (Luhn)</td>
  4624. </tr>
  4625. <tr>
  4626. <td>2</td>
  4627. <td style="text-align: left;">Modulo-10 &amp; Modulo-10</td>
  4628. </tr>
  4629. <tr>
  4630. <td>3</td>
  4631. <td style="text-align: left;">Modulo-11 (IBM)</td>
  4632. </tr>
  4633. <tr>
  4634. <td>4</td>
  4635. <td style="text-align: left;">Modulo-11 (IBM) &amp; Modulo-10</td>
  4636. </tr>
  4637. <tr>
  4638. <td>5</td>
  4639. <td style="text-align: left;">Modulo-11 (NCR)</td>
  4640. </tr>
  4641. <tr>
  4642. <td>6</td>
  4643. <td style="text-align: left;">Modulo-11 (NCR) &amp; Modulo-10</td>
  4644. </tr>
  4645. </tbody>
  4646. </table>
  4647. </div>
  4648. <p>To not show the check digit or digits in the Human Readable Text, add
  4649. 10 to the <code>--vers</code> value. For example <code>--vers=12</code>
  4650. (API <code>option_2 = 12</code>) will add two hidden modulo-10 check
  4651. digits.</p>
  4652. <h3 id="telepen">6.1.6 Telepen</h3>
  4653. <h4 id="telepen-alpha">6.1.6.1 Telepen Alpha</h4>
  4654. <figure>
  4655. <img src="images/telepen.svg" title="fig:" class="lin"
  4656. alt="zint -b TELEPEN --compliantheight -d &quot;Z80&quot;" />
  4657. <figcaption
  4658. aria-hidden="true"><code>zint -b TELEPEN --compliantheight -d "Z80"</code></figcaption>
  4659. </figure>
  4660. <p>Telepen Alpha was developed by SB Electronic Systems Limited and can
  4661. encode ASCII text input, up to a maximum of 69 characters. Telepen
  4662. includes a hidden modulo-127 check digit, added by Zint.</p>
  4663. <h4 id="telepen-numeric">6.1.6.2 Telepen Numeric</h4>
  4664. <figure>
  4665. <img src="images/telepen_num.svg" title="fig:" class="lin"
  4666. alt="zint -b TELEPEN_NUM --compliantheight -d &quot;466X33&quot;" />
  4667. <figcaption
  4668. aria-hidden="true"><code>zint -b TELEPEN_NUM --compliantheight -d "466X33"</code></figcaption>
  4669. </figure>
  4670. <p>Telepen Numeric allows compression of numeric data into a Telepen
  4671. symbol. Data can consist of pairs of numbers or pairs consisting of a
  4672. numerical digit followed an X character. For example: 466333 and 466X33
  4673. are valid codes whereas 46X333 is not (the digit pair <code>"X3"</code>
  4674. is not valid). Up to 136 digits can be encoded. Telepen Numeric includes
  4675. a hidden modulo-127 check digit which is added by Zint.</p>
  4676. <h3 id="code-39">6.1.7 Code 39</h3>
  4677. <h4 id="standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO
  4678. 16388)</h4>
  4679. <figure>
  4680. <img src="images/code39.svg" title="fig:" class="lin"
  4681. alt="zint -b CODE39 --compliantheight -d &quot;1A&quot; --vers=1" />
  4682. <figcaption
  4683. aria-hidden="true"><code>zint -b CODE39 --compliantheight -d "1A" --vers=1</code></figcaption>
  4684. </figure>
  4685. <p>Standard Code 39 was developed in 1974 by Intermec. Input data can be
  4686. up to 86 characters in length and can include the characters 0-9, A-Z,
  4687. dash (<code>-</code>), full stop (<code>.</code>), space, asterisk
  4688. (<code>*</code>), dollar (<code>$</code>), slash (<code>/</code>), plus
  4689. (<code>+</code>) and percent (<code>%</code>). The standard does not
  4690. require a check digit but a modulo-43 check digit can be added if
  4691. desired by setting <code>--vers=1</code> (API
  4692. <code>option_2 = 1</code>). To add a check digit but not show it in the
  4693. Human Readable Text, set <code>--vers=2</code> (API
  4694. <code>option_2 = 2</code>).</p>
  4695. <h4 id="extended-code-39">6.1.7.2 Extended Code 39</h4>
  4696. <figure>
  4697. <img src="images/excode39.svg" title="fig:" class="lin"
  4698. alt="zint -b EXCODE39 --compliantheight -d &quot;123.45$@fd&quot;" />
  4699. <figcaption
  4700. aria-hidden="true"><code>zint -b EXCODE39 --compliantheight -d "123.45$@fd"</code></figcaption>
  4701. </figure>
  4702. <p>Also known as Code 39e and Code39+, this symbology expands on
  4703. Standard Code 39 to provide support for the full 7-bit ASCII character
  4704. set. The check digit options are the same as for <a
  4705. href="#standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO
  4706. 16388)</a>.</p>
  4707. <h4 id="code-93">6.1.7.3 Code 93</h4>
  4708. <figure>
  4709. <img src="images/code93.svg" title="fig:" class="lin"
  4710. alt="zint -b CODE93 --compliantheight -d &quot;C93&quot;" />
  4711. <figcaption
  4712. aria-hidden="true"><code>zint -b CODE93 --compliantheight -d "C93"</code></figcaption>
  4713. </figure>
  4714. <p>A variation of Extended Code 39, Code 93 also supports full ASCII
  4715. text, accepting up to 123 characters. Two check characters are added by
  4716. Zint. By default these check characters are not shown in the Human
  4717. Readable Text, but may be shown by setting <code>--vers=1</code> (API
  4718. <code>option_2 = 1</code>).</p>
  4719. <h4 id="pzn-pharmazentralnummer">6.1.7.4 PZN (Pharmazentralnummer)</h4>
  4720. <figure>
  4721. <img src="images/pzn.svg" title="fig:" class="lin"
  4722. alt="zint -b PZN --compliantheight -d &quot;2758089&quot;" />
  4723. <figcaption
  4724. aria-hidden="true"><code>zint -b PZN --compliantheight -d "2758089"</code></figcaption>
  4725. </figure>
  4726. <p>PZN is a Code 39 based symbology used by the pharmaceutical industry
  4727. in Germany. PZN encodes a 7-digit number to which Zint will add a
  4728. modulo-11 check digit (PZN8). Input less than 7 digits will be
  4729. zero-filled. An 8-digit input can be supplied in which case Zint will
  4730. validate the check digit.</p>
  4731. <p>To encode a PZN7 (obsolete since 2013) instead set
  4732. <code>--vers=1</code> (API <code>option_2 = 1</code>) and supply up to 7
  4733. digits. As with PZN8, a modulo-11 check digit will be added or if 7
  4734. digits supplied the check digit validated.</p>
  4735. <h4 id="logmars">6.1.7.5 LOGMARS</h4>
  4736. <figure>
  4737. <img src="images/logmars.svg" title="fig:" class="lin"
  4738. alt="zint -b LOGMARS --compliantheight -d &quot;12345/ABCDE&quot; --vers=1" />
  4739. <figcaption
  4740. aria-hidden="true"><code>zint -b LOGMARS --compliantheight -d "12345/ABCDE" --vers=1</code></figcaption>
  4741. </figure>
  4742. <p>LOGMARS (Logistics Applications of Automated Marking and Reading
  4743. Symbols) is a variation of the Code 39 symbology used by the U.S.
  4744. Department of Defense. LOGMARS encodes the same character set as <a
  4745. href="#standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO
  4746. 16388)</a>, and the check digit options are also the same. Input is
  4747. restricted to a maximum of 30 characters.</p>
  4748. <h4 id="code-32">6.1.7.6 Code 32</h4>
  4749. <figure>
  4750. <img src="images/code32.svg" title="fig:" class="lin"
  4751. alt="zint -b CODE32 --compliantheight -d &quot;14352312&quot;" />
  4752. <figcaption
  4753. aria-hidden="true"><code>zint -b CODE32 --compliantheight -d "14352312"</code></figcaption>
  4754. </figure>
  4755. <p>A variation of Code 39 used by the Italian Ministry of Health
  4756. (“Ministero della Sanità”) for encoding identifiers on pharmaceutical
  4757. products. This symbology requires a numeric input up to 8 digits in
  4758. length. A check digit is added by Zint.</p>
  4759. <h4 id="hibc-code-39">6.1.7.7 HIBC Code 39</h4>
  4760. <figure>
  4761. <img src="images/hibc_39.svg" title="fig:" class="lin"
  4762. alt="zint -b HIBC_39 --compliantheight -d &quot;14352312&quot;" />
  4763. <figcaption
  4764. aria-hidden="true"><code>zint -b HIBC_39 --compliantheight -d "14352312"</code></figcaption>
  4765. </figure>
  4766. <p>This variant adds a leading <code>'+'</code> character and a trailing
  4767. modulo-49 check digit to a standard Code 39 symbol as required by the
  4768. Health Industry Barcode standards.</p>
  4769. <h4 id="vehicle-identification-number-vin">6.1.7.8 Vehicle
  4770. Identification Number (VIN)</h4>
  4771. <figure>
  4772. <img src="images/vin.svg" title="fig:" class="lin"
  4773. alt="zint -b VIN -d &quot;2FTPX28L0XCA15511&quot; --vers=1" />
  4774. <figcaption
  4775. aria-hidden="true"><code>zint -b VIN -d "2FTPX28L0XCA15511" --vers=1</code></figcaption>
  4776. </figure>
  4777. <p>A variation of Code 39 that for vehicle identification numbers used
  4778. in North America (first character <code>'1'</code> to <code>'5'</code>)
  4779. has a check character verification stage. A 17 character input (0-9, and
  4780. A-Z excluding <code>'I'</code>, <code>'O'</code> and <code>'Q'</code>)
  4781. is required. An invisible Import character prefix <code>'I'</code> can
  4782. be added by setting <code>--vers=1</code> (API
  4783. <code>option_2 = 1</code>).</p>
  4784. <h3 id="codabar-en-798">6.1.8 Codabar (EN 798)</h3>
  4785. <figure>
  4786. <img src="images/codabar.svg" title="fig:" class="lin"
  4787. alt="zint -b CODABAR --compliantheight -d &quot;A37859B&quot;" />
  4788. <figcaption
  4789. aria-hidden="true"><code>zint -b CODABAR --compliantheight -d "A37859B"</code></figcaption>
  4790. </figure>
  4791. <p>Also known as NW-7, Monarch, ABC Codabar, USD-4, Ames Code and Code
  4792. 27, this symbology was developed in 1972 by Monarch Marketing Systems
  4793. for retail purposes. The American Blood Commission adopted Codabar in
  4794. 1977 as the standard symbology for blood identification. Codabar can
  4795. encode up to 103 characters starting and ending with the letters A-D and
  4796. containing between these letters the numbers 0-9, dash (<code>-</code>),
  4797. dollar (<code>$</code>), colon (<code>:</code>), slash (<code>/</code>),
  4798. full stop (<code>.</code>) or plus (<code>+</code>). No check character
  4799. is generated by default, but a modulo-16 one can be added by setting
  4800. <code>--vers=1</code> (API <code>option_2 = 1</code>). To have the check
  4801. character appear in the Human Readable Text, set <code>--vers=2</code>
  4802. (API <code>option_2 = 2</code>).</p>
  4803. <h3 id="pharmacode">6.1.9 Pharmacode</h3>
  4804. <figure>
  4805. <img src="images/pharma.svg" title="fig:" class="lin"
  4806. alt="zint -b PHARMA --compliantheight -d &quot;130170&quot;" />
  4807. <figcaption
  4808. aria-hidden="true"><code>zint -b PHARMA --compliantheight -d "130170"</code></figcaption>
  4809. </figure>
  4810. <p>Developed by Laetus, Pharmacode is used for the identification of
  4811. pharmaceuticals. The symbology is able to encode whole numbers between 3
  4812. and 131070.</p>
  4813. <h3 id="code-128">6.1.10 Code 128</h3>
  4814. <h4 id="standard-code-128-iso-15417">6.1.10.1 Standard Code 128 (ISO
  4815. 15417)</h4>
  4816. <figure>
  4817. <img src="images/code128.svg" title="fig:" class="lin"
  4818. alt="zint -b CODE128 --bind -d &quot;130170X178&quot;" />
  4819. <figcaption
  4820. aria-hidden="true"><code>zint -b CODE128 --bind -d "130170X178"</code></figcaption>
  4821. </figure>
  4822. <p>One of the most ubiquitous one-dimensional barcode symbologies, Code
  4823. 128 was developed in 1981 by Computer Identics. This symbology supports
  4824. full ASCII text and uses a three-Code Set system to compress the data
  4825. into a smaller symbol. Zint automatically switches between Code Sets A,
  4826. B and C (but see below) and adds a hidden modulo-103 check digit.</p>
  4827. <p>Code 128 is the default barcode symbology used by Zint. In addition
  4828. Zint supports the encoding of ISO/IEC 8859-1 (non-English) characters in
  4829. Code 128 symbols. The ISO/IEC 8859-1 character set is shown in Annex <a
  4830. href="#a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2 Latin Alphabet No. 1
  4831. (ISO/IEC 8859-1)</a>.</p>
  4832. <p>Manual switching of Code Sets is possible using the
  4833. <code>--extraesc</code> option (API
  4834. <code>input_mode |= EXTRA_ESCAPE_MODE</code>), which apart from
  4835. processing normal escape sequences also processes the Code 128-specific
  4836. escapes <code>\^A</code>, <code>\^B</code>, <code>\^C</code> and
  4837. <code>\^@</code> (the latter turns off manual Code Set selection). For
  4838. instance the following will force switching to Code Set B for the data
  4839. <code>"5678"</code> (normally Code Set C would be used throughout):</p>
  4840. <div class="sourceCode" id="cb99"><pre
  4841. class="sourceCode bash"><code class="sourceCode bash"><span id="cb99-1"><a href="#cb99-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> CODE128 <span class="at">-d</span> <span class="st">&quot;1234\^B5678&quot;</span> <span class="at">--extraesc</span></span></code></pre></div>
  4842. <p>The manually selected Code Set will apply until the next Code Set
  4843. escape sequence or until a <code>\^@</code>, with the exception that
  4844. data that cannot be represented in that Code Set will be switched as
  4845. appropriate. If the data contains an extra escape sequence, it can be
  4846. escaped by doubling the caret (<code>^</code>). For instance</p>
  4847. <div class="sourceCode" id="cb100"><pre
  4848. class="sourceCode bash"><code class="sourceCode bash"><span id="cb100-1"><a href="#cb100-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> CODE128 <span class="at">-d</span> <span class="st">&quot;\^AABC\^^BDEF&quot;</span> <span class="at">--extraesc</span></span></code></pre></div>
  4849. <p>will encode the data <code>"ABC\^BDEF"</code> in Code Set A.</p>
  4850. <p>There is also the extra escape <code>\^1</code>, which will encode a
  4851. special Function Code 1 character (FNC1) anywhere you chose in the data,
  4852. for instance</p>
  4853. <div class="sourceCode" id="cb101"><pre
  4854. class="sourceCode bash"><code class="sourceCode bash"><span id="cb101-1"><a href="#cb101-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> CODE128 <span class="at">-d</span> <span class="st">&quot;A\^1BC\^1DEF&quot;</span> <span class="at">--extraesc</span></span></code></pre></div>
  4855. <p>Zint can encode a maximum of 102 symbol characters, which allows for
  4856. e.g. 202 all-numeric or 101 all-uppercase characters. Sizes above 120
  4857. digits (60 alphanumerics) are not recommended.</p>
  4858. <h4 id="code-128-suppress-code-set-c-code-sets-a-and-b-only">6.1.10.2
  4859. Code 128 Suppress Code Set C (Code Sets A and B only)</h4>
  4860. <figure>
  4861. <img src="images/code128ab.svg" title="fig:" class="lin"
  4862. alt="zint -b CODE128AB -d &quot;130170X178&quot;" />
  4863. <figcaption
  4864. aria-hidden="true"><code>zint -b CODE128AB -d "130170X178"</code></figcaption>
  4865. </figure>
  4866. <p>It is sometimes advantageous to stop Code 128 from using Code Set C
  4867. which compresses numerical data. The <code>BARCODE_CODE128AB</code><a
  4868. href="#fn14" class="footnote-ref" id="fnref14"
  4869. role="doc-noteref"><sup>14</sup></a> variant (symbology 60) suppresses
  4870. Code Set C in favour of Code Sets A and B.</p>
  4871. <p>Note that the special extra escapes mentioned above are not available
  4872. for this variant (nor for any other).</p>
  4873. <h4 id="gs1-128">6.1.10.3 GS1-128</h4>
  4874. <figure>
  4875. <img src="images/gs1_128.svg" title="fig:" class="lin"
  4876. alt="zint -b GS1_128 --compliantheight -d &quot;[01]98898765432106[3202]012345[15]991231&quot;" />
  4877. <figcaption
  4878. aria-hidden="true"><code>zint -b GS1_128 --compliantheight -d "[01]98898765432106[3202]012345[15]991231"</code></figcaption>
  4879. </figure>
  4880. <p>A variation of Code 128 previously known as UCC/EAN-128, this
  4881. symbology is defined by the GS1 General Specifications. Application
  4882. Identifiers (AIs) should be entered using [square bracket] notation.
  4883. These will be converted to parentheses (round brackets) for the Human
  4884. Readable Text. This will allow round brackets to be used in the data
  4885. strings to be encoded.</p>
  4886. <p>For compatibility with data entry in other systems, if the data does
  4887. not include round brackets, the option <code>--gs1parens</code> (API
  4888. <code>input_mode |= GS1PARENS_MODE</code>) may be used to signal that
  4889. AIs are encased in round brackets instead of square ones.</p>
  4890. <p>Fixed length data should be entered at the appropriate length for
  4891. correct encoding. GS1-128 does not support extended ASCII (ISO/IEC
  4892. 8859-1) characters. Check digits for GTIN data AI (01) are not generated
  4893. and need to be included in the input data. The following is an example
  4894. of a valid GS1-128 input:</p>
  4895. <div class="sourceCode" id="cb102"><pre
  4896. class="sourceCode bash"><code class="sourceCode bash"><span id="cb102-1"><a href="#cb102-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 16 <span class="at">-d</span> <span class="st">&quot;[01]98898765432106[3202]012345[15]991231&quot;</span></span></code></pre></div>
  4897. <p>or using the <code>--gs1parens</code> option:</p>
  4898. <div class="sourceCode" id="cb103"><pre
  4899. class="sourceCode bash"><code class="sourceCode bash"><span id="cb103-1"><a href="#cb103-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 16 <span class="at">--gs1parens</span> <span class="at">-d</span> <span class="st">&quot;(01)98898765432106(3202)012345(15)991231&quot;</span></span></code></pre></div>
  4900. <h4 id="ean-14">6.1.10.4 EAN-14</h4>
  4901. <figure>
  4902. <img src="images/ean14.svg" title="fig:" class="lin"
  4903. alt="zint -b EAN14 --compliantheight -d &quot;9889876543210&quot;" />
  4904. <figcaption
  4905. aria-hidden="true"><code>zint -b EAN14 --compliantheight -d "9889876543210"</code></figcaption>
  4906. </figure>
  4907. <p>A shorter version of GS1-128 which encodes GTIN data only. A 13-digit
  4908. number is required. The GTIN check digit and HRT-only AI “(01)” are
  4909. added by Zint.</p>
  4910. <h4 id="nve-18-sscc-18">6.1.10.5 NVE-18 (SSCC-18)</h4>
  4911. <figure>
  4912. <img src="images/nve18.svg" title="fig:" class="lin"
  4913. alt="zint -b NVE18 --compliantheight -d &quot;37612345000001003&quot;" />
  4914. <figcaption
  4915. aria-hidden="true"><code>zint -b NVE18 --compliantheight -d "37612345000001003"</code></figcaption>
  4916. </figure>
  4917. <p>A variation of Code 128 the ‘Nummer der Versandeinheit’ standard,
  4918. also known as SSCC-18 (Serial Shipping Container Code), includes both a
  4919. visible modulo-10 and a hidden modulo-103 check digit. NVE-18 requires a
  4920. 17-digit numerical input. Check digits and HRT-only AI “(00)” are added
  4921. by Zint.</p>
  4922. <h4 id="hibc-code-128">6.1.10.6 HIBC Code 128</h4>
  4923. <figure>
  4924. <img src="images/hibc_128.svg" title="fig:" class="lin"
  4925. alt="zint -b HIBC_128 -d &quot;A123BJC5D6E71&quot;" />
  4926. <figcaption
  4927. aria-hidden="true"><code>zint -b HIBC_128 -d "A123BJC5D6E71"</code></figcaption>
  4928. </figure>
  4929. <p>This option adds a leading <code>'+'</code> character and a trailing
  4930. modulo-49 check digit to a standard Code 128 symbol as required by the
  4931. Health Industry Barcode standards.</p>
  4932. <h4 id="dpd-code">6.1.10.7 DPD Code</h4>
  4933. <figure>
  4934. <img src="images/dpd.svg" title="fig:" class="lin"
  4935. alt="zint -b DPD --compliantheight -d &quot;000393206219912345678101040&quot;" />
  4936. <figcaption
  4937. aria-hidden="true"><code>zint -b DPD --compliantheight -d "000393206219912345678101040"</code></figcaption>
  4938. </figure>
  4939. <p>Another variation of Code 128 as used by DPD (Deutscher Paketdienst).
  4940. Requires a 27 or 28 character input. For 28 character input, the first
  4941. character is an identification tag (Barcode ID), which should usually be
  4942. <code>"%"</code> (ASCII 37). If 27 characters are supplied,
  4943. <code>"%"</code> will be prefixed by Zint (except if marked as a
  4944. “relabel”, see below). The rest of the 27-character input must be
  4945. alphanumeric, and is of the form:</p>
  4946. <div id="tbl:dpd_input_fields" class="tablenos">
  4947. <table id="tbl:dpd_input_fields" data-tag=": DPD Input Fields">
  4948. <caption><span>Table : DPD Input Fields</span> </caption>
  4949. <colgroup>
  4950. <col style="width: 26%" />
  4951. <col style="width: 27%" />
  4952. <col style="width: 16%" />
  4953. <col style="width: 29%" />
  4954. </colgroup>
  4955. <thead>
  4956. <tr>
  4957. <th style="text-align: left;">Destination Post Code</th>
  4958. <th style="text-align: left;">Tracking Number</th>
  4959. <th style="text-align: left;">Service Code</th>
  4960. <th style="text-align: left;">Destination Country Code</th>
  4961. </tr>
  4962. </thead>
  4963. <tbody>
  4964. <tr>
  4965. <td style="text-align: left;">PPPPPPP (7 alphanumerics)</td>
  4966. <td style="text-align: left;">TTTTTTTTTTTTTT (14 alphanumerics)</td>
  4967. <td style="text-align: left;">SSS (3 digits)</td>
  4968. <td style="text-align: left;">CCC (3-digit ISO 3166-1)</td>
  4969. </tr>
  4970. </tbody>
  4971. </table>
  4972. </div>
  4973. <p>A warning will be generated if the Service Code, the Destination
  4974. Country Code, or the last 10 characters of the Tracking Number are
  4975. non-numeric.</p>
  4976. <p>Zint formats the Human Readable Text as specified by DPD, leaving out
  4977. the identication tag, and adds a modulo-36 check character to the text
  4978. (not to the barcode itself), thus:</p>
  4979. <p><code>PPPP PPP TTTT TTTT TTTT TT SSS CCC D</code></p>
  4980. <p>By default a top boundary bar is added, with default width 3X. The
  4981. width can be overridden using <code>--border</code> (API
  4982. <code>border_width</code>). For a symbol with no top boundary bar,
  4983. explicitly set the border type to bindtop (or bind or box) and leave the
  4984. border width 0.</p>
  4985. <p>A DPD Code can be marked as a “relabel” by specifying
  4986. <code>--vers=1</code> (API <code>option_2 = 1</code>), which omits the
  4987. identification tag and prints the barcode at half height. In this case,
  4988. an input of 27 alphanumeric characters is required.</p>
  4989. <h4 id="upu-s10">6.1.10.8 UPU S10</h4>
  4990. <figure>
  4991. <img src="images/upu_s10.svg" title="fig:" class="lin"
  4992. alt="zint -b UPU_S10 --compliantheight -d &quot;EE876543216CA&quot;" />
  4993. <figcaption
  4994. aria-hidden="true"><code>zint -b UPU_S10 --compliantheight -d "EE876543216CA"</code></figcaption>
  4995. </figure>
  4996. <p>The Universal Postal Union S10 variant of Code 128 encodes 13
  4997. characters in the format <code>"SSNNNNNNNNXCC"</code>, where
  4998. <code>"SS"</code> is a two-character alphabetic service indicator,
  4999. <code>"NNNNNNNN"</code> is an 8-digit serial number, <code>"X"</code> is
  5000. a modulo-11 check digit, and <code>"CC"</code> is a two-character ISO
  5001. 3166-1 country code.</p>
  5002. <p>The check digit may be omitted in which case Zint will add it.
  5003. Warnings will be generated if the service indicator is non-standard or
  5004. the country code is not ISO 3361-1.</p>
  5005. <h3 id="gs1-databar-iso-24724">6.1.11 GS1 DataBar (ISO 24724)</h3>
  5006. <p>Previously known as RSS (Reduced Spaced Symbology), these symbols are
  5007. due to replace GS1-128 symbols in accordance with the GS1 General
  5008. Specifications. If a GS1 DataBar symbol is to be printed with a 2D
  5009. component as specified in ISO/IEC 24723 set <code>--mode=2</code> (API
  5010. <code>option_1 = 2</code>). See <a
  5011. href="#gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO
  5012. 24723)</a> to find out how to generate DataBar symbols with 2D
  5013. components.</p>
  5014. <h4 id="gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1
  5015. GS1 DataBar Omnidirectional and GS1 DataBar Truncated</h4>
  5016. <figure>
  5017. <img src="images/dbar_omn.svg" title="fig:" class="lin"
  5018. alt="zint -b DBAR_OMN --compliantheight -d &quot;0950110153001&quot;" />
  5019. <figcaption
  5020. aria-hidden="true"><code>zint -b DBAR_OMN --compliantheight -d "0950110153001"</code></figcaption>
  5021. </figure>
  5022. <p>Previously known as RSS-14 this standard encodes a 13-digit item
  5023. code. A check digit and HRT-only Application Identifier of “(01)” are
  5024. added by Zint. (A 14-digit code that appends the check digit may be
  5025. given, in which case the check digit will be verified.)</p>
  5026. <p>GS1 DataBar Omnidirectional symbols should have a height of 33 or
  5027. greater. To produce a GS1 DataBar Truncated symbol set the symbol height
  5028. to a value between 13 and 32. Truncated symbols may not be scannable by
  5029. omnidirectional scanners.</p>
  5030. <figure>
  5031. <img src="images/dbar_truncated.svg" title="fig:" class="lin"
  5032. alt="zint -b DBAR_OMN -d &quot;0950110153001&quot; --height=13" />
  5033. <figcaption
  5034. aria-hidden="true"><code>zint -b DBAR_OMN -d "0950110153001" --height=13</code></figcaption>
  5035. </figure>
  5036. <h4 id="gs1-databar-limited">6.1.11.2 GS1 DataBar Limited</h4>
  5037. <figure>
  5038. <img src="images/dbar_ltd.svg" title="fig:" class="lin"
  5039. alt="zint -b DBAR_LTD --compliantheight -d &quot;0950110153001&quot;" />
  5040. <figcaption
  5041. aria-hidden="true"><code>zint -b DBAR_LTD --compliantheight -d "0950110153001"</code></figcaption>
  5042. </figure>
  5043. <p>Previously known as RSS Limited this standard encodes a 13-digit item
  5044. code and can be used in the same way as GS1 DataBar Omnidirectional
  5045. above. GS1 DataBar Limited, however, is limited to data starting with
  5046. digits 0 and 1 (i.e. numbers in the range 0 to 1999999999999). As with
  5047. GS1 DataBar Omnidirectional a check digit and HRT-only Application
  5048. Identifier of “(01)” are added by Zint, and a 14-digit code may be given
  5049. in which case the check digit will be verified.</p>
  5050. <h4 id="gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</h4>
  5051. <figure>
  5052. <img src="images/dbar_exp.svg" title="fig:" class="lin"
  5053. alt="zint -b DBAR_EXP --compliantheight -d &quot;[01]98898765432106[3202]012345[15]991231&quot;" />
  5054. <figcaption
  5055. aria-hidden="true"><code>zint -b DBAR_EXP --compliantheight -d "[01]98898765432106[3202]012345[15]991231"</code></figcaption>
  5056. </figure>
  5057. <p>Previously known as RSS Expanded this is a variable length symbology
  5058. capable of encoding data from a number of AIs in a single symbol. AIs
  5059. should be encased in [square brackets] in the input data, which will be
  5060. converted to parentheses (round brackets) before being included in the
  5061. Human Readable Text attached to the symbol. This method allows the
  5062. inclusion of parentheses in the data to be encoded. If the data does not
  5063. include parentheses, the AIs may alternatively be encased in parentheses
  5064. using the <code>--gs1parens</code> switch. See <a
  5065. href="#gs1-128">6.1.10.3 GS1-128</a>.</p>
  5066. <p>GTIN data AI (01) should also include the check digit data as this is
  5067. not calculated by Zint when this symbology is encoded. Fixed length data
  5068. should be entered at the appropriate length for correct encoding. The
  5069. following is an example of a valid GS1 DataBar Expanded input:</p>
  5070. <div class="sourceCode" id="cb104"><pre
  5071. class="sourceCode bash"><code class="sourceCode bash"><span id="cb104-1"><a href="#cb104-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 31 <span class="at">-d</span> <span class="st">&quot;[01]98898765432106[3202]012345[15]991231&quot;</span></span></code></pre></div>
  5072. <h3 id="korea-post-barcode">6.1.12 Korea Post Barcode</h3>
  5073. <figure>
  5074. <img src="images/koreapost.svg" title="fig:" class="lin"
  5075. alt="zint -b KOREAPOST -d &quot;923457&quot;" />
  5076. <figcaption
  5077. aria-hidden="true"><code>zint -b KOREAPOST -d "923457"</code></figcaption>
  5078. </figure>
  5079. <p>The Korean Postal Barcode is used to encode a 6-digit number and
  5080. includes one check digit.</p>
  5081. <h3 id="channel-code">6.1.13 Channel Code</h3>
  5082. <figure>
  5083. <img src="images/channel.svg" title="fig:" class="lin"
  5084. alt="zint -b CHANNEL -d &quot;453678&quot; --compliantheight" />
  5085. <figcaption
  5086. aria-hidden="true"><code>zint -b CHANNEL -d "453678" --compliantheight</code></figcaption>
  5087. </figure>
  5088. <p>A highly compressed symbol for numeric data. The number of channels
  5089. in the symbol can be between 3 and 8 and this can be specified by
  5090. setting the value of the <code>--vers</code> option (API
  5091. <code>option_2</code>). It can also be determined by the length of the
  5092. input data: e.g. a three character input string generates a 4 channel
  5093. code by default.</p>
  5094. <p>The maximum values permitted depend on the number of channels used as
  5095. shown in the table below:</p>
  5096. <div id="tbl:channel_maxima" class="tablenos">
  5097. <table id="tbl:channel_maxima" data-tag=": Channel Value Ranges">
  5098. <caption><span>Table : Channel Value Ranges</span> </caption>
  5099. <thead>
  5100. <tr>
  5101. <th style="text-align: left;">Channels</th>
  5102. <th style="text-align: left;">Minimum Value</th>
  5103. <th style="text-align: left;">Maximum Value</th>
  5104. </tr>
  5105. </thead>
  5106. <tbody>
  5107. <tr>
  5108. <td style="text-align: left;">3</td>
  5109. <td style="text-align: left;">00</td>
  5110. <td style="text-align: left;">26</td>
  5111. </tr>
  5112. <tr>
  5113. <td style="text-align: left;">4</td>
  5114. <td style="text-align: left;">000</td>
  5115. <td style="text-align: left;">292</td>
  5116. </tr>
  5117. <tr>
  5118. <td style="text-align: left;">5</td>
  5119. <td style="text-align: left;">0000</td>
  5120. <td style="text-align: left;">3493</td>
  5121. </tr>
  5122. <tr>
  5123. <td style="text-align: left;">6</td>
  5124. <td style="text-align: left;">00000</td>
  5125. <td style="text-align: left;">44072</td>
  5126. </tr>
  5127. <tr>
  5128. <td style="text-align: left;">7</td>
  5129. <td style="text-align: left;">000000</td>
  5130. <td style="text-align: left;">576688</td>
  5131. </tr>
  5132. <tr>
  5133. <td style="text-align: left;">8</td>
  5134. <td style="text-align: left;">0000000</td>
  5135. <td style="text-align: left;">7742862</td>
  5136. </tr>
  5137. </tbody>
  5138. </table>
  5139. </div>
  5140. <h3 id="bc412-semi-t1-95">6.1.14 BC412 (SEMI T1-95)</h3>
  5141. <figure>
  5142. <img src="images/bc412.svg" title="fig:" class="lin"
  5143. alt="zint -b BC412 -d &quot;AQ45670&quot; --compliantheight" />
  5144. <figcaption
  5145. aria-hidden="true"><code>zint -b BC412 -d "AQ45670" --compliantheight</code></figcaption>
  5146. </figure>
  5147. <p>Designed by IBM for marking silicon wafers, each BC412 character is
  5148. represented by 4 bars of a single size, interleaved with 4 spaces of
  5149. varying sizes that total 8 (hence 4 bars in 12). Zint implements the
  5150. SEMI T1-95 standard, where input must be alphanumeric, excluding the
  5151. letter <code>O</code>, and must be from 7 to 18 characters in length. A
  5152. single check character is added by Zint, appearing in the 2nd character
  5153. position. Lowercase input is automatically made uppercase.</p>
  5154. <h2 id="stacked-symbologies">6.2 Stacked Symbologies</h2>
  5155. <h3 id="basic-symbol-stacking">6.2.1 Basic Symbol Stacking</h3>
  5156. <p>An early innovation to get more information into a symbol, used
  5157. primarily in the vehicle industry, is to simply stack one-dimensional
  5158. codes on top of each other. This can be achieved at the command prompt
  5159. by giving more than one set of input data. For example</p>
  5160. <div class="sourceCode" id="cb105"><pre
  5161. class="sourceCode bash"><code class="sourceCode bash"><span id="cb105-1"><a href="#cb105-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&quot;This&quot;</span> <span class="at">-d</span> <span class="st">&quot;That&quot;</span></span></code></pre></div>
  5162. <p>will draw two Code 128 symbols, one on top of the other. The same
  5163. result can be achieved using the API by executing the
  5164. <code>ZBarcode_Encode()</code> function more than once on a symbol. For
  5165. example:</p>
  5166. <div class="sourceCode" id="cb106"><pre
  5167. class="sourceCode c"><code class="sourceCode c"><span id="cb106-1"><a href="#cb106-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_CODE128<span class="op">;</span></span>
  5168. <span id="cb106-2"><a href="#cb106-2" aria-hidden="true" tabindex="-1"></a></span>
  5169. <span id="cb106-3"><a href="#cb106-3" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;This&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
  5170. <span id="cb106-4"><a href="#cb106-4" aria-hidden="true" tabindex="-1"></a></span>
  5171. <span id="cb106-5"><a href="#cb106-5" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;That&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
  5172. <span id="cb106-6"><a href="#cb106-6" aria-hidden="true" tabindex="-1"></a></span>
  5173. <span id="cb106-7"><a href="#cb106-7" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Print<span class="op">(</span>my_symbol<span class="op">);</span></span></code></pre></div>
  5174. <figure>
  5175. <img src="images/code128_stacked.svg" title="fig:" class="lin"
  5176. alt="zint -d &quot;This&quot; -d &quot;That&quot;" />
  5177. <figcaption
  5178. aria-hidden="true"><code>zint -d "This" -d "That"</code></figcaption>
  5179. </figure>
  5180. <p>Note that the Human Readable Text will be that of the last data, so
  5181. it’s best to use the option <code>--notext</code> (API
  5182. <code>show_hrt = 0</code>).</p>
  5183. <p>The stacked barcode rows can be separated by row separator bars by
  5184. specifying <code>--bind</code> (API
  5185. <code>output_options |= BARCODE_BIND</code>). The height of the row
  5186. separator bars in integral multiples of the X-dimension (minimum and
  5187. default 1, maximum 4) can be set by <code>--separator</code> (API
  5188. <code>option_3</code>):</p>
  5189. <div class="sourceCode" id="cb107"><pre
  5190. class="sourceCode bash"><code class="sourceCode bash"><span id="cb107-1"><a href="#cb107-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--bind</span> <span class="at">--notext</span> <span class="at">--separator</span><span class="op">=</span>2 <span class="at">-d</span> <span class="st">&quot;This&quot;</span> <span class="at">-d</span> <span class="st">&quot;That&quot;</span></span></code></pre></div>
  5191. <figure>
  5192. <img src="images/code128_stacked_sep2.svg" title="fig:" class="lin"
  5193. alt="zint --notext --bind --separator=2 -d &quot;This&quot; -d &quot;That&quot;" />
  5194. <figcaption
  5195. aria-hidden="true"><code>zint --notext --bind --separator=2 -d "This" -d "That"</code></figcaption>
  5196. </figure>
  5197. <p>A more sophisticated method is to use some type of line indexing
  5198. which indicates to the barcode reader which order the stacked symbols
  5199. should be read in. This is demonstrated by the symbologies below.</p>
  5200. <h3 id="codablock-f">6.2.2 Codablock-F</h3>
  5201. <figure>
  5202. <img src="images/codablockf.svg" title="fig:" class="lin"
  5203. alt="zint -b CODABLOCKF -d &quot;CODABLOCK F Symbology&quot; --rows=3" />
  5204. <figcaption
  5205. aria-hidden="true"><code>zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3</code></figcaption>
  5206. </figure>
  5207. <p>This is a stacked symbology based on Code 128 which can encode
  5208. Latin-1 data up to a maximum length of 2726 symbol characters, meaning
  5209. for instance up to 2726 all ASCII characters, or 5452 all numeric, or up
  5210. to 1363 all extended ASCII (ISO/IEC 8859-1).</p>
  5211. <p>The width of the Codablock-F symbol can be set using the
  5212. <code>--cols</code> option (API <code>option_2</code>), to a value
  5213. between 9 and 67. The height (number of rows) can be set using the
  5214. <code>--rows</code> option (API <code>option_1</code>), with a maximum
  5215. of 44. Zint does not currently support encoding of GS1 data in
  5216. Codablock-F symbols.</p>
  5217. <p>A separate symbology ID (<code>BARCODE_HIBC_BLOCKF</code>) can be
  5218. used to encode Health Industry Barcode (HIBC) data which adds a leading
  5219. <code>'+'</code> character and a modulo-49 check digit to the encoded
  5220. data.</p>
  5221. <h3 id="code-16k-en-12323">6.2.3 Code 16K (EN 12323)</h3>
  5222. <figure>
  5223. <img src="images/code16k.svg" title="fig:" class="lin"
  5224. alt="zint -b CODE16K --compliantheight -d &quot;ab0123456789&quot;" />
  5225. <figcaption
  5226. aria-hidden="true"><code>zint -b CODE16K --compliantheight -d "ab0123456789"</code></figcaption>
  5227. </figure>
  5228. <p>Code 16K uses a Code 128 based system which can stack up to 16 rows
  5229. in a block. This gives a maximum data capacity of 77 characters or 154
  5230. numerical digits and includes two modulo-107 check digits. Code 16K also
  5231. supports ISO/IEC 8859-1 character encoding in the same manner as Code
  5232. 128. GS1 data encoding is also supported. The minimum number of rows to
  5233. use can be set using the <code>--rows</code> option (API
  5234. <code>option_1</code>), with values from 2 to 16.</p>
  5235. <h3 id="pdf417-iso-15438">6.2.4 PDF417 (ISO 15438)</h3>
  5236. <figure>
  5237. <img src="images/pdf417.svg" title="fig:" class="lin"
  5238. alt="zint -b PDF417 -d &quot;PDF417&quot;" />
  5239. <figcaption
  5240. aria-hidden="true"><code>zint -b PDF417 -d "PDF417"</code></figcaption>
  5241. </figure>
  5242. <p>Heavily used in the parcel industry, the PDF417 symbology can encode
  5243. a vast amount of data into a small space. Zint supports encoding up to
  5244. the ISO standard maximum symbol size of 925 codewords which (at error
  5245. correction level 0) allows a maximum data size of 1850 text characters,
  5246. or 2710 digits.</p>
  5247. <p>The width of the generated PDF417 symbol can be specified at the
  5248. command line using the <code>--cols</code> switch (API
  5249. <code>option_2</code>) followed by a number between 1 and 30, the number
  5250. of rows using the <code>--rows</code> switch (API <code>option_3</code>)
  5251. followed by a number between 3 and 90, and the amount of error
  5252. correction information can be specified by using the
  5253. <code>--secure</code> switch (API <code>option_1</code>) followed by a
  5254. number between 0 and 8 where the number of codewords used for error
  5255. correction is determined by <code>2^(value + 1)</code>. The default
  5256. level of error correction is determined by the amount of data being
  5257. encoded.</p>
  5258. <p>This symbology uses Latin-1 character encoding by default but also
  5259. supports the ECI encoding mechanism. A separate symbology ID
  5260. (<code>BARCODE_HIBC_PDF</code>) can be used to encode Health Industry
  5261. Barcode (HIBC) data.</p>
  5262. <p>For a faster but less optimal encoding, the <code>--fast</code>
  5263. option (API <code>input_mode |= FAST_MODE</code>) may be used.</p>
  5264. <p>PDF417 supports Structured Append of up to 99,999 symbols and an
  5265. optional numeric ID of up to 30 digits, which can be set by using the
  5266. <code>--structapp</code> option (see <a href="#structured-append">4.17
  5267. Structured Append</a>) (API <code>structapp</code>). The ID consists of
  5268. up to 10 triplets, each ranging from <code>"000"</code> to
  5269. <code>"899"</code>. For instance <code>"123456789"</code> would be a
  5270. valid ID of 3 triplets. However <code>"123456900"</code> would not, as
  5271. the last triplet <code>"900"</code> exceeds <code>"899"</code>. The
  5272. triplets are 0-filled, for instance <code>"1234"</code> becomes
  5273. <code>"123004"</code>. If an ID is not given, no ID is encoded.</p>
  5274. <h3 id="compact-pdf417-iso-15438">6.2.5 Compact PDF417 (ISO 15438)</h3>
  5275. <figure>
  5276. <img src="images/pdf417comp.svg" title="fig:" class="lin"
  5277. alt="zint -b PDF417COMP -d &quot;PDF417&quot;" />
  5278. <figcaption
  5279. aria-hidden="true"><code>zint -b PDF417COMP -d "PDF417"</code></figcaption>
  5280. </figure>
  5281. <p>Previously known as Truncated PDF417, Compact PDF417 omits some
  5282. per-row overhead to produce a narrower but less robust symbol. Options
  5283. are the same as for PDF417 above.</p>
  5284. <h3 id="micropdf417-iso-24728">6.2.6 MicroPDF417 (ISO 24728)</h3>
  5285. <figure>
  5286. <img src="images/micropdf417.svg" title="fig:" class="lin"
  5287. alt="zint -b MICROPDF417 -d &quot;12345678&quot;" />
  5288. <figcaption
  5289. aria-hidden="true"><code>zint -b MICROPDF417 -d "12345678"</code></figcaption>
  5290. </figure>
  5291. <p>A variation of the PDF417 standard, MicroPDF417 is intended for
  5292. applications where symbol size needs to be kept to a minimum. 34
  5293. predefined symbol sizes are available with 1 - 4 columns and 4 - 44
  5294. rows. The maximum amount a MicroPDF417 symbol can hold is 250
  5295. alphanumeric characters or 366 digits. The amount of error correction
  5296. used is dependent on symbol size. The number of columns used can be
  5297. determined using the <code>--cols</code> switch (API
  5298. <code>option_2</code>) as with PDF417.</p>
  5299. <p>This symbology uses Latin-1 character encoding by default but also
  5300. supports the ECI encoding mechanism. A separate symbology ID
  5301. (<code>BARCODE_HIBC_MICPDF</code>) can be used to encode Health Industry
  5302. Barcode (HIBC) data. MicroPDF417 supports <code>FAST_MODE</code> and
  5303. Structured Append the same as PDF417, for which see details.</p>
  5304. <h3 id="gs1-databar-stacked-iso-24724">6.2.7 GS1 DataBar Stacked (ISO
  5305. 24724)</h3>
  5306. <h4 id="gs1-databar-stacked">6.2.7.1 GS1 DataBar Stacked</h4>
  5307. <figure>
  5308. <img src="images/dbar_stk.svg" title="fig:" class="lin"
  5309. alt="zint -b DBAR_STK --compliantheight -d &quot;9889876543210&quot;" />
  5310. <figcaption
  5311. aria-hidden="true"><code>zint -b DBAR_STK --compliantheight -d "9889876543210"</code></figcaption>
  5312. </figure>
  5313. <p>A stacked variation of the GS1 DataBar Truncated symbol requiring the
  5314. same input (see <a
  5315. href="#gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1
  5316. GS1 DataBar Omnidirectional and GS1 DataBar Truncated</a>), this symbol
  5317. is the same as the following GS1 DataBar Stacked Omnidirectional symbol
  5318. except that its height is reduced and its central separator is a single
  5319. row, making it suitable for small items when omnidirectional scanning is
  5320. not required. It can be generated with a two-dimensional component to
  5321. make a composite symbol.</p>
  5322. <h4 id="gs1-databar-stacked-omnidirectional">6.2.7.2 GS1 DataBar Stacked
  5323. Omnidirectional</h4>
  5324. <figure>
  5325. <img src="images/dbar_omnstk.svg" title="fig:" class="lin"
  5326. alt="zint -b DBAR_OMNSTK --compliantheight -d &quot;9889876543210&quot;" />
  5327. <figcaption
  5328. aria-hidden="true"><code>zint -b DBAR_OMNSTK --compliantheight -d "9889876543210"</code></figcaption>
  5329. </figure>
  5330. <p>A stacked variation of the GS1 DataBar Omnidirectional symbol
  5331. requiring the same input (see <a
  5332. href="#gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1
  5333. GS1 DataBar Omnidirectional and GS1 DataBar Truncated</a>). The data is
  5334. encoded in two rows of bars with a central 3-row separator. This symbol
  5335. can be generated with a two-dimensional component to make a composite
  5336. symbol.</p>
  5337. <h4 id="gs1-databar-expanded-stacked">6.2.7.3 GS1 DataBar Expanded
  5338. Stacked</h4>
  5339. <figure>
  5340. <img src="images/dbar_expstk.svg" title="fig:" class="lin"
  5341. alt="zint -b DBAR_EXPSTK --compliantheight -d &quot;[01]98898765432106[3202]012345[15]991231&quot;" />
  5342. <figcaption
  5343. aria-hidden="true"><code>zint -b DBAR_EXPSTK --compliantheight -d "[01]98898765432106[3202]012345[15]991231"</code></figcaption>
  5344. </figure>
  5345. <p>A stacked variation of the GS1 DataBar Expanded symbol for smaller
  5346. packages. Input is the same as for GS1 DataBar Expanded (see <a
  5347. href="#gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</a>). In
  5348. addition the width of the symbol can be altered using the
  5349. <code>--cols</code> switch (API <code>option_2</code>). In this case the
  5350. number of columns (values 1 to 11) relates to the number of character
  5351. pairs on each row of the symbol. Alternatively the <code>--rows</code>
  5352. switch (API <code>option_3</code>) can be used to specify the maximum
  5353. number of rows (values 2 to 11), and the number of columns will be
  5354. adjusted accordingly. This symbol can be generated with a
  5355. two-dimensional component to make a composite symbol. For symbols with a
  5356. 2D component the number of columns must be at least 2.</p>
  5357. <h3 id="code-49">6.2.8 Code 49</h3>
  5358. <figure>
  5359. <img src="images/code49.svg" title="fig:" class="lin"
  5360. alt="zint -b CODE49 --compliantheight -d &quot;MULTIPLE ROWS IN CODE 49&quot;" />
  5361. <figcaption
  5362. aria-hidden="true"><code>zint -b CODE49 --compliantheight -d "MULTIPLE ROWS IN CODE 49"</code></figcaption>
  5363. </figure>
  5364. <p>Developed in 1987 at Intermec, Code 49 is a cross between UPC and
  5365. Code 39. It is one of the earliest stacked symbologies and influenced
  5366. the design of Code 16K a few years later. It supports full 7-bit ASCII
  5367. input up to a maximum of 49 characters or 81 numeric digits. GS1 data
  5368. encoding is also supported. The minimum number of rows to use can be set
  5369. using the <code>--rows</code> option (API <code>option_1</code>), with
  5370. values from 2 to 8.</p>
  5371. <h2 id="gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO
  5372. 24723)</h2>
  5373. <p>GS1 Composite symbols employ a mixture of components to give more
  5374. comprehensive information about a product. The permissible contents of a
  5375. composite symbol is determined by the terms of the GS1 General
  5376. Specifications. Composite symbols consist of a linear component which
  5377. can be an EAN, UPC, GS1-128 or GS1 DataBar symbol, a two-dimensional
  5378. (2D) component which is based on PDF417 or MicroPDF417, and a separator
  5379. pattern. The type of linear component to be used is determined using the
  5380. <code>-b</code> or <code>--barcode</code> switch (API
  5381. <code>symbology</code>) as with other encoding methods. Valid values are
  5382. shown below.</p>
  5383. <div id="tbl:composite_symbologies" class="tablenos">
  5384. <table id="tbl:composite_symbologies"
  5385. data-tag=": GS1 Composite Symbology Values">
  5386. <caption><span>Table : GS1 Composite Symbology Values</span> </caption>
  5387. <colgroup>
  5388. <col style="width: 11%" />
  5389. <col style="width: 34%" />
  5390. <col style="width: 53%" />
  5391. </colgroup>
  5392. <thead>
  5393. <tr>
  5394. <th style="text-align: left;">Numeric Value</th>
  5395. <th style="text-align: left;">Name</th>
  5396. <th style="text-align: left;">Barcode Name</th>
  5397. </tr>
  5398. </thead>
  5399. <tbody>
  5400. <tr>
  5401. <td style="text-align: left;">130</td>
  5402. <td style="text-align: left;"><code>BARCODE_EANX_CC</code></td>
  5403. <td style="text-align: left;">GS1 Composite Symbol with EAN linear
  5404. component</td>
  5405. </tr>
  5406. <tr>
  5407. <td style="text-align: left;">131</td>
  5408. <td style="text-align: left;"><code>BARCODE_GS1_128_CC</code></td>
  5409. <td style="text-align: left;">GS1 Composite Symbol with GS1-128 linear
  5410. component</td>
  5411. </tr>
  5412. <tr>
  5413. <td style="text-align: left;">132</td>
  5414. <td style="text-align: left;"><code>BARCODE_DBAR_OMN_CC</code></td>
  5415. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  5416. Omnidirectional linear component</td>
  5417. </tr>
  5418. <tr>
  5419. <td style="text-align: left;">133</td>
  5420. <td style="text-align: left;"><code>BARCODE_DBAR_LTD_CC</code></td>
  5421. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  5422. Limited linear component</td>
  5423. </tr>
  5424. <tr>
  5425. <td style="text-align: left;">134</td>
  5426. <td style="text-align: left;"><code>BARCODE_DBAR_EXP_CC</code></td>
  5427. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  5428. Expanded linear component</td>
  5429. </tr>
  5430. <tr>
  5431. <td style="text-align: left;">135</td>
  5432. <td style="text-align: left;"><code>BARCODE_UPCA_CC</code></td>
  5433. <td style="text-align: left;">GS1 Composite Symbol with UPC-A linear
  5434. component</td>
  5435. </tr>
  5436. <tr>
  5437. <td style="text-align: left;">136</td>
  5438. <td style="text-align: left;"><code>BARCODE_UPCE_CC</code></td>
  5439. <td style="text-align: left;">GS1 Composite Symbol with UPC-E linear
  5440. component</td>
  5441. </tr>
  5442. <tr>
  5443. <td style="text-align: left;">137</td>
  5444. <td style="text-align: left;"><code>BARCODE_DBAR_STK_CC</code></td>
  5445. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  5446. Stacked component</td>
  5447. </tr>
  5448. <tr>
  5449. <td style="text-align: left;">138</td>
  5450. <td style="text-align: left;"><code>BARCODE_DBAR_OMNSTK_CC</code></td>
  5451. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  5452. Stacked Omnidirectional component</td>
  5453. </tr>
  5454. <tr>
  5455. <td style="text-align: left;">139</td>
  5456. <td style="text-align: left;"><code>BARCODE_DBAR_EXPSTK_CC</code></td>
  5457. <td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
  5458. Expanded Stacked component</td>
  5459. </tr>
  5460. </tbody>
  5461. </table>
  5462. </div>
  5463. <p>The data to be encoded in the linear component of a composite symbol
  5464. should be entered into a primary string with the data for the 2D
  5465. component being entered in the normal way. To do this at the command
  5466. prompt use the <code>--primary</code> switch (API <code>primary</code>).
  5467. For example:</p>
  5468. <div class="sourceCode" id="cb108"><pre
  5469. class="sourceCode bash"><code class="sourceCode bash"><span id="cb108-1"><a href="#cb108-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX_CC <span class="at">--mode</span><span class="op">=</span>1 <span class="at">--primary</span><span class="op">=</span>331234567890 <span class="at">-d</span> <span class="st">&quot;[99]1234-abcd&quot;</span></span></code></pre></div>
  5470. <p>This creates an EAN-13 linear component with the data
  5471. <code>"331234567890"</code> and a 2D CC-A (see <a
  5472. href="#cc-a">below</a>) component with the data
  5473. <code>"(99)1234-abcd"</code>. The same results can be achieved using the
  5474. API as shown below:</p>
  5475. <div class="sourceCode" id="cb109"><pre
  5476. class="sourceCode c"><code class="sourceCode c"><span id="cb109-1"><a href="#cb109-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_EANX_CC<span class="op">;</span></span>
  5477. <span id="cb109-2"><a href="#cb109-2" aria-hidden="true" tabindex="-1"></a></span>
  5478. <span id="cb109-3"><a href="#cb109-3" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>option_1 <span class="op">=</span> <span class="dv">1</span><span class="op">;</span></span>
  5479. <span id="cb109-4"><a href="#cb109-4" aria-hidden="true" tabindex="-1"></a></span>
  5480. <span id="cb109-5"><a href="#cb109-5" aria-hidden="true" tabindex="-1"></a>strcpy<span class="op">(</span>my_symbol<span class="op">-&gt;</span>primary<span class="op">,</span> <span class="st">&quot;331234567890&quot;</span><span class="op">);</span></span>
  5481. <span id="cb109-6"><a href="#cb109-6" aria-hidden="true" tabindex="-1"></a></span>
  5482. <span id="cb109-7"><a href="#cb109-7" aria-hidden="true" tabindex="-1"></a>ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;[99]1234-abcd&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div>
  5483. <p>EAN-2 and EAN-5 add-on data can be used with EAN and UPC symbols
  5484. using the + symbol as described in sections <a
  5485. href="#upc-universal-product-code-iso-15420">6.1.3 UPC (Universal
  5486. Product Code) (ISO 15420)</a> and <a
  5487. href="#ean-european-article-number-iso-15420">6.1.4 EAN (European
  5488. Article Number) (ISO 15420)</a>.</p>
  5489. <p>The 2D component of a composite symbol can use one of three systems:
  5490. CC-A, CC-B and CC-C, as described below. The 2D component type can be
  5491. selected automatically by Zint dependent on the length of the input
  5492. string. Alternatively the three methods can be accessed using the
  5493. <code>--mode</code> prompt (API <code>option_1</code>) followed by 1, 2
  5494. or 3 for CC-A, CC-B or CC-C respectively.</p>
  5495. <h3 id="cc-a">6.3.1 CC-A</h3>
  5496. <figure>
  5497. <img src="images/eanx_cc_a.svg" title="fig:" class="upcean"
  5498. alt="zint -b EANX_CC --compliantheight -d &quot;[99]1234-abcd&quot; --mode=1 --primary=331234567890" />
  5499. <figcaption
  5500. aria-hidden="true"><code>zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=1 --primary=331234567890</code></figcaption>
  5501. </figure>
  5502. <p>This system uses a variation of MicroPDF417 which is optimised to fit
  5503. into a small space. The size of the 2D component and the amount of error
  5504. correction is determined by the amount of data to be encoded and the
  5505. type of linear component which is being used. CC-A can encode up to 56
  5506. numeric digits or an alphanumeric string of shorter length. To select
  5507. CC-A use <code>--mode=1</code> (API <code>option_1 = 1</code>).</p>
  5508. <h3 id="cc-b">6.3.2 CC-B</h3>
  5509. <figure>
  5510. <img src="images/eanx_cc_b.svg" title="fig:" class="upcean"
  5511. alt="zint -b EANX_CC --compliantheight -d &quot;[99]1234-abcd&quot; --mode=2 --primary=331234567890" />
  5512. <figcaption
  5513. aria-hidden="true"><code>zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=2 --primary=331234567890</code></figcaption>
  5514. </figure>
  5515. <p>This system uses MicroPDF417 to encode the 2D component. The size of
  5516. the 2D component and the amount of error correction is determined by the
  5517. amount of data to be encoded and the type of linear component which is
  5518. being used. CC-B can encode up to 338 numeric digits or an alphanumeric
  5519. string of shorter length. To select CC-B use <code>--mode=2</code> (API
  5520. <code>option_1 = 2</code>).</p>
  5521. <h3 id="cc-c">6.3.3 CC-C</h3>
  5522. <figure>
  5523. <img src="images/gs1_128_cc_c.svg" title="fig:" class="upcean"
  5524. alt="zint -b GS1_128_CC --compliantheight -d &quot;[99]1234-abcd&quot; --mode=3 --primary=&quot;[01]03312345678903&quot;" />
  5525. <figcaption
  5526. aria-hidden="true"><code>zint -b GS1_128_CC --compliantheight -d "[99]1234-abcd" --mode=3 --primary="[01]03312345678903"</code></figcaption>
  5527. </figure>
  5528. <p>This system uses PDF417 and can only be used in conjunction with a
  5529. GS1-128 linear component. CC-C can encode up to 2361 numeric digits or
  5530. an alphanumeric string of shorter length. To select CC-C use
  5531. <code>--mode=3</code> (API <code>option_1 = 3</code>).</p>
  5532. <h2 id="two-track-symbols">6.4 Two-Track Symbols</h2>
  5533. <h3 id="two-track-pharmacode">6.4.1 Two-Track Pharmacode</h3>
  5534. <figure>
  5535. <img src="images/pharma_two.svg" title="fig:" class="trk"
  5536. alt="zint -b PHARMA_TWO --compliantheight -d &quot;29876543&quot;" />
  5537. <figcaption
  5538. aria-hidden="true"><code>zint -b PHARMA_TWO --compliantheight -d "29876543"</code></figcaption>
  5539. </figure>
  5540. <p>Developed by Laetus, Pharmacode Two-Track is an alternative system to
  5541. Pharmacode One-Track (see <a href="#pharmacode">6.1.9 Pharmacode</a>)
  5542. used for the identification of pharmaceuticals. The symbology is able to
  5543. encode whole numbers between 4 and 64570080.</p>
  5544. <h3 id="postnet">6.4.2 POSTNET</h3>
  5545. <figure>
  5546. <img src="images/postnet.svg" title="fig:" class="trk"
  5547. alt="zint -b POSTNET --compliantheight -d &quot;12345678901&quot;" />
  5548. <figcaption
  5549. aria-hidden="true"><code>zint -b POSTNET --compliantheight -d "12345678901"</code></figcaption>
  5550. </figure>
  5551. <p>Used by the United States Postal Service until 2009, the POSTNET
  5552. barcode was used for encoding zip-codes on mail items. POSTNET uses
  5553. numerical input data and includes a modulo-10 check digit. While Zint
  5554. will encode POSTNET symbols of up to 38 digits in length, standard
  5555. lengths as used by USPS were <code>PostNet6</code> (5-digit ZIP input),
  5556. <code>PostNet10</code> (5-digit ZIP + 4-digit user data) and
  5557. <code>PostNet12</code> (5-digit ZIP + 6-digit user data), and a warning
  5558. will be issued if the input length is not one of these.</p>
  5559. <h3 id="planet">6.4.3 PLANET</h3>
  5560. <figure>
  5561. <img src="images/planet.svg" title="fig:" class="trk"
  5562. alt="zint -b PLANET --compliantheight -d &quot;4012345235636&quot;" />
  5563. <figcaption
  5564. aria-hidden="true"><code>zint -b PLANET --compliantheight -d "4012345235636"</code></figcaption>
  5565. </figure>
  5566. <p>Used by the United States Postal Service until 2009, the PLANET
  5567. (Postal Alpha Numeric Encoding Technique) barcode was used for encoding
  5568. routing data on mail items. PLANET uses numerical input data and
  5569. includes a modulo-10 check digit. While Zint will encode PLANET symbols
  5570. of up to 38 digits in length, standard lengths used by USPS were
  5571. <code>Planet12</code> (11-digit input) and <code>Planet14</code>
  5572. (13-digit input), and as with POSTNET a warning will be issued if the
  5573. length is not one of these.</p>
  5574. <h3 id="brazilian-cepnet">6.4.4 Brazilian CEPNet</h3>
  5575. <figure>
  5576. <img src="images/cepnet.svg" title="fig:" class="trk"
  5577. alt="zint -b CEPNET --compliantheight -d &quot;12345678&quot;" />
  5578. <figcaption
  5579. aria-hidden="true"><code>zint -b CEPNET --compliantheight -d "12345678"</code></figcaption>
  5580. </figure>
  5581. <p>Based on POSTNET, the CEPNet symbol is used by Correios, the
  5582. Brazilian postal service, to encode CEP (Código de Endereçamento Postal)
  5583. numbers on mail items. Input should consist of eight digits with the
  5584. check digit being automatically added by Zint.</p>
  5585. <h3 id="dx-film-edge-barcode">6.4.5 DX Film Edge Barcode</h3>
  5586. <figure>
  5587. <img src="images/dxfilmedge.svg" title="fig:" class="trk"
  5588. alt="zint -b DXFILMEDGE --compliantheight -d &quot;112-1/10A&quot;" />
  5589. <figcaption
  5590. aria-hidden="true"><code>zint -b DXFILMEDGE --compliantheight -d "112-1/10A"</code></figcaption>
  5591. </figure>
  5592. <p>Introduced by Kodak in the 1980s, the DX (Digital Index) barcode is
  5593. printed on the bottom edge of 35mm film to aid in the reordering and
  5594. post-processing of prints.</p>
  5595. <p>The data can be in two parts. The first part (required) is the “DX
  5596. number”, identifying the manufacturer and film type - the National
  5597. Association of Photographic Manufacturers (NAPM) number. The second
  5598. part, which is optional and if present is separated from the first by a
  5599. slash (<code>/</code>), gives the frame number.</p>
  5600. <p>The DX number is in either of two formats. The first format is a
  5601. number of 1 to 4 digits (“DX Extract”) or 6 digits (“DX Full”), but for
  5602. the 6-digit version the first and last digit are ignored, leaving a
  5603. 4-digit DX Extract number in any case, which must be in the range 16 to
  5604. 2047. The second format “NNN-NN” represents the DX Extract as two
  5605. numbers separated by a dash (<code>-</code>), the first number being 1
  5606. to 3 digits (range 1 to 127) and the second 1 to 2 digits (range 0 to
  5607. 15).<a href="#fn15" class="footnote-ref" id="fnref15"
  5608. role="doc-noteref"><sup>15</sup></a></p>
  5609. <p>The optional frame number is a number in the range 0 to 63, and may
  5610. have a half frame indicator “A” appended. Special character sequences
  5611. (with or without a half frame indicator appended) may also be used: “S”
  5612. or “X” means frame number 62, “K” or “00” means frame number 63, and “F”
  5613. means frame number 0.</p>
  5614. <p>A parity bit is automatically added by Zint.</p>
  5615. <h2 id="state-postal-codes">6.5 4-State Postal Codes</h2>
  5616. <h3 id="australia-post-4-state-symbols">6.5.1 Australia Post 4-State
  5617. Symbols</h3>
  5618. <h4 id="customer-barcodes">6.5.1.1 Customer Barcodes</h4>
  5619. <figure>
  5620. <img src="images/auspost.svg" title="fig:" class="trk"
  5621. alt="zint -b AUSPOST --compliantheight -d &quot;96184209&quot;" />
  5622. <figcaption
  5623. aria-hidden="true"><code>zint -b AUSPOST --compliantheight -d "96184209"</code></figcaption>
  5624. </figure>
  5625. <p>Australia Post Standard Customer Barcode, Customer Barcode 2 and
  5626. Customer Barcode 3 are 37-bar, 52-bar and 67-bar specifications
  5627. respectively, developed by Australia Post for printing Delivery Point ID
  5628. (DPID) and customer information on mail items. Valid data characters are
  5629. 0-9, A-Z, a-z, space and hash (#). A Format Control Code (FCC) is added
  5630. by Zint and should not be included in the input data. Reed-Solomon error
  5631. correction data is generated by Zint. Encoding behaviour is determined
  5632. by the length of the input data according to the formula shown in the
  5633. following table.</p>
  5634. <div id="tbl:auspost_input_formats" class="tablenos">
  5635. <table id="tbl:auspost_input_formats" style="width:86%;"
  5636. data-tag=": Australia Post Input Formats">
  5637. <caption><span>Table : Australia Post Input Formats</span> </caption>
  5638. <colgroup>
  5639. <col style="width: 13%" />
  5640. <col style="width: 38%" />
  5641. <col style="width: 12%" />
  5642. <col style="width: 8%" />
  5643. <col style="width: 12%" />
  5644. </colgroup>
  5645. <thead>
  5646. <tr>
  5647. <th style="text-align: left;">Input Length</th>
  5648. <th style="text-align: left;">Required Input Format</th>
  5649. <th>Symbol Length</th>
  5650. <th>FCC</th>
  5651. <th style="text-align: left;">Encoding Table</th>
  5652. </tr>
  5653. </thead>
  5654. <tbody>
  5655. <tr>
  5656. <td style="text-align: left;">8</td>
  5657. <td style="text-align: left;"><code>99999999</code></td>
  5658. <td>37-bar</td>
  5659. <td>11</td>
  5660. <td style="text-align: left;">None</td>
  5661. </tr>
  5662. <tr>
  5663. <td style="text-align: left;">13</td>
  5664. <td style="text-align: left;"><code>99999999AAAAA</code></td>
  5665. <td>52-bar</td>
  5666. <td>59</td>
  5667. <td style="text-align: left;">C</td>
  5668. </tr>
  5669. <tr>
  5670. <td style="text-align: left;">16</td>
  5671. <td style="text-align: left;"><code>9999999999999999</code></td>
  5672. <td>52-bar</td>
  5673. <td>59</td>
  5674. <td style="text-align: left;">N</td>
  5675. </tr>
  5676. <tr>
  5677. <td style="text-align: left;">18</td>
  5678. <td style="text-align: left;"><code>99999999AAAAAAAAAA</code></td>
  5679. <td>67-bar</td>
  5680. <td>62</td>
  5681. <td style="text-align: left;">C</td>
  5682. </tr>
  5683. <tr>
  5684. <td style="text-align: left;">23</td>
  5685. <td style="text-align: left;"><code>99999999999999999999999</code></td>
  5686. <td>67-bar</td>
  5687. <td>62</td>
  5688. <td style="text-align: left;">N</td>
  5689. </tr>
  5690. </tbody>
  5691. </table>
  5692. </div>
  5693. <h4 id="reply-paid-barcode">6.5.1.2 Reply Paid Barcode</h4>
  5694. <figure>
  5695. <img src="images/ausreply.svg" title="fig:" class="trk"
  5696. alt="zint -b AUSREPLY --compliantheight -d &quot;12345678&quot;" />
  5697. <figcaption
  5698. aria-hidden="true"><code>zint -b AUSREPLY --compliantheight -d "12345678"</code></figcaption>
  5699. </figure>
  5700. <p>A Reply Paid version of the Australia Post 4-State Barcode (FCC 45)
  5701. which requires an 8-digit DPID input.</p>
  5702. <h4 id="routing-barcode">6.5.1.3 Routing Barcode</h4>
  5703. <figure>
  5704. <img src="images/ausroute.svg" title="fig:" class="trk"
  5705. alt="zint -b AUSROUTE --compliantheight -d &quot;34567890&quot;" />
  5706. <figcaption
  5707. aria-hidden="true"><code>zint -b AUSROUTE --compliantheight -d "34567890"</code></figcaption>
  5708. </figure>
  5709. <p>A Routing version of the Australia Post 4-State Barcode (FCC 87)
  5710. which requires an 8-digit DPID input.</p>
  5711. <h4 id="redirect-barcode">6.5.1.4 Redirect Barcode</h4>
  5712. <figure>
  5713. <img src="images/ausredirect.svg" title="fig:" class="trk"
  5714. alt="zint -b AUSREDIRECT --compliantheight -d &quot;98765432&quot;" />
  5715. <figcaption
  5716. aria-hidden="true"><code>zint -b AUSREDIRECT --compliantheight -d "98765432"</code></figcaption>
  5717. </figure>
  5718. <p>A Redirection version of the Australia Post 4-State Barcode (FCC 92)
  5719. which requires an 8-digit DPID input.</p>
  5720. <h3 id="dutch-post-kix-code">6.5.2 Dutch Post KIX Code</h3>
  5721. <figure>
  5722. <img src="images/kix.svg" title="fig:" class="trk"
  5723. alt="zint -b KIX --compliantheight -d &quot;2500GG30250&quot;" />
  5724. <figcaption
  5725. aria-hidden="true"><code>zint -b KIX --compliantheight -d "2500GG30250"</code></figcaption>
  5726. </figure>
  5727. <p>This symbology is used by Royal Dutch TPG Post (Netherlands) for
  5728. Postal code and automatic mail sorting. Data input can consist of
  5729. numbers 0-9 and letters A-Z and needs to be 11 characters in length. No
  5730. check digit is included.</p>
  5731. <h3 id="royal-mail-4-state-customer-code-rm4scc">6.5.3 Royal Mail
  5732. 4-State Customer Code (RM4SCC)</h3>
  5733. <figure>
  5734. <img src="images/rm4scc.svg" title="fig:" class="trk"
  5735. alt="zint -b RM4SCC --compliantheight -d &quot;W1J0TR01&quot;" />
  5736. <figcaption
  5737. aria-hidden="true"><code>zint -b RM4SCC --compliantheight -d "W1J0TR01"</code></figcaption>
  5738. </figure>
  5739. <p>The RM4SCC standard is used by the Royal Mail in the UK to encode
  5740. postcode and customer data on mail items. Data input can consist of
  5741. numbers 0-9 and letters A-Z and usually includes delivery postcode
  5742. followed by house number. For example <code>"W1J0TR01"</code> for 1
  5743. Piccadilly Circus in London. Check digit data is generated by Zint.</p>
  5744. <h3 id="royal-mail-4-state-mailmark">6.5.4 Royal Mail 4-State
  5745. Mailmark</h3>
  5746. <figure>
  5747. <img src="images/mailmark_4s.svg" title="fig:" class="trk"
  5748. alt="zint -b MAILMARK_4S --compliantheight -d &quot;1100000000000XY11&quot;" />
  5749. <figcaption
  5750. aria-hidden="true"><code>zint -b MAILMARK_4S --compliantheight -d "1100000000000XY11"</code></figcaption>
  5751. </figure>
  5752. <p>Developed in 2014 as a replacement for RM4SCC this 4-state symbol
  5753. includes Reed- Solomon error correction. Input is a pre-formatted
  5754. alphanumeric string of 22 (for Barcode C) or 26 (for Barcode L)
  5755. characters, producing a symbol with 66 or 78 bars respectively. The
  5756. rules for the input data are complex, as summarized in the following
  5757. table.</p>
  5758. <div id="tbl:mailmark_4s_input_fields" class="tablenos">
  5759. <table id="tbl:mailmark_4s_input_fields" style="width:100%;"
  5760. data-tag=": Royal Mail 4-State Mailmark Input Fields">
  5761. <caption><span>Table : Royal Mail 4-State Mailmark Input Fields</span>
  5762. </caption>
  5763. <colgroup>
  5764. <col style="width: 11%" />
  5765. <col style="width: 11%" />
  5766. <col style="width: 17%" />
  5767. <col style="width: 22%" />
  5768. <col style="width: 13%" />
  5769. <col style="width: 23%" />
  5770. </colgroup>
  5771. <thead>
  5772. <tr>
  5773. <th style="text-align: left;">Format</th>
  5774. <th style="text-align: left;">Version ID</th>
  5775. <th style="text-align: left;">Class</th>
  5776. <th>Supply Chain ID</th>
  5777. <th style="text-align: left;">Item ID</th>
  5778. <th style="text-align: left;">Destination+DPS</th>
  5779. </tr>
  5780. </thead>
  5781. <tbody>
  5782. <tr>
  5783. <td style="text-align: left;">1 digit (0-4)</td>
  5784. <td style="text-align: left;">1 digit (0-3)</td>
  5785. <td style="text-align: left;">1 alphanum. (0-9A-E)</td>
  5786. <td>2 digits (C) or 6 digits (L)</td>
  5787. <td style="text-align: left;">8 digits</td>
  5788. <td style="text-align: left;">9 alphanumerics (1 of 6 patterns)</td>
  5789. </tr>
  5790. </tbody>
  5791. </table>
  5792. </div>
  5793. <p>The 6 Destination+DPS (Destination Post Code plus Delivery Point
  5794. Suffix) patterns are:</p>
  5795. <div id="tbl:mailmark_destination_dps" class="tablenos">
  5796. <table id="tbl:mailmark_destination_dps"
  5797. data-tag=": Royal Mail Mailmark Destination+DPS Patterns">
  5798. <caption><span>Table : Royal Mail Mailmark Destination+DPS
  5799. Patterns:</span> </caption>
  5800. <tbody>
  5801. <tr>
  5802. <td><code>FNFNLLNLS</code></td>
  5803. <td><code>FFNNLLNLS</code></td>
  5804. <td><code>FFNNNLLNL</code></td>
  5805. </tr>
  5806. <tr>
  5807. <td><code>FFNFNLLNL</code></td>
  5808. <td><code>FNNLLNLSS</code></td>
  5809. <td><code>FNNNLLNLS</code></td>
  5810. </tr>
  5811. </tbody>
  5812. </table>
  5813. </div>
  5814. <p>where <code>'F'</code> stands for full alphabetic (A-Z),
  5815. <code>'L'</code> for limited alphabetic (A-Z less
  5816. <code>'CIKMOV'</code>), <code>'N'</code> for numeric (0-9), and
  5817. <code>'S'</code> for space.</p>
  5818. <p>Four of the permitted patterns include a number of trailing space
  5819. characters - these will be appended by Zint if not included in the input
  5820. data.</p>
  5821. <p>For the two-dimensional Data Matrix-based version, see <a
  5822. href="#royal-mail-2d-mailmark-cmdm-data-matrix">6.6.2 Royal Mail 2D
  5823. Mailmark (CMDM) (Data Matrix)</a>.</p>
  5824. <h3 id="usps-intelligent-mail">6.5.5 USPS Intelligent Mail</h3>
  5825. <figure>
  5826. <img src="images/usps_imail.svg" title="fig:" class="trk"
  5827. alt="zint -b USPS_IMAIL --compliantheight -d &quot;01234567094987654321-01234&quot;" />
  5828. <figcaption
  5829. aria-hidden="true"><code>zint -b USPS_IMAIL --compliantheight -d "01234567094987654321-01234"</code></figcaption>
  5830. </figure>
  5831. <p>Also known as the OneCode barcode and used in the U.S. by the United
  5832. States Postal Service (USPS), the Intelligent Mail system replaced the
  5833. POSTNET and PLANET symbologies in 2009. Intelligent Mail is a fixed
  5834. length (65-bar) symbol which combines routing and customer information
  5835. in a single symbol. Input data consists of a 20-digit tracking code,
  5836. followed by a dash (<code>-</code>), followed by a delivery point
  5837. zip-code which can be 0, 5, 9 or 11 digits in length. For example all of
  5838. the following inputs are valid data entries:</p>
  5839. <ul>
  5840. <li><code>"01234567094987654321"</code></li>
  5841. <li><code>"01234567094987654321-01234"</code></li>
  5842. <li><code>"01234567094987654321-012345678"</code></li>
  5843. <li><code>"01234567094987654321-01234567891"</code></li>
  5844. </ul>
  5845. <h3 id="japanese-postal-code">6.5.6 Japanese Postal Code</h3>
  5846. <figure>
  5847. <img src="images/japanpost.svg" title="fig:" class="trk"
  5848. alt="zint -b JAPANPOST --compliantheight -d &quot;15400233-16-4-205&quot;" />
  5849. <figcaption
  5850. aria-hidden="true"><code>zint -b JAPANPOST --compliantheight -d "15400233-16-4-205"</code></figcaption>
  5851. </figure>
  5852. <p>Used for address data on mail items for Japan Post. Accepted values
  5853. are 0-9, A-Z and dash (<code>-</code>). A modulo 19 check digit is added
  5854. by Zint.</p>
  5855. <h3 id="daft-code">6.5.7 DAFT Code</h3>
  5856. <figure>
  5857. <img src="images/daft_rm4scc.svg" title="fig:" class="trk"
  5858. alt="zint -b DAFT -d &quot;AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF&quot; --height=8.494 --vers=256" />
  5859. <figcaption
  5860. aria-hidden="true"><code>zint -b DAFT -d "AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF" --height=8.494 --vers=256</code></figcaption>
  5861. </figure>
  5862. <p>This is a method for creating 4-state codes where the data encoding
  5863. is provided by an external program. Input data should consist of the
  5864. letters <code>'D'</code>, <code>'A'</code>, <code>'F'</code> and
  5865. <code>'T'</code> where these refer to descender, ascender, full
  5866. (ascender and descender) and tracker (neither ascender nor descender)
  5867. respectively. All other characters are invalid. The ratio of the tracker
  5868. size to full height can be given in thousandths (permille) using the
  5869. <code>--vers</code> option (API <code>option_2</code>). The default
  5870. value is 250 (25%).</p>
  5871. <p>For example the following</p>
  5872. <div class="sourceCode" id="cb110"><pre
  5873. class="sourceCode bash"><code class="sourceCode bash"><span id="cb110-1"><a href="#cb110-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> DAFT <span class="at">-d</span> AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF <span class="at">--height</span><span class="op">=</span>8.494 <span class="at">--vers</span><span class="op">=</span>256</span></code></pre></div>
  5874. <p>produces the same barcode (see <a
  5875. href="#royal-mail-4-state-customer-code-rm4scc">6.5.3 Royal Mail 4-State
  5876. Customer Code (RM4SCC)</a>) as</p>
  5877. <div class="sourceCode" id="cb111"><pre
  5878. class="sourceCode bash"><code class="sourceCode bash"><span id="cb111-1"><a href="#cb111-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> RM4SCC <span class="at">--compliantheight</span> <span class="at">-d</span> <span class="st">&quot;W1J0TR01&quot;</span></span></code></pre></div>
  5879. <h2 id="matrix-symbols">6.6 Matrix Symbols</h2>
  5880. <h3 id="data-matrix-iso-16022">6.6.1 Data Matrix (ISO 16022)</h3>
  5881. <figure>
  5882. <img src="images/hibc_dm.svg" title="fig:" class="i2dbig"
  5883. alt="zint -b HIBC_DM -d &quot;/ACMRN123456/V200912190833&quot; --fast --square" />
  5884. <figcaption
  5885. aria-hidden="true"><code>zint -b HIBC_DM -d "/ACMRN123456/V200912190833" --fast --square</code></figcaption>
  5886. </figure>
  5887. <p>Also known as Semacode this symbology was developed in 1989 by Acuity
  5888. CiMatrix in partnership with the U.S. DoD and NASA. The symbol can
  5889. encode a large amount of data in a small area. Data Matrix encodes
  5890. characters in the Latin-1 set by default but also supports encoding in
  5891. other character sets using the ECI mechanism. It can also encode GS1
  5892. data. The size of the generated symbol can be adjusted using the
  5893. <code>--vers</code> option (API <code>option_2</code>) as shown in the
  5894. table below. A separate symbology ID (<code>BARCODE_HIBC_DM</code>) can
  5895. be used to encode Health Industry Barcode (HIBC) data. Note that only
  5896. ECC200 encoding is supported, the older standards have now been removed
  5897. from Zint.</p>
  5898. <div id="tbl:datamatrix_sizes" class="tablenos">
  5899. <table id="tbl:datamatrix_sizes" data-tag=": Data Matrix Sizes">
  5900. <caption><span>Table : Data Matrix Sizes</span> </caption>
  5901. <thead>
  5902. <tr>
  5903. <th>Input</th>
  5904. <th>Symbol Size</th>
  5905. <th></th>
  5906. <th>Input</th>
  5907. <th>Symbol Size</th>
  5908. <th></th>
  5909. <th>Input</th>
  5910. <th>Symbol Size</th>
  5911. </tr>
  5912. </thead>
  5913. <tbody>
  5914. <tr>
  5915. <td>1</td>
  5916. <td>10 x 10</td>
  5917. <td></td>
  5918. <td>11</td>
  5919. <td>36 x 36</td>
  5920. <td></td>
  5921. <td>21</td>
  5922. <td>104 x 104</td>
  5923. </tr>
  5924. <tr>
  5925. <td>2</td>
  5926. <td>12 x 12</td>
  5927. <td></td>
  5928. <td>12</td>
  5929. <td>40 x 40</td>
  5930. <td></td>
  5931. <td>22</td>
  5932. <td>120 x 120</td>
  5933. </tr>
  5934. <tr>
  5935. <td>3</td>
  5936. <td>14 x 14</td>
  5937. <td></td>
  5938. <td>13</td>
  5939. <td>44 x 44</td>
  5940. <td></td>
  5941. <td>23</td>
  5942. <td>132 x 132</td>
  5943. </tr>
  5944. <tr>
  5945. <td>4</td>
  5946. <td>16 x 16</td>
  5947. <td></td>
  5948. <td>14</td>
  5949. <td>48 x 48</td>
  5950. <td></td>
  5951. <td>24</td>
  5952. <td>144 x 144</td>
  5953. </tr>
  5954. <tr>
  5955. <td>5</td>
  5956. <td>18 x 18</td>
  5957. <td></td>
  5958. <td>15</td>
  5959. <td>52 x 52</td>
  5960. <td></td>
  5961. <td>25</td>
  5962. <td>8 x 18</td>
  5963. </tr>
  5964. <tr>
  5965. <td>6</td>
  5966. <td>20 x 20</td>
  5967. <td></td>
  5968. <td>16</td>
  5969. <td>64 x 64</td>
  5970. <td></td>
  5971. <td>26</td>
  5972. <td>8 x 32</td>
  5973. </tr>
  5974. <tr>
  5975. <td>7</td>
  5976. <td>22 x 22</td>
  5977. <td></td>
  5978. <td>17</td>
  5979. <td>72 x 72</td>
  5980. <td></td>
  5981. <td>28</td>
  5982. <td>12 x 26</td>
  5983. </tr>
  5984. <tr>
  5985. <td>8</td>
  5986. <td>24 x 24</td>
  5987. <td></td>
  5988. <td>18</td>
  5989. <td>80 x 80</td>
  5990. <td></td>
  5991. <td>28</td>
  5992. <td>12 x 36</td>
  5993. </tr>
  5994. <tr>
  5995. <td>9</td>
  5996. <td>26 x 26</td>
  5997. <td></td>
  5998. <td>19</td>
  5999. <td>88 x 88</td>
  6000. <td></td>
  6001. <td>29</td>
  6002. <td>16 x 36</td>
  6003. </tr>
  6004. <tr>
  6005. <td>10</td>
  6006. <td>32 x 32</td>
  6007. <td></td>
  6008. <td>20</td>
  6009. <td>96 x 96</td>
  6010. <td></td>
  6011. <td>30</td>
  6012. <td>16 x 48</td>
  6013. </tr>
  6014. </tbody>
  6015. </table>
  6016. </div>
  6017. <p>The largest version 24 (144 x 144) can encode 3116 digits, around
  6018. 2335 alphanumeric characters, or 1555 bytes of data.</p>
  6019. <p>When using automatic symbol sizes you can force Zint to use square
  6020. symbols (versions 1-24) at the command line by using the option
  6021. <code>--square</code> (API <code>option_3 = DM_SQUARE</code>).</p>
  6022. <p>Data Matrix Rectangular Extension (ISO/IEC 21471) codes may be
  6023. generated with the following values as before:</p>
  6024. <div id="tbl:dmre_sizes" class="tablenos">
  6025. <table id="tbl:dmre_sizes" data-tag=": DMRE Sizes">
  6026. <caption><span>Table : DMRE Sizes</span> </caption>
  6027. <thead>
  6028. <tr>
  6029. <th>Input</th>
  6030. <th>Symbol Size</th>
  6031. <th></th>
  6032. <th>Input</th>
  6033. <th>Symbol Size</th>
  6034. </tr>
  6035. </thead>
  6036. <tbody>
  6037. <tr>
  6038. <td>31</td>
  6039. <td>8 x 48</td>
  6040. <td></td>
  6041. <td>40</td>
  6042. <td>20 x 36</td>
  6043. </tr>
  6044. <tr>
  6045. <td>32</td>
  6046. <td>8 x 64</td>
  6047. <td></td>
  6048. <td>41</td>
  6049. <td>20 x 44</td>
  6050. </tr>
  6051. <tr>
  6052. <td>33</td>
  6053. <td>8 x 80</td>
  6054. <td></td>
  6055. <td>42</td>
  6056. <td>20 x 64</td>
  6057. </tr>
  6058. <tr>
  6059. <td>34</td>
  6060. <td>8 x 96</td>
  6061. <td></td>
  6062. <td>43</td>
  6063. <td>22 x 48</td>
  6064. </tr>
  6065. <tr>
  6066. <td>35</td>
  6067. <td>8 x 120</td>
  6068. <td></td>
  6069. <td>44</td>
  6070. <td>24 x 48</td>
  6071. </tr>
  6072. <tr>
  6073. <td>36</td>
  6074. <td>8 x 144</td>
  6075. <td></td>
  6076. <td>45</td>
  6077. <td>24 x 64</td>
  6078. </tr>
  6079. <tr>
  6080. <td>37</td>
  6081. <td>12 x 64</td>
  6082. <td></td>
  6083. <td>46</td>
  6084. <td>26 x 40</td>
  6085. </tr>
  6086. <tr>
  6087. <td>38</td>
  6088. <td>12 x 88</td>
  6089. <td></td>
  6090. <td>47</td>
  6091. <td>26 x 48</td>
  6092. </tr>
  6093. <tr>
  6094. <td>39</td>
  6095. <td>16 x 64</td>
  6096. <td></td>
  6097. <td>48</td>
  6098. <td>26 x 64</td>
  6099. </tr>
  6100. </tbody>
  6101. </table>
  6102. </div>
  6103. <p>DMRE symbol sizes may be activated in automatic size mode using the
  6104. option <code>--dmre</code> (API <code>option_3 = DM_DMRE</code>).</p>
  6105. <p>GS1 data may be encoded using FNC1 (default) or GS (Group Separator,
  6106. ASCII 29) as separator. Use the option <code>--gssep</code> to change to
  6107. GS (API <code>output_options |= GS1_GS_SEPARATOR</code>).</p>
  6108. <p>By default Zint uses a “de facto” codeword placement for symbols of
  6109. size 144 x 144 (version 24). To override this and use the now clarified
  6110. ISO/IEC standard placement, use option <code>--dmiso144</code> (API
  6111. <code>option_3 |= DM_ISO_144</code>).</p>
  6112. <p>For a faster but less optimal encoding, the <code>--fast</code>
  6113. option (API <code>input_mode |= FAST_MODE</code>) may be used.</p>
  6114. <p>Data Matrix supports Structured Append of up to 16 symbols and a
  6115. numeric ID (file identifications), which can be set by using the
  6116. <code>--structapp</code> option (see <a href="#structured-append">4.17
  6117. Structured Append</a>) (API <code>structapp</code>). The ID consists of
  6118. 2 numbers <code>ID1</code> and <code>ID2</code>, each of which can range
  6119. from 1 to 254, and is specified as the single number
  6120. <code>ID1 * 1000 + ID2</code>, so for instance <code>ID1</code>
  6121. <code>"123"</code> and <code>ID2</code> <code>"234"</code> would be
  6122. given as <code>"123234"</code>. Note that both <code>ID1</code> and
  6123. <code>ID2</code> must be non-zero, so e.g. <code>"123000"</code> or
  6124. <code>"000123"</code> would be invalid IDs. If an ID is not given it
  6125. defaults to <code>"001001"</code>.</p>
  6126. <h3 id="royal-mail-2d-mailmark-cmdm-data-matrix">6.6.2 Royal Mail 2D
  6127. Mailmark (CMDM) (Data Matrix)</h3>
  6128. <figure>
  6129. <img src="images/mailmark_2d.svg" title="fig:" class="i2dbig"
  6130. alt="zint -b MAILMARK_2D -d &quot;JGB 01Z999999900000001EC1A1AA1A0SN35TQ&quot; --vers=30" />
  6131. <figcaption
  6132. aria-hidden="true"><code>zint -b MAILMARK_2D -d "JGB 01Z999999900000001EC1A1AA1A0SN35TQ" --vers=30</code></figcaption>
  6133. </figure>
  6134. <p>This variant of Data Matrix, also known as “Complex Mail Data Mark”
  6135. (CMDM), was introduced by Royal Mail along with <a
  6136. href="#royal-mail-4-state-mailmark">6.5.4 Royal Mail 4-State
  6137. Mailmark</a>, and offers space for customer data following an initial
  6138. pre-formatted 45 character section, as summarized below.</p>
  6139. <div id="tbl:mailmark_2d_input_fields" class="tablenos">
  6140. <table id="tbl:mailmark_2d_input_fields"
  6141. data-tag=": Royal Mail 2D Mailmark Input Fields">
  6142. <caption><span>Table : Royal Mail 2D Mailmark Input Fields</span>
  6143. </caption>
  6144. <thead>
  6145. <tr>
  6146. <th style="text-align: left;">Field Name</th>
  6147. <th style="text-align: left;">Length</th>
  6148. <th style="text-align: left;">Values</th>
  6149. </tr>
  6150. </thead>
  6151. <tbody>
  6152. <tr>
  6153. <td style="text-align: left;">UPU Country ID</td>
  6154. <td style="text-align: left;">4</td>
  6155. <td style="text-align: left;"><code>"JGB "</code></td>
  6156. </tr>
  6157. <tr>
  6158. <td style="text-align: left;">Information Type</td>
  6159. <td style="text-align: left;">1</td>
  6160. <td style="text-align: left;">Alphanumeric</td>
  6161. </tr>
  6162. <tr>
  6163. <td style="text-align: left;">Version ID</td>
  6164. <td style="text-align: left;">1</td>
  6165. <td style="text-align: left;"><code>"1"</code></td>
  6166. </tr>
  6167. <tr>
  6168. <td style="text-align: left;">Class</td>
  6169. <td style="text-align: left;">1</td>
  6170. <td style="text-align: left;">Alphanumeric</td>
  6171. </tr>
  6172. <tr>
  6173. <td style="text-align: left;">Supply Chain ID</td>
  6174. <td style="text-align: left;">7</td>
  6175. <td style="text-align: left;">Numeric</td>
  6176. </tr>
  6177. <tr>
  6178. <td style="text-align: left;">Item ID</td>
  6179. <td style="text-align: left;">8</td>
  6180. <td style="text-align: left;">Numeric</td>
  6181. </tr>
  6182. <tr>
  6183. <td style="text-align: left;">Destination+DPS</td>
  6184. <td style="text-align: left;">9</td>
  6185. <td style="text-align: left;">Alphanumeric (1 of 6 patterns)</td>
  6186. </tr>
  6187. <tr>
  6188. <td style="text-align: left;">Service Type</td>
  6189. <td style="text-align: left;">1</td>
  6190. <td style="text-align: left;">Numeric</td>
  6191. </tr>
  6192. <tr>
  6193. <td style="text-align: left;">RTS Post Code</td>
  6194. <td style="text-align: left;">7</td>
  6195. <td style="text-align: left;">Alphanumeric (1 of 6 patterns)</td>
  6196. </tr>
  6197. <tr>
  6198. <td style="text-align: left;">Reserved</td>
  6199. <td style="text-align: left;">6</td>
  6200. <td style="text-align: left;">Spaces</td>
  6201. </tr>
  6202. <tr>
  6203. <td style="text-align: left;">Customer Data</td>
  6204. <td style="text-align: left;">6, 45 or 29</td>
  6205. <td style="text-align: left;">Anything (Latin-1)</td>
  6206. </tr>
  6207. </tbody>
  6208. </table>
  6209. </div>
  6210. <p>The 6 Destination+DPS (Destination Post Code plus Delivery Point
  6211. Suffix) patterns are the same as for the 4-state - see Table <a
  6212. href="#tbl:mailmark_destination_dps">: Royal Mail Mailmark
  6213. Destination+DPS Patterns</a>. The 6 RTS (Return to Sender) Post Code
  6214. patterns are the same also except without the additional DPS
  6215. <code>'NL'</code>, i.e.</p>
  6216. <div id="tbl:mailmark_2d_rts" class="tablenos">
  6217. <table id="tbl:mailmark_2d_rts"
  6218. data-tag=": Royal Mail 2D Mailmark RTS Patterns">
  6219. <caption><span>Table : Royal Mail 2D Mailmark RTS Patterns</span>
  6220. </caption>
  6221. <tbody>
  6222. <tr>
  6223. <td><code>FNFNLLS</code></td>
  6224. <td><code>FFNNLLS</code></td>
  6225. <td><code>FFNNNLL</code></td>
  6226. </tr>
  6227. <tr>
  6228. <td><code>FFNFNLL</code></td>
  6229. <td><code>FNNLLSS</code></td>
  6230. <td><code>FNNNLLS</code></td>
  6231. </tr>
  6232. </tbody>
  6233. </table>
  6234. </div>
  6235. <p>where <code>'F'</code> is full alphabetic (A-Z), <code>'L'</code>
  6236. limited alphabetic (A-Z less <code>'CIKMOV'</code>), <code>'N'</code>
  6237. numeric (0-9), and <code>'S'</code> space.</p>
  6238. <p>Three sizes are defined, one rectangular, with varying maximum
  6239. amounts of optional customer data:</p>
  6240. <div id="tbl:mailmark_2d_sizes" class="tablenos">
  6241. <table id="tbl:mailmark_2d_sizes"
  6242. data-tag=": Royal Mail 2D Mailmark Sizes">
  6243. <caption><span>Table : Royal Mail 2D Mailmark Sizes</span> </caption>
  6244. <thead>
  6245. <tr>
  6246. <th style="text-align: left;">Name</th>
  6247. <th style="text-align: left;">Size</th>
  6248. <th>Customer Data</th>
  6249. <th>Zint Version</th>
  6250. </tr>
  6251. </thead>
  6252. <tbody>
  6253. <tr>
  6254. <td style="text-align: left;">Type 7</td>
  6255. <td style="text-align: left;">24 x 24</td>
  6256. <td>6 characters</td>
  6257. <td>8</td>
  6258. </tr>
  6259. <tr>
  6260. <td style="text-align: left;">Type 9</td>
  6261. <td style="text-align: left;">32 x 32</td>
  6262. <td>45 characters</td>
  6263. <td>10</td>
  6264. </tr>
  6265. <tr>
  6266. <td style="text-align: left;">Type 29</td>
  6267. <td style="text-align: left;">16 x 48</td>
  6268. <td>29 characters</td>
  6269. <td>30</td>
  6270. </tr>
  6271. </tbody>
  6272. </table>
  6273. </div>
  6274. <p>Zint will automatically select a size based on the amount of customer
  6275. data, or it can be specified using the <code>--vers</code> option (API
  6276. <code>option_2</code>), which takes the Zint version number (one more
  6277. than the Royal Mail Type number). Zint will prefix the input data with
  6278. <code>"JGB "</code> if it’s missing, and also space-pad the input if the
  6279. customer data is absent or falls short. As with Data Matrix, the
  6280. rectangular symbol Type 29 can be excluded from automatic size selection
  6281. by using the option <code>--square</code> (API
  6282. <code>option_3 = DM_SQUARE</code>).</p>
  6283. <p>GS1 data, the ECI mechanism, and Structured Append are not
  6284. supported.</p>
  6285. <h3 id="qr-code-iso-18004">6.6.3 QR Code (ISO 18004)</h3>
  6286. <figure>
  6287. <img src="images/qrcode.svg" title="fig:" class="i2dbig"
  6288. alt="zint -b QRCODE -d &quot;QR Code Symbol&quot; --mask=5" />
  6289. <figcaption
  6290. aria-hidden="true"><code>zint -b QRCODE -d "QR Code Symbol" --mask=5</code></figcaption>
  6291. </figure>
  6292. <p>Also known as Quick Response Code this symbology was developed by
  6293. Denso. Four levels of error correction are available using the
  6294. <code>--secure</code> option (API <code>option_1</code>) as shown in the
  6295. following table.</p>
  6296. <div id="tbl:qrcode_eccs" class="tablenos">
  6297. <table id="tbl:qrcode_eccs" data-tag=": QR Code ECC Levels">
  6298. <caption><span>Table : QR Code ECC Levels</span> </caption>
  6299. <thead>
  6300. <tr>
  6301. <th>Input</th>
  6302. <th>ECC Level</th>
  6303. <th>Error Correction Capacity</th>
  6304. <th>Recovery Capacity</th>
  6305. </tr>
  6306. </thead>
  6307. <tbody>
  6308. <tr>
  6309. <td>1</td>
  6310. <td>L</td>
  6311. <td>Approx 20% of symbol</td>
  6312. <td>Approx 7%</td>
  6313. </tr>
  6314. <tr>
  6315. <td>2</td>
  6316. <td>M</td>
  6317. <td>Approx 37% of symbol</td>
  6318. <td>Approx 15%</td>
  6319. </tr>
  6320. <tr>
  6321. <td>3</td>
  6322. <td>Q</td>
  6323. <td>Approx 55% of symbol</td>
  6324. <td>Approx 25%</td>
  6325. </tr>
  6326. <tr>
  6327. <td>4</td>
  6328. <td>H</td>
  6329. <td>Approx 65% of symbol</td>
  6330. <td>Approx 30%</td>
  6331. </tr>
  6332. </tbody>
  6333. </table>
  6334. </div>
  6335. <p>The size of the symbol can be specified by setting the
  6336. <code>--vers</code> option (API <code>option_2</code>) to the QR Code
  6337. version required (1-40). The size of symbol generated is shown in the
  6338. table below.</p>
  6339. <div id="tbl:qrcode_sizes" class="tablenos">
  6340. <table id="tbl:qrcode_sizes" data-tag=": QR Code Sizes">
  6341. <caption><span>Table : QR Code Sizes</span> </caption>
  6342. <thead>
  6343. <tr>
  6344. <th>Input</th>
  6345. <th>Symbol Size</th>
  6346. <th></th>
  6347. <th>Input</th>
  6348. <th>Symbol Size</th>
  6349. <th></th>
  6350. <th>Input</th>
  6351. <th>Symbol Size</th>
  6352. </tr>
  6353. </thead>
  6354. <tbody>
  6355. <tr>
  6356. <td>1</td>
  6357. <td>21 x 21</td>
  6358. <td></td>
  6359. <td>15</td>
  6360. <td>77 x 77</td>
  6361. <td></td>
  6362. <td>29</td>
  6363. <td>133 x 133</td>
  6364. </tr>
  6365. <tr>
  6366. <td>2</td>
  6367. <td>25 x 25</td>
  6368. <td></td>
  6369. <td>16</td>
  6370. <td>81 x 81</td>
  6371. <td></td>
  6372. <td>30</td>
  6373. <td>137 x 137</td>
  6374. </tr>
  6375. <tr>
  6376. <td>3</td>
  6377. <td>29 x 29</td>
  6378. <td></td>
  6379. <td>17</td>
  6380. <td>85 x 85</td>
  6381. <td></td>
  6382. <td>31</td>
  6383. <td>141 x 141</td>
  6384. </tr>
  6385. <tr>
  6386. <td>4</td>
  6387. <td>33 x 33</td>
  6388. <td></td>
  6389. <td>18</td>
  6390. <td>89 x 89</td>
  6391. <td></td>
  6392. <td>32</td>
  6393. <td>145 x 145</td>
  6394. </tr>
  6395. <tr>
  6396. <td>5</td>
  6397. <td>37 x 37</td>
  6398. <td></td>
  6399. <td>19</td>
  6400. <td>93 x 93</td>
  6401. <td></td>
  6402. <td>33</td>
  6403. <td>149 x 149</td>
  6404. </tr>
  6405. <tr>
  6406. <td>6</td>
  6407. <td>41 x 41</td>
  6408. <td></td>
  6409. <td>20</td>
  6410. <td>97 x 97</td>
  6411. <td></td>
  6412. <td>34</td>
  6413. <td>153 x 153</td>
  6414. </tr>
  6415. <tr>
  6416. <td>7</td>
  6417. <td>45 x 45</td>
  6418. <td></td>
  6419. <td>21</td>
  6420. <td>101 x 101</td>
  6421. <td></td>
  6422. <td>35</td>
  6423. <td>157 x 157</td>
  6424. </tr>
  6425. <tr>
  6426. <td>8</td>
  6427. <td>49 x 49</td>
  6428. <td></td>
  6429. <td>22</td>
  6430. <td>105 x 105</td>
  6431. <td></td>
  6432. <td>36</td>
  6433. <td>161 x 161</td>
  6434. </tr>
  6435. <tr>
  6436. <td>9</td>
  6437. <td>53 x 53</td>
  6438. <td></td>
  6439. <td>23</td>
  6440. <td>109 x 109</td>
  6441. <td></td>
  6442. <td>37</td>
  6443. <td>165 x 165</td>
  6444. </tr>
  6445. <tr>
  6446. <td>10</td>
  6447. <td>57 x 57</td>
  6448. <td></td>
  6449. <td>24</td>
  6450. <td>113 x 113</td>
  6451. <td></td>
  6452. <td>38</td>
  6453. <td>169 x 169</td>
  6454. </tr>
  6455. <tr>
  6456. <td>11</td>
  6457. <td>61 x 61</td>
  6458. <td></td>
  6459. <td>25</td>
  6460. <td>117 x 117</td>
  6461. <td></td>
  6462. <td>39</td>
  6463. <td>173 x 173</td>
  6464. </tr>
  6465. <tr>
  6466. <td>12</td>
  6467. <td>65 x 65</td>
  6468. <td></td>
  6469. <td>26</td>
  6470. <td>121 x 121</td>
  6471. <td></td>
  6472. <td>40</td>
  6473. <td>177 x 177</td>
  6474. </tr>
  6475. <tr>
  6476. <td>13</td>
  6477. <td>69 x 69</td>
  6478. <td></td>
  6479. <td>27</td>
  6480. <td>125 x 125</td>
  6481. <td></td>
  6482. <td></td>
  6483. <td></td>
  6484. </tr>
  6485. <tr>
  6486. <td>14</td>
  6487. <td>73 x 73</td>
  6488. <td></td>
  6489. <td>28</td>
  6490. <td>129 x 129</td>
  6491. <td></td>
  6492. <td></td>
  6493. <td></td>
  6494. </tr>
  6495. </tbody>
  6496. </table>
  6497. </div>
  6498. <p>The maximum capacity of a QR Code symbol (version 40) is 7089 numeric
  6499. digits, 4296 alphanumeric characters or 2953 bytes of data. QR Code
  6500. symbols can also be used to encode GS1 data. QR Code symbols can by
  6501. default encode either characters in the Latin-1 set or Kanji, Katakana
  6502. and ASCII characters which are members of the Shift JIS encoding scheme.
  6503. In addition QR Code supports other character sets using the ECI
  6504. mechanism. Input should usually be entered as UTF-8 with conversion to
  6505. Latin-1 or Shift JIS being carried out by Zint. A separate symbology ID
  6506. (<code>BARCODE_HIBC_QR</code>) can be used to encode Health Industry
  6507. Barcode (HIBC) data.</p>
  6508. <p>Non-ASCII data density may be maximized by using the
  6509. <code>--fullmultibyte</code> switch (API
  6510. <code>option_3 = ZINT_FULL_MULTIBYTE</code>), but check that your
  6511. barcode reader supports this before using.</p>
  6512. <p>QR Code has eight different masks designed to minimize unwanted
  6513. patterns. The best mask to use is selected automatically by Zint but may
  6514. be manually specified by using the <code>--mask</code> switch with
  6515. values 0-7, or in the API by setting
  6516. <code>option_3 = (N + 1) &lt;&lt; 8</code> where N is 0-7. To use with
  6517. <code>ZINT_FULL_MULTIBYTE</code> set</p>
  6518. <div class="sourceCode" id="cb112"><pre
  6519. class="sourceCode c"><code class="sourceCode c"><span id="cb112-1"><a href="#cb112-1" aria-hidden="true" tabindex="-1"></a>option_3 <span class="op">=</span> ZINT_FULL_MULTIBYTE <span class="op">|</span> <span class="op">(</span>N <span class="op">+</span> <span class="dv">1</span><span class="op">)</span> <span class="op">&lt;&lt;</span> <span class="dv">8</span></span></code></pre></div>
  6520. <p>The <code>--fast</code> option (API
  6521. <code>input_mode |= FAST_MODE</code>) may be used when leaving Zint to
  6522. automatically select a mask to reduce the number of masks to try to four
  6523. (0, 2, 4, 7).</p>
  6524. <p>QR Code supports Structured Append of up to 16 symbols and a numeric
  6525. ID (parity), which can be set by using the <code>--structapp</code>
  6526. option (see <a href="#structured-append">4.17 Structured Append</a>)
  6527. (API <code>structapp</code>). The parity ID ranges from 0 (default) to
  6528. 255, and for full compliance should be set to the value obtained by
  6529. <code>XOR</code>-ing together each byte of the complete data forming the
  6530. sequence. Currently this calculation must be done outside of Zint.</p>
  6531. <h3 id="micro-qr-code-iso-18004">6.6.4 Micro QR Code (ISO 18004)</h3>
  6532. <figure>
  6533. <img src="images/microqr.svg" title="fig:" class="i2dbig"
  6534. alt="zint -b MICROQR -d &quot;01234567&quot;" />
  6535. <figcaption
  6536. aria-hidden="true"><code>zint -b MICROQR -d "01234567"</code></figcaption>
  6537. </figure>
  6538. <p>A miniature version of the QR Code symbol for short messages, Micro
  6539. QR Code symbols can encode either Latin-1 characters or Shift JIS
  6540. characters. Input should be entered as a UTF-8 stream with conversion to
  6541. Latin-1 or Shift JIS being carried out automatically by Zint. A
  6542. preferred symbol size can be selected by using the <code>--vers</code>
  6543. option (API <code>option_2</code>), as shown in the table below. Note
  6544. that versions M1 and M2 have restrictions on what characters can be
  6545. encoded.</p>
  6546. <div id="tbl:micrqr_sizes" class="tablenos">
  6547. <table id="tbl:micrqr_sizes" style="width:93%;"
  6548. data-tag=": Micro QR Code Sizes">
  6549. <caption><span>Table : Micro QR Code Sizes</span> </caption>
  6550. <colgroup>
  6551. <col style="width: 11%" />
  6552. <col style="width: 13%" />
  6553. <col style="width: 19%" />
  6554. <col style="width: 48%" />
  6555. </colgroup>
  6556. <thead>
  6557. <tr>
  6558. <th>Input</th>
  6559. <th>Version</th>
  6560. <th>Symbol Size</th>
  6561. <th style="text-align: left;">Allowed Characters</th>
  6562. </tr>
  6563. </thead>
  6564. <tbody>
  6565. <tr>
  6566. <td>1</td>
  6567. <td>M1</td>
  6568. <td>11 x 11</td>
  6569. <td style="text-align: left;">Numeric only</td>
  6570. </tr>
  6571. <tr>
  6572. <td>2</td>
  6573. <td>M2</td>
  6574. <td>13 x 13</td>
  6575. <td style="text-align: left;">Numeric, uppercase letters, space, and the
  6576. characters <code>"$%*+-./:"</code></td>
  6577. </tr>
  6578. <tr>
  6579. <td>3</td>
  6580. <td>M3</td>
  6581. <td>15 x 15</td>
  6582. <td style="text-align: left;">Latin-1 and Shift JIS</td>
  6583. </tr>
  6584. <tr>
  6585. <td>4</td>
  6586. <td>M4</td>
  6587. <td>17 x 17</td>
  6588. <td style="text-align: left;">Latin-1 and Shift JIS</td>
  6589. </tr>
  6590. </tbody>
  6591. </table>
  6592. </div>
  6593. <p>Version M4 can encode up to 35 digits, 21 alphanumerics, 15 bytes or
  6594. 9 Kanji characters.</p>
  6595. <p>Except for version M1, which is always ECC level L, the amount of ECC
  6596. codewords can be adjusted using the <code>--secure</code> option (API
  6597. <code>option_1</code>); however ECC level H is not available for any
  6598. version, and ECC level Q is only available for version M4:</p>
  6599. <div id="tbl:micrqr_eccs" class="tablenos">
  6600. <table id="tbl:micrqr_eccs" style="width:99%;"
  6601. data-tag=": Micro QR ECC Levels">
  6602. <caption><span>Table : Micro QR ECC Levels</span> </caption>
  6603. <colgroup>
  6604. <col style="width: 12%" />
  6605. <col style="width: 12%" />
  6606. <col style="width: 33%" />
  6607. <col style="width: 19%" />
  6608. <col style="width: 20%" />
  6609. </colgroup>
  6610. <thead>
  6611. <tr>
  6612. <th>Input</th>
  6613. <th style="text-align: left;">ECC Level</th>
  6614. <th style="text-align: left;">Error Correction Capacity</th>
  6615. <th style="text-align: left;">Recovery Capacity</th>
  6616. <th style="text-align: left;">Available for Versions</th>
  6617. </tr>
  6618. </thead>
  6619. <tbody>
  6620. <tr>
  6621. <td>1</td>
  6622. <td style="text-align: left;">L</td>
  6623. <td style="text-align: left;">Approx 20% of symbol</td>
  6624. <td style="text-align: left;">Approx 7%</td>
  6625. <td style="text-align: left;">M1, M2, M3, M4</td>
  6626. </tr>
  6627. <tr>
  6628. <td>2</td>
  6629. <td style="text-align: left;">M</td>
  6630. <td style="text-align: left;">Approx 37% of symbol</td>
  6631. <td style="text-align: left;">Approx 15%</td>
  6632. <td style="text-align: left;">M2, M3, M4</td>
  6633. </tr>
  6634. <tr>
  6635. <td>3</td>
  6636. <td style="text-align: left;">Q</td>
  6637. <td style="text-align: left;">Approx 55% of symbol</td>
  6638. <td style="text-align: left;">Approx 25%</td>
  6639. <td style="text-align: left;">M4</td>
  6640. </tr>
  6641. </tbody>
  6642. </table>
  6643. </div>
  6644. <p>The defaults for symbol size and ECC level depend on the input and
  6645. whether either of them is specified.</p>
  6646. <p>For barcode readers that support it, non-ASCII data density may be
  6647. maximized by using the <code>--fullmultibyte</code> switch (API
  6648. <code>option_3 = ZINT_FULL_MULTIBYTE</code>).</p>
  6649. <p>Micro QR Code has four different masks designed to minimize unwanted
  6650. patterns. The best mask to use is selected automatically by Zint but may
  6651. be manually specified by using the <code>--mask</code> switch with
  6652. values 0-3, or in the API by setting
  6653. <code>option_3 = (N + 1) &lt;&lt; 8</code> where N is 0-3. To use with
  6654. <code>ZINT_FULL_MULTIBYTE</code> set</p>
  6655. <div class="sourceCode" id="cb113"><pre
  6656. class="sourceCode c"><code class="sourceCode c"><span id="cb113-1"><a href="#cb113-1" aria-hidden="true" tabindex="-1"></a>option_3 <span class="op">=</span> ZINT_FULL_MULTIBYTE <span class="op">|</span> <span class="op">(</span>N <span class="op">+</span> <span class="dv">1</span><span class="op">)</span> <span class="op">&lt;&lt;</span> <span class="dv">8</span></span></code></pre></div>
  6657. <h3 id="rectangular-micro-qr-code-rmqr-iso-23941">6.6.5 Rectangular
  6658. Micro QR Code (rMQR) (ISO 23941)</h3>
  6659. <figure>
  6660. <img src="images/rmqr.svg" title="fig:" class="i2dbig"
  6661. alt="zint -b RMQR -d &quot;0123456&quot;" />
  6662. <figcaption
  6663. aria-hidden="true"><code>zint -b RMQR -d "0123456"</code></figcaption>
  6664. </figure>
  6665. <p>A rectangular version of QR Code, rMQR supports encoding of GS1 data,
  6666. and either Latin-1 characters or Shift JIS characters, and other
  6667. encodings using the ECI mechanism. As with other symbologies data should
  6668. be entered as UTF-8 with conversion being handled by Zint. The amount of
  6669. ECC codewords can be adjusted using the <code>--secure</code> option
  6670. (API <code>option_1</code>), however only ECC levels M and H are valid
  6671. for this type of symbol.</p>
  6672. <div id="tbl:rmqr_eccs" class="tablenos">
  6673. <table id="tbl:rmqr_eccs" data-tag=": rMQR ECC Levels">
  6674. <caption><span>Table : rMQR ECC Levels</span> </caption>
  6675. <thead>
  6676. <tr>
  6677. <th>Input</th>
  6678. <th>ECC Level</th>
  6679. <th>Error Correction Capacity</th>
  6680. <th>Recovery Capacity</th>
  6681. </tr>
  6682. </thead>
  6683. <tbody>
  6684. <tr>
  6685. <td>2</td>
  6686. <td>M</td>
  6687. <td>Approx 37% of symbol</td>
  6688. <td>Approx 15%</td>
  6689. </tr>
  6690. <tr>
  6691. <td>4</td>
  6692. <td>H</td>
  6693. <td>Approx 65% of symbol</td>
  6694. <td>Approx 30%</td>
  6695. </tr>
  6696. </tbody>
  6697. </table>
  6698. </div>
  6699. <p>The preferred symbol sizes can be selected using the
  6700. <code>--vers</code> option (API <code>option_2</code>) as shown in the
  6701. table below. Input values between 33 and 38 fix the height of the symbol
  6702. while allowing Zint to determine the minimum symbol width.</p>
  6703. <div id="tbl:rmqr_sizes" class="tablenos">
  6704. <table id="tbl:rmqr_sizes" data-tag=": rMQR Sizes">
  6705. <caption><span>Table : rMQR Sizes</span> </caption>
  6706. <colgroup>
  6707. <col style="width: 9%" />
  6708. <col style="width: 12%" />
  6709. <col style="width: 25%" />
  6710. <col style="width: 4%" />
  6711. <col style="width: 9%" />
  6712. <col style="width: 12%" />
  6713. <col style="width: 28%" />
  6714. </colgroup>
  6715. <thead>
  6716. <tr>
  6717. <th>Input</th>
  6718. <th>Version</th>
  6719. <th>Symbol Size (HxW)</th>
  6720. <th></th>
  6721. <th>Input</th>
  6722. <th>Version</th>
  6723. <th style="text-align: left;">Symbol Size (HxW)</th>
  6724. </tr>
  6725. </thead>
  6726. <tbody>
  6727. <tr>
  6728. <td>1</td>
  6729. <td>R7x43</td>
  6730. <td>7 x 43</td>
  6731. <td></td>
  6732. <td>20</td>
  6733. <td>R13x77</td>
  6734. <td style="text-align: left;">13 x 77</td>
  6735. </tr>
  6736. <tr>
  6737. <td>2</td>
  6738. <td>R7x59</td>
  6739. <td>7 x 59</td>
  6740. <td></td>
  6741. <td>21</td>
  6742. <td>R13x99</td>
  6743. <td style="text-align: left;">13 x 99</td>
  6744. </tr>
  6745. <tr>
  6746. <td>3</td>
  6747. <td>R7x77</td>
  6748. <td>7 x 77</td>
  6749. <td></td>
  6750. <td>22</td>
  6751. <td>R13x139</td>
  6752. <td style="text-align: left;">13 x 139</td>
  6753. </tr>
  6754. <tr>
  6755. <td>4</td>
  6756. <td>R7x99</td>
  6757. <td>7 x 99</td>
  6758. <td></td>
  6759. <td>23</td>
  6760. <td>R15x43</td>
  6761. <td style="text-align: left;">15 x 43</td>
  6762. </tr>
  6763. <tr>
  6764. <td>5</td>
  6765. <td>R7x139</td>
  6766. <td>7 x 139</td>
  6767. <td></td>
  6768. <td>24</td>
  6769. <td>R15x59</td>
  6770. <td style="text-align: left;">15 x 59</td>
  6771. </tr>
  6772. <tr>
  6773. <td>6</td>
  6774. <td>R9x43</td>
  6775. <td>9 x 43</td>
  6776. <td></td>
  6777. <td>25</td>
  6778. <td>R15x77</td>
  6779. <td style="text-align: left;">15 x 77</td>
  6780. </tr>
  6781. <tr>
  6782. <td>7</td>
  6783. <td>R9x59</td>
  6784. <td>9 x 59</td>
  6785. <td></td>
  6786. <td>26</td>
  6787. <td>R15x99</td>
  6788. <td style="text-align: left;">15 x 99</td>
  6789. </tr>
  6790. <tr>
  6791. <td>8</td>
  6792. <td>R9x77</td>
  6793. <td>9 x 77</td>
  6794. <td></td>
  6795. <td>27</td>
  6796. <td>R15x139</td>
  6797. <td style="text-align: left;">15 x 139</td>
  6798. </tr>
  6799. <tr>
  6800. <td>9</td>
  6801. <td>R9x99</td>
  6802. <td>9 x 99</td>
  6803. <td></td>
  6804. <td>28</td>
  6805. <td>R17x43</td>
  6806. <td style="text-align: left;">17 x 43</td>
  6807. </tr>
  6808. <tr>
  6809. <td>10</td>
  6810. <td>R9x139</td>
  6811. <td>9 x 139</td>
  6812. <td></td>
  6813. <td>29</td>
  6814. <td>R17x59</td>
  6815. <td style="text-align: left;">17 x 59</td>
  6816. </tr>
  6817. <tr>
  6818. <td>11</td>
  6819. <td>R11x27</td>
  6820. <td>11 x 27</td>
  6821. <td></td>
  6822. <td>30</td>
  6823. <td>R17x77</td>
  6824. <td style="text-align: left;">17 x 77</td>
  6825. </tr>
  6826. <tr>
  6827. <td>12</td>
  6828. <td>R11x43</td>
  6829. <td>11 x 43</td>
  6830. <td></td>
  6831. <td>31</td>
  6832. <td>R17x99</td>
  6833. <td style="text-align: left;">17 x 99</td>
  6834. </tr>
  6835. <tr>
  6836. <td>13</td>
  6837. <td>R11x59</td>
  6838. <td>11 x 59</td>
  6839. <td></td>
  6840. <td>32</td>
  6841. <td>R17x139</td>
  6842. <td style="text-align: left;">17 x 139</td>
  6843. </tr>
  6844. <tr>
  6845. <td>14</td>
  6846. <td>R11x77</td>
  6847. <td>11 x 77</td>
  6848. <td></td>
  6849. <td>33</td>
  6850. <td>R7xW</td>
  6851. <td style="text-align: left;">7 x automatic width</td>
  6852. </tr>
  6853. <tr>
  6854. <td>15</td>
  6855. <td>R11x99</td>
  6856. <td>11 x 99</td>
  6857. <td></td>
  6858. <td>34</td>
  6859. <td>R9xW</td>
  6860. <td style="text-align: left;">9 x automatic width</td>
  6861. </tr>
  6862. <tr>
  6863. <td>16</td>
  6864. <td>R11x139</td>
  6865. <td>11 x 139</td>
  6866. <td></td>
  6867. <td>35</td>
  6868. <td>R11xW</td>
  6869. <td style="text-align: left;">11 x automatic width</td>
  6870. </tr>
  6871. <tr>
  6872. <td>17</td>
  6873. <td>R13x27</td>
  6874. <td>13 x 27</td>
  6875. <td></td>
  6876. <td>36</td>
  6877. <td>R13xW</td>
  6878. <td style="text-align: left;">13 x automatic width</td>
  6879. </tr>
  6880. <tr>
  6881. <td>18</td>
  6882. <td>R13x43</td>
  6883. <td>13 x 43</td>
  6884. <td></td>
  6885. <td>37</td>
  6886. <td>R15xW</td>
  6887. <td style="text-align: left;">15 x automatic width</td>
  6888. </tr>
  6889. <tr>
  6890. <td>19</td>
  6891. <td>R13x59</td>
  6892. <td>13 x 59</td>
  6893. <td></td>
  6894. <td>38</td>
  6895. <td>R17xW</td>
  6896. <td style="text-align: left;">17 x automatic width</td>
  6897. </tr>
  6898. </tbody>
  6899. </table>
  6900. </div>
  6901. <p>The largest version R17x139 (32) can encode up to 361 digits, 219
  6902. alphanumerics, 150 bytes, or 92 Kanji characters.</p>
  6903. <p>For barcode readers that support it, non-ASCII data density may be
  6904. maximized by using the <code>--fullmultibyte</code> switch or in the API
  6905. by setting <code>option_3 = ZINT_FULL_MULTIBYTE</code>.</p>
  6906. <h3 id="upnqr-univerzalnega-plačilnega-naloga-qr">6.6.6 UPNQR
  6907. (Univerzalnega Plačilnega Naloga QR)</h3>
  6908. <figure>
  6909. <img src="images/upnqr.svg" title="fig:" class="i2d"
  6910. alt="zint -b UPNQR -i upn_utf8.txt --quietzones" />
  6911. <figcaption
  6912. aria-hidden="true"><code>zint -b UPNQR -i upn_utf8.txt --quietzones</code></figcaption>
  6913. </figure>
  6914. <p>A variation of QR Code used by Združenje Bank Slovenije (Bank
  6915. Association of Slovenia). The size, error correction level and ECI are
  6916. set by Zint and do not need to be specified. UPNQR is unusual in that it
  6917. uses Latin-2 (ISO/IEC 8859-2 plus ASCII) formatted data. Zint will
  6918. accept UTF-8 data and convert it to Latin-2, or if your data is already
  6919. Latin-2 formatted use the <code>--binary</code> switch (API
  6920. <code>input_mode = DATA_MODE</code>).</p>
  6921. <p>The following example creates a symbol from data saved as a Latin-2
  6922. file:</p>
  6923. <div class="sourceCode" id="cb114"><pre
  6924. class="sourceCode bash"><code class="sourceCode bash"><span id="cb114-1"><a href="#cb114-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> upnqr.png <span class="at">-b</span> 143 <span class="at">--scale</span><span class="op">=</span>3 <span class="at">--binary</span> <span class="at">-i</span> upn.txt</span></code></pre></div>
  6925. <p>A mask may be manually specified or the <code>--fast</code> option
  6926. used as with QRCODE.</p>
  6927. <h3 id="maxicode-iso-16023">6.6.7 MaxiCode (ISO 16023)</h3>
  6928. <figure>
  6929. <img src="images/maxicode.svg" title="fig:" class="i2d"
  6930. alt="zint -b MAXICODE -d &quot;1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E&quot; --esc --primary=&quot;152382802000000&quot; --scmvv=96" />
  6931. <figcaption
  6932. aria-hidden="true"><code>zint -b MAXICODE -d "1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E" --esc --primary="152382802000000" --scmvv=96</code></figcaption>
  6933. </figure>
  6934. <p>Developed by UPS the MaxiCode symbology employs a grid of hexagons
  6935. surrounding a bullseye finder pattern. This symbology is designed for
  6936. the identification of parcels. MaxiCode symbols can be encoded in one of
  6937. five modes. In modes 2 and 3 MaxiCode symbols are composed of two parts
  6938. named the primary and secondary messages. The primary message consists
  6939. of a Structured Carrier Message which includes various data about the
  6940. package being sent and the secondary message usually consists of address
  6941. data in a data structure. The format of the primary message required by
  6942. Zint is given in the following table.</p>
  6943. <div id="tbl:maxicode_scm" class="tablenos">
  6944. <table id="tbl:maxicode_scm"
  6945. data-tag=": MaxiCode Structured Carrier Message Format">
  6946. <caption><span>Table : MaxiCode Structured Carrier Message
  6947. Format:</span> </caption>
  6948. <thead>
  6949. <tr>
  6950. <th>Characters</th>
  6951. <th style="text-align: left;">Meaning</th>
  6952. </tr>
  6953. </thead>
  6954. <tbody>
  6955. <tr>
  6956. <td>1 - 9</td>
  6957. <td style="text-align: left;">Postcode data which can consist of up to 9
  6958. digits (for mode 2)</td>
  6959. </tr>
  6960. <tr>
  6961. <td></td>
  6962. <td style="text-align: left;">or up to 6 alphanumeric characters (for
  6963. mode 3). Remaining</td>
  6964. </tr>
  6965. <tr>
  6966. <td></td>
  6967. <td style="text-align: left;">unused characters for mode 3 can be filled
  6968. with the SPACE</td>
  6969. </tr>
  6970. <tr>
  6971. <td></td>
  6972. <td style="text-align: left;">character (ASCII 32) or omitted.</td>
  6973. </tr>
  6974. <tr>
  6975. <td></td>
  6976. <td style="text-align: left;">(adjust the following character positions
  6977. according to postcode</td>
  6978. </tr>
  6979. <tr>
  6980. <td></td>
  6981. <td style="text-align: left;">length)</td>
  6982. </tr>
  6983. <tr>
  6984. <td>10 - 12</td>
  6985. <td style="text-align: left;">Three-digit country code according to ISO
  6986. 3166-1.</td>
  6987. </tr>
  6988. <tr>
  6989. <td>13 - 15</td>
  6990. <td style="text-align: left;">Three-digit service code. This depends on
  6991. your parcel courier.</td>
  6992. </tr>
  6993. </tbody>
  6994. </table>
  6995. </div>
  6996. <p>The primary message can be set at the command prompt using the
  6997. <code>--primary</code> switch (API <code>primary</code>). The secondary
  6998. message uses the normal data entry method. For example:</p>
  6999. <div class="sourceCode" id="cb115"><pre
  7000. class="sourceCode bash"><code class="sourceCode bash"><span id="cb115-1"><a href="#cb115-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> test.eps <span class="at">-b</span> 57 <span class="at">--primary</span><span class="op">=</span><span class="st">&quot;999999999840012&quot;</span> <span class="dt">\</span></span>
  7001. <span id="cb115-2"><a href="#cb115-2" aria-hidden="true" tabindex="-1"></a> <span class="at">-d</span> <span class="st">&quot;Secondary Message Here&quot;</span></span></code></pre></div>
  7002. <p>When using the API the primary message must be placed in the
  7003. <code>primary</code> string. The secondary is entered in the same way as
  7004. described in <a href="#encoding-and-saving-to-file">5.2 Encoding and
  7005. Saving to File</a>. When either of these modes is selected Zint will
  7006. analyse the primary message and select either mode 2 or mode 3 as
  7007. appropriate.</p>
  7008. <p>As a convenience the secondary message for modes 2 and 3 can be set
  7009. to be prefixed by the ISO/IEC 15434 Format <code>"01"</code>
  7010. (transportation) sequence <code>"[)&gt;\R01\Gvv"</code>, where
  7011. <code>vv</code> is a 2-digit version, by using the <code>--scmvv</code>
  7012. switch (API <code>option_2 = vv + 1</code>). For example to use the
  7013. common version <code>"96"</code> (ASC MH10/SC 8):</p>
  7014. <div class="sourceCode" id="cb116"><pre
  7015. class="sourceCode bash"><code class="sourceCode bash"><span id="cb116-1"><a href="#cb116-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 57 <span class="at">--primary</span><span class="op">=</span><span class="st">&quot;152382802840001&quot;</span> <span class="at">--scmvv</span><span class="op">=</span>96 <span class="at">--esc</span> <span class="at">-d</span> <span class="dt">\</span></span>
  7016. <span id="cb116-2"><a href="#cb116-2" aria-hidden="true" tabindex="-1"></a> <span class="st">&quot;1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E&quot;</span></span></code></pre></div>
  7017. <p>will prefix <code>"[)&gt;\R01\G96"</code> to the secondary message.
  7018. (<code>\R</code>, <code>\G</code> and <code>\E</code> are the escape
  7019. sequences for Record Separator, Group Separator and End of Transmission
  7020. respectively - see Table <a href="#tbl:escape_sequences">: Escape
  7021. Sequences</a>.)</p>
  7022. <p>Modes 4 to 6 can be accessed using the <code>--mode</code> switch
  7023. (API <code>option_1</code>). Modes 4 to 6 do not have a primary message.
  7024. For example:</p>
  7025. <div class="sourceCode" id="cb117"><pre
  7026. class="sourceCode bash"><code class="sourceCode bash"><span id="cb117-1"><a href="#cb117-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> test.eps <span class="at">-b</span> 57 <span class="at">--mode</span><span class="op">=</span>4 <span class="at">-d</span> <span class="st">&quot;A MaxiCode Message in Mode 4&quot;</span></span></code></pre></div>
  7027. <p>Mode 6 is reserved for the maintenance of scanner hardware and should
  7028. not be used to encode user data.</p>
  7029. <p>This symbology uses Latin-1 character encoding by default but also
  7030. supports the ECI encoding mechanism. The maximum length of text which
  7031. can be placed in a MaxiCode symbol depends on the type of characters
  7032. used in the text.</p>
  7033. <p>Example maximum data lengths are given in the table below:</p>
  7034. <div id="tbl:maxicode_data_length_maxima" class="tablenos">
  7035. <table id="tbl:maxicode_data_length_maxima" style="width:100%;"
  7036. data-tag=": MaxiCode Data Length Maxima">
  7037. <caption><span>Table : MaxiCode Data Length Maxima</span> </caption>
  7038. <colgroup>
  7039. <col style="width: 9%" />
  7040. <col style="width: 30%" />
  7041. <col style="width: 30%" />
  7042. <col style="width: 30%" />
  7043. </colgroup>
  7044. <thead>
  7045. <tr>
  7046. <th>Mode</th>
  7047. <th>Maximum Data Length for Capital Letters</th>
  7048. <th style="text-align: left;">Maximum Data Length for Numeric
  7049. Digits</th>
  7050. <th style="text-align: left;">Number of Error Correction Codewords</th>
  7051. </tr>
  7052. </thead>
  7053. <tbody>
  7054. <tr>
  7055. <td>2<code>*</code></td>
  7056. <td>84</td>
  7057. <td style="text-align: left;">126</td>
  7058. <td style="text-align: left;">50</td>
  7059. </tr>
  7060. <tr>
  7061. <td>3<code>*</code></td>
  7062. <td>84</td>
  7063. <td style="text-align: left;">126</td>
  7064. <td style="text-align: left;">50</td>
  7065. </tr>
  7066. <tr>
  7067. <td>4</td>
  7068. <td>93</td>
  7069. <td style="text-align: left;">138</td>
  7070. <td style="text-align: left;">50</td>
  7071. </tr>
  7072. <tr>
  7073. <td>5</td>
  7074. <td>77</td>
  7075. <td style="text-align: left;">113</td>
  7076. <td style="text-align: left;">66</td>
  7077. </tr>
  7078. <tr>
  7079. <td>6</td>
  7080. <td>93</td>
  7081. <td style="text-align: left;">138</td>
  7082. <td style="text-align: left;">50</td>
  7083. </tr>
  7084. </tbody>
  7085. </table>
  7086. </div>
  7087. <p><code>*</code> - secondary only</p>
  7088. <p>MaxiCode supports Structured Append of up to 8 symbols, which can be
  7089. set by using the <code>--structapp</code> option (see <a
  7090. href="#structured-append">4.17 Structured Append</a>) (API
  7091. <code>structapp</code>). It does not support specifying an ID.</p>
  7092. <p>MaxiCode uses a different scaling than other symbols for raster
  7093. output, see <a href="#maxicode-raster-scaling">4.9.3 MaxiCode Raster
  7094. Scaling</a>, and also for EMF vector output, when the scale is
  7095. multiplied by 20 instead of 2.</p>
  7096. <h3 id="aztec-code-iso-24778">6.6.8 Aztec Code (ISO 24778)</h3>
  7097. <figure>
  7098. <img src="images/aztec.svg" title="fig:" class="i2d"
  7099. alt="zint -b AZTEC -d &quot;123456789012&quot;" />
  7100. <figcaption
  7101. aria-hidden="true"><code>zint -b AZTEC -d "123456789012"</code></figcaption>
  7102. </figure>
  7103. <p>Invented by Andrew Longacre at Welch Allyn Inc in 1995 the Aztec Code
  7104. symbol is a matrix symbol with a distinctive bullseye finder pattern.
  7105. Zint can generate Compact Aztec Code (sometimes called Small Aztec Code)
  7106. as well as ‘full-range’ Aztec Code symbols and by default will
  7107. automatically select symbol type and size dependent on the length of the
  7108. data to be encoded. Error correction codewords will normally be
  7109. generated to fill at least 23% of the symbol. Two options are available
  7110. to change this behaviour:</p>
  7111. <p>The size of the symbol can be specified using the <code>--vers</code>
  7112. option (API <code>option_2</code>) to a value between 1 and 36 according
  7113. to the following table. The symbols marked with an asterisk
  7114. (<code>*</code>) in the table below are ‘compact’ symbols, meaning they
  7115. have a smaller bullseye pattern at the centre of the symbol.</p>
  7116. <div id="tbl:aztec_sizes" class="tablenos">
  7117. <table id="tbl:aztec_sizes" data-tag=": Aztec Code Sizes">
  7118. <caption><span>Table : Aztec Code Sizes</span> </caption>
  7119. <thead>
  7120. <tr>
  7121. <th>Input</th>
  7122. <th>Symbol Size</th>
  7123. <th></th>
  7124. <th>Input</th>
  7125. <th>Symbol Size</th>
  7126. <th></th>
  7127. <th>Input</th>
  7128. <th>Symbol Size</th>
  7129. </tr>
  7130. </thead>
  7131. <tbody>
  7132. <tr>
  7133. <td>1</td>
  7134. <td>15 x 15<code>*</code></td>
  7135. <td></td>
  7136. <td>13</td>
  7137. <td>53 x 53</td>
  7138. <td></td>
  7139. <td>25</td>
  7140. <td>105 x 105</td>
  7141. </tr>
  7142. <tr>
  7143. <td>2</td>
  7144. <td>19 x 19<code>*</code></td>
  7145. <td></td>
  7146. <td>14</td>
  7147. <td>57 x 57</td>
  7148. <td></td>
  7149. <td>26</td>
  7150. <td>109 x 109</td>
  7151. </tr>
  7152. <tr>
  7153. <td>3</td>
  7154. <td>23 x 23<code>*</code></td>
  7155. <td></td>
  7156. <td>15</td>
  7157. <td>61 x 61</td>
  7158. <td></td>
  7159. <td>27</td>
  7160. <td>113 x 113</td>
  7161. </tr>
  7162. <tr>
  7163. <td>4</td>
  7164. <td>27 x 27<code>*</code></td>
  7165. <td></td>
  7166. <td>16</td>
  7167. <td>67 x 67</td>
  7168. <td></td>
  7169. <td>28</td>
  7170. <td>117 x 117</td>
  7171. </tr>
  7172. <tr>
  7173. <td>5</td>
  7174. <td>19 x 19</td>
  7175. <td></td>
  7176. <td>17</td>
  7177. <td>71 x 71</td>
  7178. <td></td>
  7179. <td>29</td>
  7180. <td>121 x 121</td>
  7181. </tr>
  7182. <tr>
  7183. <td>6</td>
  7184. <td>23 x 23</td>
  7185. <td></td>
  7186. <td>18</td>
  7187. <td>75 x 75</td>
  7188. <td></td>
  7189. <td>30</td>
  7190. <td>125 x 125</td>
  7191. </tr>
  7192. <tr>
  7193. <td>7</td>
  7194. <td>27 x 27</td>
  7195. <td></td>
  7196. <td>19</td>
  7197. <td>79 x 79</td>
  7198. <td></td>
  7199. <td>31</td>
  7200. <td>131 x 131</td>
  7201. </tr>
  7202. <tr>
  7203. <td>8</td>
  7204. <td>31 x 31</td>
  7205. <td></td>
  7206. <td>20</td>
  7207. <td>83 x 83</td>
  7208. <td></td>
  7209. <td>32</td>
  7210. <td>135 x 135</td>
  7211. </tr>
  7212. <tr>
  7213. <td>9</td>
  7214. <td>37 x 37</td>
  7215. <td></td>
  7216. <td>21</td>
  7217. <td>87 x 87</td>
  7218. <td></td>
  7219. <td>33</td>
  7220. <td>139 x 139</td>
  7221. </tr>
  7222. <tr>
  7223. <td>10</td>
  7224. <td>41 x 41</td>
  7225. <td></td>
  7226. <td>22</td>
  7227. <td>91 x 91</td>
  7228. <td></td>
  7229. <td>34</td>
  7230. <td>143 x 143</td>
  7231. </tr>
  7232. <tr>
  7233. <td>11</td>
  7234. <td>45 x 45</td>
  7235. <td></td>
  7236. <td>23</td>
  7237. <td>95 x 95</td>
  7238. <td></td>
  7239. <td>35</td>
  7240. <td>147 x 147</td>
  7241. </tr>
  7242. <tr>
  7243. <td>12</td>
  7244. <td>49 x 49</td>
  7245. <td></td>
  7246. <td>24</td>
  7247. <td>101 x 101</td>
  7248. <td></td>
  7249. <td>36</td>
  7250. <td>151 x 151</td>
  7251. </tr>
  7252. </tbody>
  7253. </table>
  7254. </div>
  7255. <p>Note that in symbols which have a specified size the amount of error
  7256. correction is dependent on the length of the data input and Zint will
  7257. allow error correction capacities as low as 3 codewords.</p>
  7258. <p>Alternatively the amount of error correction data can be specified by
  7259. setting the <code>--secure</code> option (API <code>option_1</code>) to
  7260. a value from the following table.</p>
  7261. <div id="tbl:aztec_eccs" class="tablenos">
  7262. <table id="tbl:aztec_eccs"
  7263. data-tag=": Aztec Code Error Correction Modes">
  7264. <caption><span>Table : Aztec Code Error Correction Modes</span>
  7265. </caption>
  7266. <thead>
  7267. <tr>
  7268. <th>Mode</th>
  7269. <th>Error Correction Capacity</th>
  7270. </tr>
  7271. </thead>
  7272. <tbody>
  7273. <tr>
  7274. <td>1</td>
  7275. <td>&gt;10% + 3 codewords</td>
  7276. </tr>
  7277. <tr>
  7278. <td>2</td>
  7279. <td>&gt;23% + 3 codewords</td>
  7280. </tr>
  7281. <tr>
  7282. <td>3</td>
  7283. <td>&gt;36% + 3 codewords</td>
  7284. </tr>
  7285. <tr>
  7286. <td>4</td>
  7287. <td>&gt;50% + 3 codewords</td>
  7288. </tr>
  7289. </tbody>
  7290. </table>
  7291. </div>
  7292. <p>It is not possible to select both symbol size and error correction
  7293. capacity for the same symbol. If both options are selected then the
  7294. error correction capacity selection will be ignored.</p>
  7295. <p>Aztec Code supports ECI encoding and can encode up to a maximum
  7296. length of approximately 3823 numeric or 3067 alphabetic characters or
  7297. 1914 bytes of data. A separate symbology ID
  7298. (<code>BARCODE_HIBC_AZTEC</code>) can be used to encode Health Industry
  7299. Barcode (HIBC) data.</p>
  7300. <p>Aztec Code supports Structured Append of up to 26 symbols and an
  7301. optional alphanumeric ID of up to 32 characters, which can be set by
  7302. using the <code>--structapp</code> option (see <a
  7303. href="#structured-append">4.17 Structured Append</a>) (API
  7304. <code>structapp</code>). The ID cannot contain spaces. If an ID is not
  7305. given, no ID is encoded.</p>
  7306. <h3 id="aztec-runes-iso-24778">6.6.9 Aztec Runes (ISO 24778)</h3>
  7307. <figure>
  7308. <img src="images/azrune.svg" title="fig:" class="i2d"
  7309. alt="zint -b AZRUNE -d &quot;125&quot;" />
  7310. <figcaption
  7311. aria-hidden="true"><code>zint -b AZRUNE -d "125"</code></figcaption>
  7312. </figure>
  7313. <p>A truncated version of compact Aztec Code for encoding whole integers
  7314. between 0 and 255, as defined in ISO/IEC 24778 Annex A. Includes
  7315. Reed-Solomon error correction. It does not support Structured
  7316. Append.</p>
  7317. <h3 id="code-one">6.6.10 Code One</h3>
  7318. <figure>
  7319. <img src="images/codeone.svg" title="fig:" class="i2d"
  7320. alt="zint -b CODEONE -d &quot;1234567890123456789012&quot;" />
  7321. <figcaption
  7322. aria-hidden="true"><code>zint -b CODEONE -d "1234567890123456789012"</code></figcaption>
  7323. </figure>
  7324. <p>A matrix symbology developed by Ted Williams in 1992 which encodes
  7325. data in a way similar to Data Matrix, Code One is able to encode the
  7326. Latin-1 character set or GS1 data, and also supports the ECI mechanism.
  7327. There are two types of Code One symbol - fixed-ratio symbols which are
  7328. roughly square (versions A through to H) and variable-width versions
  7329. (versions S and T). These can be selected by using <code>--vers</code>
  7330. (API <code>option_2</code>) as shown in the table below:</p>
  7331. <div id="tbl:codeone_sizes" class="tablenos">
  7332. <table id="tbl:codeone_sizes" style="width:88%;"
  7333. data-tag=": Code One Sizes">
  7334. <caption><span>Table : Code One Sizes</span> </caption>
  7335. <colgroup>
  7336. <col style="width: 11%" />
  7337. <col style="width: 13%" />
  7338. <col style="width: 18%" />
  7339. <col style="width: 22%" />
  7340. <col style="width: 22%" />
  7341. </colgroup>
  7342. <thead>
  7343. <tr>
  7344. <th>Input</th>
  7345. <th>Version</th>
  7346. <th style="text-align: left;">Size (W x H)</th>
  7347. <th style="text-align: left;">Numeric Data Capacity</th>
  7348. <th style="text-align: left;">Alphanumeric Data Capacity</th>
  7349. </tr>
  7350. </thead>
  7351. <tbody>
  7352. <tr>
  7353. <td>1</td>
  7354. <td>A</td>
  7355. <td style="text-align: left;">16 x 18</td>
  7356. <td style="text-align: left;">22</td>
  7357. <td style="text-align: left;">13</td>
  7358. </tr>
  7359. <tr>
  7360. <td>2</td>
  7361. <td>B</td>
  7362. <td style="text-align: left;">22 x 22</td>
  7363. <td style="text-align: left;">44</td>
  7364. <td style="text-align: left;">27</td>
  7365. </tr>
  7366. <tr>
  7367. <td>3</td>
  7368. <td>C</td>
  7369. <td style="text-align: left;">28 x 28</td>
  7370. <td style="text-align: left;">104</td>
  7371. <td style="text-align: left;">64</td>
  7372. </tr>
  7373. <tr>
  7374. <td>4</td>
  7375. <td>D</td>
  7376. <td style="text-align: left;">40 x 42</td>
  7377. <td style="text-align: left;">217</td>
  7378. <td style="text-align: left;">135</td>
  7379. </tr>
  7380. <tr>
  7381. <td>5</td>
  7382. <td>E</td>
  7383. <td style="text-align: left;">52 x 54</td>
  7384. <td style="text-align: left;">435</td>
  7385. <td style="text-align: left;">271</td>
  7386. </tr>
  7387. <tr>
  7388. <td>6</td>
  7389. <td>F</td>
  7390. <td style="text-align: left;">70 x 76</td>
  7391. <td style="text-align: left;">886</td>
  7392. <td style="text-align: left;">553</td>
  7393. </tr>
  7394. <tr>
  7395. <td>7</td>
  7396. <td>G</td>
  7397. <td style="text-align: left;">104 x 98</td>
  7398. <td style="text-align: left;">1755</td>
  7399. <td style="text-align: left;">1096</td>
  7400. </tr>
  7401. <tr>
  7402. <td>8</td>
  7403. <td>H</td>
  7404. <td style="text-align: left;">148 x 134</td>
  7405. <td style="text-align: left;">3550</td>
  7406. <td style="text-align: left;">2218</td>
  7407. </tr>
  7408. <tr>
  7409. <td>9</td>
  7410. <td>S</td>
  7411. <td style="text-align: left;">width x 8</td>
  7412. <td style="text-align: left;">18</td>
  7413. <td style="text-align: left;">N/A</td>
  7414. </tr>
  7415. <tr>
  7416. <td>10</td>
  7417. <td>T</td>
  7418. <td style="text-align: left;">width x 16</td>
  7419. <td style="text-align: left;">90</td>
  7420. <td style="text-align: left;">55</td>
  7421. </tr>
  7422. </tbody>
  7423. </table>
  7424. </div>
  7425. <p>Version S symbols can only encode numeric data. The width of version
  7426. S and version T symbols is determined by the length of the input
  7427. data.</p>
  7428. <p>Code One supports Structured Append of up to 128 symbols, which can
  7429. be set by using the <code>--structapp</code> option (see <a
  7430. href="#structured-append">4.17 Structured Append</a>) (API
  7431. <code>structapp</code>). It does not support specifying an ID.
  7432. Structured Append is not supported with GS1 data nor for Version S
  7433. symbols.</p>
  7434. <h3 id="grid-matrix">6.6.11 Grid Matrix</h3>
  7435. <figure>
  7436. <img src="images/gridmatrix.svg" title="fig:" class="i2d"
  7437. alt="zint -b GRIDMATRIX --eci=29 -d &quot;AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738&quot;" />
  7438. <figcaption
  7439. aria-hidden="true"><code>zint -b GRIDMATRIX --eci=29 -d "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738"</code></figcaption>
  7440. </figure>
  7441. <p>Grid Matrix groups modules in a chequerboard pattern, and by default
  7442. supports the GB 2312 standard set, which includes Hanzi, ASCII and a
  7443. small number of ISO/IEC 8859-1 characters. Input should be entered as
  7444. UTF-8 with conversion to GB 2312 being carried out automatically by
  7445. Zint. Up to around 1529 alphanumeric characters or 2751 digits may be
  7446. encoded. The symbology also supports the ECI mechanism. Support for GS1
  7447. data has not yet been implemented.</p>
  7448. <p>The size of the symbol and the error correction capacity can be
  7449. specified. If you specify both of these values then Zint will make a
  7450. ‘best-fit’ attempt to satisfy both conditions. The symbol size can be
  7451. specified using the <code>--vers</code> option (API
  7452. <code>option_2</code>), and the error correction capacity can be
  7453. specified by using the <code>--secure</code> option (API
  7454. <code>option_1</code>), according to the following tables.</p>
  7455. <div id="tbl:gridmatrix_sizes" class="tablenos">
  7456. <table id="tbl:gridmatrix_sizes" data-tag=": Grid Matrix Sizes">
  7457. <caption><span>Table : Grid Matrix Sizes</span> </caption>
  7458. <thead>
  7459. <tr>
  7460. <th>Input</th>
  7461. <th>Symbol Size</th>
  7462. <th></th>
  7463. <th>Input</th>
  7464. <th>Symbol Size</th>
  7465. </tr>
  7466. </thead>
  7467. <tbody>
  7468. <tr>
  7469. <td>1</td>
  7470. <td>18 x 18</td>
  7471. <td></td>
  7472. <td>8</td>
  7473. <td>102 x 102</td>
  7474. </tr>
  7475. <tr>
  7476. <td>2</td>
  7477. <td>30 x 30</td>
  7478. <td></td>
  7479. <td>9</td>
  7480. <td>114 x 114</td>
  7481. </tr>
  7482. <tr>
  7483. <td>3</td>
  7484. <td>42 x 42</td>
  7485. <td></td>
  7486. <td>10</td>
  7487. <td>126 x 126</td>
  7488. </tr>
  7489. <tr>
  7490. <td>4</td>
  7491. <td>54 x 54</td>
  7492. <td></td>
  7493. <td>11</td>
  7494. <td>138 x 138</td>
  7495. </tr>
  7496. <tr>
  7497. <td>5</td>
  7498. <td>66 x 66</td>
  7499. <td></td>
  7500. <td>12</td>
  7501. <td>150 x 150</td>
  7502. </tr>
  7503. <tr>
  7504. <td>6</td>
  7505. <td>78 x 78</td>
  7506. <td></td>
  7507. <td>13</td>
  7508. <td>162 x 162</td>
  7509. </tr>
  7510. <tr>
  7511. <td>7</td>
  7512. <td>90 x 90</td>
  7513. <td></td>
  7514. <td></td>
  7515. <td></td>
  7516. </tr>
  7517. </tbody>
  7518. </table>
  7519. </div>
  7520. <div id="tbl:gridmatrix_eccs" class="tablenos">
  7521. <table id="tbl:gridmatrix_eccs"
  7522. data-tag=": Grid Matrix Error Correction Modes">
  7523. <caption><span>Table : Grid Matrix Error Correction Modes</span>
  7524. </caption>
  7525. <thead>
  7526. <tr>
  7527. <th>Mode</th>
  7528. <th>Error Correction Capacity</th>
  7529. </tr>
  7530. </thead>
  7531. <tbody>
  7532. <tr>
  7533. <td>1</td>
  7534. <td>Approximately 10%</td>
  7535. </tr>
  7536. <tr>
  7537. <td>2</td>
  7538. <td>Approximately 20%</td>
  7539. </tr>
  7540. <tr>
  7541. <td>3</td>
  7542. <td>Approximately 30%</td>
  7543. </tr>
  7544. <tr>
  7545. <td>4</td>
  7546. <td>Approximately 40%</td>
  7547. </tr>
  7548. <tr>
  7549. <td>5</td>
  7550. <td>Approximately 50%</td>
  7551. </tr>
  7552. </tbody>
  7553. </table>
  7554. </div>
  7555. <p>Non-ASCII data density may be maximized by using the
  7556. <code>--fullmultibyte</code> switch (API
  7557. <code>option_3 = ZINT_FULL_MULTIBYTE</code>), but check that your
  7558. barcode reader supports this before using.</p>
  7559. <p>Grid Matrix supports Structured Append of up to 16 symbols and a
  7560. numeric ID (file signature), which can be set by using the
  7561. <code>--structapp</code> option (see <a href="#structured-append">4.17
  7562. Structured Append</a>) (API <code>structapp</code>). The ID ranges from
  7563. 0 (default) to 255.</p>
  7564. <h3 id="dotcode">6.6.12 DotCode</h3>
  7565. <figure>
  7566. <img src="images/dotcode.svg" title="fig:" class="i2d"
  7567. alt="zint -b DOTCODE -d &quot;[01]00012345678905[17]201231[10]ABC123456&quot; --gs1" />
  7568. <figcaption
  7569. aria-hidden="true"><code>zint -b DOTCODE -d "[01]00012345678905[17]201231[10]ABC123456" --gs1</code></figcaption>
  7570. </figure>
  7571. <p>DotCode uses a grid of dots in a rectangular formation to encode
  7572. characters up to a maximum of approximately 450 characters (or 900
  7573. numeric digits). The symbology supports ECI encoding and GS1 data
  7574. encoding. By default Zint will produce a symbol which is approximately
  7575. square, however the width of the symbol can be adjusted by using the
  7576. <code>--cols</code> option (API <code>option_2</code>) (maximum 200).
  7577. Outputting DotCode to raster images (BMP, GIF, PCX, PNG, TIF) will
  7578. require setting the scale of the image to a larger value than the
  7579. default (e.g. approximately 10) for the dots to be plotted correctly.
  7580. Approximately 33% of the resulting symbol is comprised of error
  7581. correction codewords.</p>
  7582. <p>DotCode has two sets of 4 masks, designated 0-3 and 0’-3’, the second
  7583. <code>"prime"</code> set being the same as the first with corners lit.
  7584. The best mask to use is selected automatically by Zint but may be
  7585. manually specified by using the <code>--mask</code> switch with values
  7586. 0-7, where 4-7 denote 0’-3’, or in the API by setting
  7587. <code>option_3 = (N + 1) &lt;&lt; 8</code> where N is 0-7.</p>
  7588. <p>DotCode supports Structured Append of up to 35 symbols, which can be
  7589. set by using the <code>--structapp</code> option (see <a
  7590. href="#structured-append">4.17 Structured Append</a>) (API
  7591. <code>structapp</code>). It does not support specifying an ID.</p>
  7592. <h3 id="han-xin-code-iso-20830">6.6.13 Han Xin Code (ISO 20830)</h3>
  7593. <figure>
  7594. <img src="images/hanxin.svg" title="fig:" class="i2d"
  7595. alt="zint -b HANXIN -d &quot;Hanxin Code symbol&quot;" />
  7596. <figcaption
  7597. aria-hidden="true"><code>zint -b HANXIN -d "Hanxin Code symbol"</code></figcaption>
  7598. </figure>
  7599. <p>Also known as Chinese Sensible Code, Han Xin is capable of encoding
  7600. characters in either the Latin-1 character set or the GB 18030 character
  7601. set (which is a UTF, i.e. includes all Unicode characters, optimized for
  7602. Chinese characters) and is also able to support the ECI mechanism.
  7603. Support for the encoding of GS1 data has not yet been implemented.</p>
  7604. <p>The size of the symbol can be specified using the <code>--vers</code>
  7605. option (API <code>option_2</code>) to a value between 1 and 84 according
  7606. to the following table.</p>
  7607. <div id="tbl:hanxin_sizes" class="tablenos">
  7608. <table id="tbl:hanxin_sizes" data-tag=": Han Xin Sizes">
  7609. <caption><span>Table : Han Xin Sizes</span> </caption>
  7610. <thead>
  7611. <tr>
  7612. <th>Input</th>
  7613. <th>Symbol Size</th>
  7614. <th></th>
  7615. <th>Input</th>
  7616. <th>Symbol Size</th>
  7617. <th></th>
  7618. <th>Input</th>
  7619. <th>Symbol Size</th>
  7620. </tr>
  7621. </thead>
  7622. <tbody>
  7623. <tr>
  7624. <td>1</td>
  7625. <td>23 x 23</td>
  7626. <td></td>
  7627. <td>29</td>
  7628. <td>79 x 79</td>
  7629. <td></td>
  7630. <td>57</td>
  7631. <td>135 x 135</td>
  7632. </tr>
  7633. <tr>
  7634. <td>2</td>
  7635. <td>25 x 25</td>
  7636. <td></td>
  7637. <td>30</td>
  7638. <td>81 x 81</td>
  7639. <td></td>
  7640. <td>58</td>
  7641. <td>137 x 137</td>
  7642. </tr>
  7643. <tr>
  7644. <td>3</td>
  7645. <td>27 x 27</td>
  7646. <td></td>
  7647. <td>31</td>
  7648. <td>83 x 83</td>
  7649. <td></td>
  7650. <td>59</td>
  7651. <td>139 x 139</td>
  7652. </tr>
  7653. <tr>
  7654. <td>4</td>
  7655. <td>29 x 29</td>
  7656. <td></td>
  7657. <td>32</td>
  7658. <td>85 x 85</td>
  7659. <td></td>
  7660. <td>60</td>
  7661. <td>141 x 141</td>
  7662. </tr>
  7663. <tr>
  7664. <td>5</td>
  7665. <td>31 x 31</td>
  7666. <td></td>
  7667. <td>33</td>
  7668. <td>87 x 87</td>
  7669. <td></td>
  7670. <td>61</td>
  7671. <td>143 x 143</td>
  7672. </tr>
  7673. <tr>
  7674. <td>6</td>
  7675. <td>33 x 33</td>
  7676. <td></td>
  7677. <td>34</td>
  7678. <td>89 x 89</td>
  7679. <td></td>
  7680. <td>62</td>
  7681. <td>145 x 145</td>
  7682. </tr>
  7683. <tr>
  7684. <td>7</td>
  7685. <td>35 x 35</td>
  7686. <td></td>
  7687. <td>35</td>
  7688. <td>91 x 91</td>
  7689. <td></td>
  7690. <td>63</td>
  7691. <td>147 x 147</td>
  7692. </tr>
  7693. <tr>
  7694. <td>8</td>
  7695. <td>37 x 37</td>
  7696. <td></td>
  7697. <td>36</td>
  7698. <td>93 x 93</td>
  7699. <td></td>
  7700. <td>64</td>
  7701. <td>149 x 149</td>
  7702. </tr>
  7703. <tr>
  7704. <td>9</td>
  7705. <td>39 x 39</td>
  7706. <td></td>
  7707. <td>37</td>
  7708. <td>95 x 95</td>
  7709. <td></td>
  7710. <td>65</td>
  7711. <td>151 x 151</td>
  7712. </tr>
  7713. <tr>
  7714. <td>10</td>
  7715. <td>41 x 41</td>
  7716. <td></td>
  7717. <td>38</td>
  7718. <td>97 x 97</td>
  7719. <td></td>
  7720. <td>66</td>
  7721. <td>153 x 153</td>
  7722. </tr>
  7723. <tr>
  7724. <td>11</td>
  7725. <td>43 x 43</td>
  7726. <td></td>
  7727. <td>39</td>
  7728. <td>99 x 99</td>
  7729. <td></td>
  7730. <td>67</td>
  7731. <td>155 x 155</td>
  7732. </tr>
  7733. <tr>
  7734. <td>12</td>
  7735. <td>45 x 45</td>
  7736. <td></td>
  7737. <td>40</td>
  7738. <td>101 x 101</td>
  7739. <td></td>
  7740. <td>68</td>
  7741. <td>157 x 157</td>
  7742. </tr>
  7743. <tr>
  7744. <td>13</td>
  7745. <td>47 x 47</td>
  7746. <td></td>
  7747. <td>41</td>
  7748. <td>103 x 103</td>
  7749. <td></td>
  7750. <td>69</td>
  7751. <td>159 x 159</td>
  7752. </tr>
  7753. <tr>
  7754. <td>14</td>
  7755. <td>49 x 49</td>
  7756. <td></td>
  7757. <td>42</td>
  7758. <td>105 x 105</td>
  7759. <td></td>
  7760. <td>70</td>
  7761. <td>161 x 161</td>
  7762. </tr>
  7763. <tr>
  7764. <td>15</td>
  7765. <td>51 x 51</td>
  7766. <td></td>
  7767. <td>43</td>
  7768. <td>107 x 107</td>
  7769. <td></td>
  7770. <td>71</td>
  7771. <td>163 x 163</td>
  7772. </tr>
  7773. <tr>
  7774. <td>16</td>
  7775. <td>53 x 53</td>
  7776. <td></td>
  7777. <td>44</td>
  7778. <td>109 x 109</td>
  7779. <td></td>
  7780. <td>72</td>
  7781. <td>165 x 165</td>
  7782. </tr>
  7783. <tr>
  7784. <td>17</td>
  7785. <td>55 x 55</td>
  7786. <td></td>
  7787. <td>45</td>
  7788. <td>111 x 111</td>
  7789. <td></td>
  7790. <td>73</td>
  7791. <td>167 x 167</td>
  7792. </tr>
  7793. <tr>
  7794. <td>18</td>
  7795. <td>57 x 57</td>
  7796. <td></td>
  7797. <td>46</td>
  7798. <td>113 x 113</td>
  7799. <td></td>
  7800. <td>74</td>
  7801. <td>169 x 169</td>
  7802. </tr>
  7803. <tr>
  7804. <td>19</td>
  7805. <td>59 x 59</td>
  7806. <td></td>
  7807. <td>47</td>
  7808. <td>115 x 115</td>
  7809. <td></td>
  7810. <td>75</td>
  7811. <td>171 x 171</td>
  7812. </tr>
  7813. <tr>
  7814. <td>20</td>
  7815. <td>61 x 61</td>
  7816. <td></td>
  7817. <td>48</td>
  7818. <td>117 x 117</td>
  7819. <td></td>
  7820. <td>76</td>
  7821. <td>173 x 173</td>
  7822. </tr>
  7823. <tr>
  7824. <td>21</td>
  7825. <td>63 x 63</td>
  7826. <td></td>
  7827. <td>49</td>
  7828. <td>119 x 119</td>
  7829. <td></td>
  7830. <td>77</td>
  7831. <td>175 x 175</td>
  7832. </tr>
  7833. <tr>
  7834. <td>22</td>
  7835. <td>65 x 65</td>
  7836. <td></td>
  7837. <td>50</td>
  7838. <td>121 x 121</td>
  7839. <td></td>
  7840. <td>78</td>
  7841. <td>177 x 177</td>
  7842. </tr>
  7843. <tr>
  7844. <td>23</td>
  7845. <td>67 x 67</td>
  7846. <td></td>
  7847. <td>51</td>
  7848. <td>123 x 123</td>
  7849. <td></td>
  7850. <td>79</td>
  7851. <td>179 x 179</td>
  7852. </tr>
  7853. <tr>
  7854. <td>24</td>
  7855. <td>69 x 69</td>
  7856. <td></td>
  7857. <td>52</td>
  7858. <td>125 x 125</td>
  7859. <td></td>
  7860. <td>80</td>
  7861. <td>181 x 181</td>
  7862. </tr>
  7863. <tr>
  7864. <td>25</td>
  7865. <td>71 x 71</td>
  7866. <td></td>
  7867. <td>53</td>
  7868. <td>127 x 127</td>
  7869. <td></td>
  7870. <td>81</td>
  7871. <td>183 x 183</td>
  7872. </tr>
  7873. <tr>
  7874. <td>26</td>
  7875. <td>73 x 73</td>
  7876. <td></td>
  7877. <td>54</td>
  7878. <td>129 x 129</td>
  7879. <td></td>
  7880. <td>82</td>
  7881. <td>185 x 185</td>
  7882. </tr>
  7883. <tr>
  7884. <td>27</td>
  7885. <td>75 x 75</td>
  7886. <td></td>
  7887. <td>55</td>
  7888. <td>131 x 131</td>
  7889. <td></td>
  7890. <td>83</td>
  7891. <td>187 x 187</td>
  7892. </tr>
  7893. <tr>
  7894. <td>28</td>
  7895. <td>77 x 77</td>
  7896. <td></td>
  7897. <td>56</td>
  7898. <td>133 x 133</td>
  7899. <td></td>
  7900. <td>84</td>
  7901. <td>189 x 189</td>
  7902. </tr>
  7903. </tbody>
  7904. </table>
  7905. </div>
  7906. <p>The largest version (84) can encode 7827 digits, 4350 ASCII
  7907. characters, up to 2175 Chinese characters, or 3261 bytes, making it the
  7908. most capacious of all the barcodes supported by Zint.</p>
  7909. <p>There are four levels of error correction capacity available for Han
  7910. Xin Code which can be set by using the <code>--secure</code> option (API
  7911. <code>option_1</code>) to a value from the following table.</p>
  7912. <div id="tbl:hanxin_eccs" class="tablenos">
  7913. <table id="tbl:hanxin_eccs" data-tag=": Han Xin Error Correction Modes">
  7914. <caption><span>Table : Han Xin Error Correction Modes</span> </caption>
  7915. <thead>
  7916. <tr>
  7917. <th>Mode</th>
  7918. <th>Recovery Capacity</th>
  7919. </tr>
  7920. </thead>
  7921. <tbody>
  7922. <tr>
  7923. <td>1</td>
  7924. <td>Approx 8%</td>
  7925. </tr>
  7926. <tr>
  7927. <td>2</td>
  7928. <td>Approx 15%</td>
  7929. </tr>
  7930. <tr>
  7931. <td>3</td>
  7932. <td>Approx 23%</td>
  7933. </tr>
  7934. <tr>
  7935. <td>4</td>
  7936. <td>Approx 30%</td>
  7937. </tr>
  7938. </tbody>
  7939. </table>
  7940. </div>
  7941. <p>Non-ASCII data density may be maximized by using the
  7942. <code>--fullmultibyte</code> switch (API
  7943. <code>option_3 = ZINT_FULL_MULTIBYTE</code>), but check that your
  7944. barcode reader supports this before using.</p>
  7945. <p>Han Xin has four different masks designed to minimize unwanted
  7946. patterns. The best mask to use is selected automatically by Zint but may
  7947. be manually specified by using the <code>--mask</code> switch with
  7948. values 0-3, or in the API by setting
  7949. <code>option_3 = (N + 1) &lt;&lt; 8</code> where N is 0-3. To use with
  7950. <code>ZINT_FULL_MULTIBYTE</code> set</p>
  7951. <div class="sourceCode" id="cb118"><pre
  7952. class="sourceCode c"><code class="sourceCode c"><span id="cb118-1"><a href="#cb118-1" aria-hidden="true" tabindex="-1"></a>option_3 <span class="op">=</span> ZINT_FULL_MULTIBYTE <span class="op">|</span> <span class="op">(</span>N <span class="op">+</span> <span class="dv">1</span><span class="op">)</span> <span class="op">&lt;&lt;</span> <span class="dv">8</span></span></code></pre></div>
  7953. <h3 id="ultracode">6.6.14 Ultracode</h3>
  7954. <figure>
  7955. <img src="images/ultra.svg" title="fig:" class="ultra"
  7956. alt="zint -b ULTRA -d &quot;HEIMASÍÐA KENNARAHÁSKÓLA ÍSLANDS&quot;" />
  7957. <figcaption
  7958. aria-hidden="true"><code>zint -b ULTRA -d "HEIMASÍÐA KENNARAHÁSKÓLA ÍSLANDS"</code></figcaption>
  7959. </figure>
  7960. <p>This symbology uses a grid of coloured elements to encode data. ECI
  7961. and GS1 modes are supported. The amount of error correction can be set
  7962. using the <code>--secure</code> option (API <code>option_1</code>) to a
  7963. value as shown in the following table.</p>
  7964. <div id="tbl:ultra_eccs" class="tablenos">
  7965. <table id="tbl:ultra_eccs"
  7966. data-tag=": Ultracode Error Correction Values">
  7967. <caption><span>Table : Ultracode Error Correction Values</span>
  7968. </caption>
  7969. <thead>
  7970. <tr>
  7971. <th>Value</th>
  7972. <th>EC Level</th>
  7973. <th>Amount of symbol holding error correction data</th>
  7974. </tr>
  7975. </thead>
  7976. <tbody>
  7977. <tr>
  7978. <td>1</td>
  7979. <td>EC0</td>
  7980. <td>0% - Error detection only</td>
  7981. </tr>
  7982. <tr>
  7983. <td>2</td>
  7984. <td>EC1</td>
  7985. <td>Approx 5%</td>
  7986. </tr>
  7987. <tr>
  7988. <td>3</td>
  7989. <td>EC2</td>
  7990. <td>Approx 9% - Default value</td>
  7991. </tr>
  7992. <tr>
  7993. <td>4</td>
  7994. <td>EC3</td>
  7995. <td>Approx 17%</td>
  7996. </tr>
  7997. <tr>
  7998. <td>5</td>
  7999. <td>EC4</td>
  8000. <td>Approx 25%</td>
  8001. </tr>
  8002. <tr>
  8003. <td>6</td>
  8004. <td>EC5</td>
  8005. <td>Approx 33%</td>
  8006. </tr>
  8007. </tbody>
  8008. </table>
  8009. </div>
  8010. <p>Zint does not currently implement data compression by default, but
  8011. this can be initiated through the API by setting</p>
  8012. <div class="sourceCode" id="cb119"><pre
  8013. class="sourceCode c"><code class="sourceCode c"><span id="cb119-1"><a href="#cb119-1" aria-hidden="true" tabindex="-1"></a>symbol<span class="op">-&gt;</span>option_3 <span class="op">=</span> ULTRA_COMPRESSION<span class="op">;</span></span></code></pre></div>
  8014. <p>With compression, up to 504 digits, 375 alphanumerics or 252 bytes
  8015. can be encoded.</p>
  8016. <p>Revision 2 of Ultracode (2023) may be specified using
  8017. <code>--vers=2</code> (API <code>option_2 = 2</code>).</p>
  8018. <hr />
  8019. <p>WARNING: Revision 2 of Ultracode was only finalized December 2023 and
  8020. Zint has not yet been updated to support it. Do not use.</p>
  8021. <hr />
  8022. <p>Ultracode supports Structured Append of up to 8 symbols and an
  8023. optional numeric ID (File Number), which can be set by using the
  8024. <code>--structapp</code> option (see <a href="#structured-append">4.17
  8025. Structured Append</a>) (API <code>structapp</code>). The ID ranges from
  8026. 1 to 80088. If an ID is not given, no ID is encoded.</p>
  8027. <h2 id="other-barcode-like-markings">6.7 Other Barcode-Like
  8028. Markings</h2>
  8029. <h3 id="facing-identification-mark-fim">6.7.1 Facing Identification Mark
  8030. (FIM)</h3>
  8031. <figure>
  8032. <img src="images/fim.svg" title="fig:" class="trk"
  8033. alt="zint -b FIM --compliantheight -d &quot;C&quot;" />
  8034. <figcaption
  8035. aria-hidden="true"><code>zint -b FIM --compliantheight -d "C"</code></figcaption>
  8036. </figure>
  8037. <p>Used by the United States Postal Service (USPS), the FIM symbology is
  8038. used to assist automated mail processing. There are only 5 valid symbols
  8039. which can be generated using the characters A-E as shown in the table
  8040. below.</p>
  8041. <div id="tbl:fim_characters" class="tablenos">
  8042. <table id="tbl:fim_characters" data-tag=": Valid FIM Characters">
  8043. <caption><span>Table : Valid FIM Characters</span> </caption>
  8044. <thead>
  8045. <tr>
  8046. <th>Code Letter</th>
  8047. <th style="text-align: left;">Usage</th>
  8048. </tr>
  8049. </thead>
  8050. <tbody>
  8051. <tr>
  8052. <td>A</td>
  8053. <td style="text-align: left;">Used for courtesy reply mail and metered
  8054. reply mail with a</td>
  8055. </tr>
  8056. <tr>
  8057. <td></td>
  8058. <td style="text-align: left;">pre-printed POSTNET symbol.</td>
  8059. </tr>
  8060. <tr>
  8061. <td>B</td>
  8062. <td style="text-align: left;">Used for business reply mail without a
  8063. pre-printed zip code.</td>
  8064. </tr>
  8065. <tr>
  8066. <td>C</td>
  8067. <td style="text-align: left;">Used for business reply mail with a
  8068. pre-printed zip code.</td>
  8069. </tr>
  8070. <tr>
  8071. <td>D</td>
  8072. <td style="text-align: left;">Used for Information Based Indicia (IBI)
  8073. postage.</td>
  8074. </tr>
  8075. <tr>
  8076. <td>E</td>
  8077. <td style="text-align: left;">Used for customized mail with a USPS
  8078. Intelligent Mail barcode.</td>
  8079. </tr>
  8080. </tbody>
  8081. </table>
  8082. </div>
  8083. <h3 id="flattermarken">6.7.2 Flattermarken</h3>
  8084. <figure>
  8085. <img src="images/flat.svg" title="fig:" class="lin"
  8086. alt="zint -b FLAT -d &quot;1304056&quot;" />
  8087. <figcaption
  8088. aria-hidden="true"><code>zint -b FLAT -d "1304056"</code></figcaption>
  8089. </figure>
  8090. <p>Used for the recognition of page sequences in print-shops, the
  8091. Flattermarken is not a true barcode symbol and requires precise
  8092. knowledge of the position of the mark on the page. The Flattermarken
  8093. system can encode numeric data up to a maximum of 128 digits and does
  8094. not include a check digit.</p>
  8095. <h1 id="legal-and-version-information">7. Legal and Version
  8096. Information</h1>
  8097. <h2 id="license">7.1 License</h2>
  8098. <p>Zint, libzint and Zint Barcode Studio are Copyright © 2024 Robin
  8099. Stuart. All historical versions are distributed under the GNU General
  8100. Public License version 3 or later. Versions 2.5 and later are released
  8101. under a dual license: the encoding library is released under the BSD (3
  8102. clause) license whereas the GUI, Zint Barcode Studio, and the CLI are
  8103. released under the GNU General Public License version 3 or later.</p>
  8104. <p>Telepen is a trademark of SB Electronic Systems Ltd.</p>
  8105. <p>QR Code is a registered trademark of Denso Wave Incorporated.</p>
  8106. <p>Mailmark is a registered trademark of Royal Mail Group Ltd.</p>
  8107. <p>Microsoft, Windows and the Windows logo are either registered
  8108. trademarks or trademarks of Microsoft Corporation in the United States
  8109. and/or other countries.</p>
  8110. <p>Linux is the registered trademark of Linus Torvalds in the U.S. and
  8111. other countries.</p>
  8112. <p>Mac and macOS are trademarks of Apple Inc., registered in the U.S.
  8113. and other countries.</p>
  8114. <p>The Zint logo is derived from “SF Planetary Orbiter” font by
  8115. ShyFoundary.</p>
  8116. <p>Zint.org.uk website design and hosting provided by Robert
  8117. Elliott.</p>
  8118. <h2 id="patent-issues">7.2 Patent Issues</h2>
  8119. <p>All of the code in Zint is developed using information in the public
  8120. domain, usually freely available on the Internet. Some of the techniques
  8121. used may be subject to patents and other intellectual property
  8122. legislation. It is my belief that any patents involved in the technology
  8123. underlying symbologies utilised by Zint are ‘unadopted’, that is the
  8124. holder does not object to their methods being used.</p>
  8125. <p>Any methods patented or owned by third parties or trademarks or
  8126. registered trademarks used within Zint or in this document are and
  8127. remain the property of their respective owners and do not indicate
  8128. endorsement or affiliation with those owners, companies or
  8129. organisations.</p>
  8130. <h2 id="version-information">7.3 Version Information</h2>
  8131. <p>The current stable version of Zint is 2.13.0, released on 18th
  8132. December 2023.</p>
  8133. <p>See <code>"ChangeLog"</code> in the project root directory for
  8134. information on all releases.</p>
  8135. <h2 id="sources-of-information">7.4 Sources of Information</h2>
  8136. <p>Below is a list of some of the sources used in rough chronological
  8137. order:</p>
  8138. <ul>
  8139. <li>Nick Johnson’s Barcode Specifications</li>
  8140. <li>Bar Code 1 Specification Source Page</li>
  8141. <li>SB Electronic Systems Telepen website</li>
  8142. <li>Pharmacode specifications from Laetus</li>
  8143. <li>Morovia RM4SCC specification</li>
  8144. <li>Australia Post’s ‘A Guide to Printing the 4-State Barcode’ and
  8145. bcsample source code</li>
  8146. <li>Plessey algorithm from GNU-Barcode v0.98 by Leonid A. Broukhis</li>
  8147. <li>GS1 General Specifications v 8.0 Issue 2</li>
  8148. <li>PNG: The Definitive Guide and wpng source code by Greg Reolofs</li>
  8149. <li>PDF417 specification and pdf417 source code by Grand Zebu</li>
  8150. <li>Barcode Reference, TBarCode/X User Documentation and TBarCode/X
  8151. demonstration program from Tec-It</li>
  8152. <li>IEC16022 source code by Stefan Schmidt et al</li>
  8153. <li>United States Postal Service Specification USPS-B-3200</li>
  8154. <li>Adobe Systems Incorporated Encapsulated PostScript File Format
  8155. Specification</li>
  8156. <li>BSI Online Library</li>
  8157. <li>Libdmtx Data Matrix ECC200 decoding library</li>
  8158. </ul>
  8159. <h2 id="standards-compliance">7.5 Standards Compliance</h2>
  8160. <p>Zint was developed to provide compliance with the following British
  8161. and international standards:</p>
  8162. <h3 id="symbology-standards">7.5.1 Symbology Standards</h3>
  8163. <ul>
  8164. <li>ISO/IEC 24778:2008 Information technology - Automatic identification
  8165. and data capture techniques - Aztec Code bar code symbology
  8166. specification</li>
  8167. <li>SEMI T1-95 Specification for Back Surface Bar Code Marking of
  8168. Silicon Wafers (BC412) (1996)</li>
  8169. <li>ANSI/AIM BC12-1998 - Uniform Symbology Specification Channel
  8170. Code</li>
  8171. <li>BS EN 798:1996 Bar coding - Symbology specifications -
  8172. ‘Codabar’</li>
  8173. <li>AIM Europe ISS-X-24 - Uniform Symbology Specification Codablock-F
  8174. (1995)</li>
  8175. <li>ISO/IEC 15417:2007 Information technology - Automatic identification
  8176. and data capture techniques - Code 128 bar code symbology
  8177. specification</li>
  8178. <li>BS EN 12323:2005 AIDC technologies - Symbology specifications - Code
  8179. 16K</li>
  8180. <li>ISO/IEC 16388:2007 Information technology - Automatic identification
  8181. and data capture techniques - Code 39 bar code symbology
  8182. specification</li>
  8183. <li>ANSI/AIM BC6-2000 - Uniform Symbology Specification Code 49</li>
  8184. <li>ANSI/AIM BC5-1995 - Uniform Symbology Specification Code 93</li>
  8185. <li>AIM Uniform Symbology Specification Code One (1994)</li>
  8186. <li>ISO/IEC 16022:2006 Information technology - Automatic identification
  8187. and data capture techniques - Data Matrix ECC200 bar code symbology
  8188. specification</li>
  8189. <li>ISO/IEC 21471:2020 Information technology - Automatic identification
  8190. and data capture techniques - Extended rectangular data matrix (DMRE)
  8191. bar code symbology specification</li>
  8192. <li>AIM TSC1705001 (v 4.0 Draft 0.15) - Information technology -
  8193. Automatic identification and data capture techniques - Bar code
  8194. symbology specification - DotCode (Revised 28th May 2019)</li>
  8195. <li>ISO/IEC 15420:2009 Information technology - Automatic identification
  8196. and data capture techniques - EAN/UPC bar code symbology
  8197. specification</li>
  8198. <li>AIMD014 (v 1.63) - Information technology, Automatic identification
  8199. and data capture techniques - Bar code symbology specification - Grid
  8200. Matrix (Released 9th Dec 2008)</li>
  8201. <li>ISO/IEC 24723:2010 Information technology - Automatic identification
  8202. and data capture techniques - GS1 Composite bar code symbology
  8203. specification</li>
  8204. <li>ISO/IEC 24724:2011 Information technology - Automatic identification
  8205. and data capture techniques - GS1 DataBar bar code symbology
  8206. specification</li>
  8207. <li>ISO/IEC 20830:2021 Information technology - Automatic identification
  8208. and data capture techniques - Han Xin Code bar code symbology
  8209. specification</li>
  8210. <li>ISO/IEC 16390:2007 Information technology - Automatic identification
  8211. and data capture techniques - Interleaved 2 of 5 bar code symbology
  8212. specification</li>
  8213. <li>ISO/IEC 16023:2000 Information technology - International symbology
  8214. specification - MaxiCode</li>
  8215. <li>ISO/IEC 24728:2006 Information technology - Automatic identification
  8216. and data capture techniques - MicroPDF417 bar code symbology
  8217. specification</li>
  8218. <li>ISO/IEC 15438:2015 Information technology - Automatic identification
  8219. and data capture techniques - PDF417 bar code symbology
  8220. specification</li>
  8221. <li>ISO/IEC 18004:2015 Information technology - Automatic identification
  8222. and data capture techniques - QR Code bar code symbology
  8223. specification</li>
  8224. <li>ISO/IEC 23941:2022 Information technology - Automatic identification
  8225. and data capture techniques - Rectangular Micro QR Code (rMQR) bar code
  8226. symbology specification</li>
  8227. <li>AIMD/TSC15032-43 (v 0.99c) - International Technical Specification -
  8228. Ultracode Symbology (Draft) (Released 4th Nov 2015)</li>
  8229. </ul>
  8230. <p>A number of other specification documents have also been referenced,
  8231. such as MIL-STD-1189 Rev. B (1989) (LOGMARS), USPS DMM 300 2006 (2011)
  8232. (POSTNET, PLANET, FIM) and USPS-B-3200 (2015) (IMAIL). Those not named
  8233. include postal and delivery company references in particular.</p>
  8234. <h3 id="general-standards">7.5.2 General Standards</h3>
  8235. <ul>
  8236. <li>AIM ITS/04-001 International Technical Standard - Extended Channel
  8237. Interpretations Part 1: Identification Schemes and Protocol (Released
  8238. 24th May 2004)</li>
  8239. <li>AIM ITS/04-023 International Technical Standard - Extended Channel
  8240. Interpretations Part 3: Register (Version 2, February 2022)</li>
  8241. <li>GS1 General Specifications Release 24.0 (Jan 2024)</li>
  8242. <li>ANSI/HIBC 2.6-2016 - The Health Industry Bar Code (HIBC) Supplier
  8243. Labeling Standard</li>
  8244. </ul>
  8245. <h1 id="annex-a.-character-encoding">Annex A. Character Encoding</h1>
  8246. <p>This section is intended as a quick reference to the character sets
  8247. used by Zint. All symbologies use standard ASCII input as shown in
  8248. section A.1, but some support extended characters as shown in the
  8249. subsequent section <a href="#a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2
  8250. Latin Alphabet No. 1 (ISO/IEC 8859-1)</a>.</p>
  8251. <h2 id="a.1-ascii-standard">A.1 ASCII Standard</h2>
  8252. <p>The ubiquitous ASCII standard is well known to most computer users.
  8253. It’s reproduced here for reference.</p>
  8254. <div id="tbl:ascii" class="tablenos">
  8255. <table id="tbl:ascii" data-tag=": ASCII">
  8256. <caption><span>Table : ASCII</span> </caption>
  8257. <thead>
  8258. <tr>
  8259. <th>Hex</th>
  8260. <th style="text-align: left;">0</th>
  8261. <th style="text-align: left;">1</th>
  8262. <th style="text-align: left;">2</th>
  8263. <th style="text-align: left;">3</th>
  8264. <th style="text-align: left;">4</th>
  8265. <th style="text-align: left;">5</th>
  8266. <th style="text-align: left;">6</th>
  8267. <th style="text-align: left;">7</th>
  8268. </tr>
  8269. </thead>
  8270. <tbody>
  8271. <tr>
  8272. <td>0</td>
  8273. <td style="text-align: left;"><code>NUL</code></td>
  8274. <td style="text-align: left;"><code>DLE</code></td>
  8275. <td style="text-align: left;"><code>SPACE</code></td>
  8276. <td style="text-align: left;"><code>0</code></td>
  8277. <td style="text-align: left;"><code>@</code></td>
  8278. <td style="text-align: left;"><code>P</code></td>
  8279. <td style="text-align: left;"><code>`</code></td>
  8280. <td style="text-align: left;"><code>p</code></td>
  8281. </tr>
  8282. <tr>
  8283. <td>1</td>
  8284. <td style="text-align: left;"><code>SOH</code></td>
  8285. <td style="text-align: left;"><code>DC1</code></td>
  8286. <td style="text-align: left;"><code>!</code></td>
  8287. <td style="text-align: left;"><code>1</code></td>
  8288. <td style="text-align: left;"><code>A</code></td>
  8289. <td style="text-align: left;"><code>Q</code></td>
  8290. <td style="text-align: left;"><code>a</code></td>
  8291. <td style="text-align: left;"><code>q</code></td>
  8292. </tr>
  8293. <tr>
  8294. <td>2</td>
  8295. <td style="text-align: left;"><code>STX</code></td>
  8296. <td style="text-align: left;"><code>DC2</code></td>
  8297. <td style="text-align: left;"><code>"</code></td>
  8298. <td style="text-align: left;"><code>2</code></td>
  8299. <td style="text-align: left;"><code>B</code></td>
  8300. <td style="text-align: left;"><code>R</code></td>
  8301. <td style="text-align: left;"><code>b</code></td>
  8302. <td style="text-align: left;"><code>r</code></td>
  8303. </tr>
  8304. <tr>
  8305. <td>3</td>
  8306. <td style="text-align: left;"><code>ETX</code></td>
  8307. <td style="text-align: left;"><code>DC3</code></td>
  8308. <td style="text-align: left;"><code>#</code></td>
  8309. <td style="text-align: left;"><code>3</code></td>
  8310. <td style="text-align: left;"><code>C</code></td>
  8311. <td style="text-align: left;"><code>S</code></td>
  8312. <td style="text-align: left;"><code>c</code></td>
  8313. <td style="text-align: left;"><code>s</code></td>
  8314. </tr>
  8315. <tr>
  8316. <td>4</td>
  8317. <td style="text-align: left;"><code>EOT</code></td>
  8318. <td style="text-align: left;"><code>DC4</code></td>
  8319. <td style="text-align: left;"><code>$</code></td>
  8320. <td style="text-align: left;"><code>4</code></td>
  8321. <td style="text-align: left;"><code>D</code></td>
  8322. <td style="text-align: left;"><code>T</code></td>
  8323. <td style="text-align: left;"><code>d</code></td>
  8324. <td style="text-align: left;"><code>t</code></td>
  8325. </tr>
  8326. <tr>
  8327. <td>5</td>
  8328. <td style="text-align: left;"><code>ENQ</code></td>
  8329. <td style="text-align: left;"><code>NAK</code></td>
  8330. <td style="text-align: left;"><code>%</code></td>
  8331. <td style="text-align: left;"><code>5</code></td>
  8332. <td style="text-align: left;"><code>E</code></td>
  8333. <td style="text-align: left;"><code>U</code></td>
  8334. <td style="text-align: left;"><code>e</code></td>
  8335. <td style="text-align: left;"><code>u</code></td>
  8336. </tr>
  8337. <tr>
  8338. <td>6</td>
  8339. <td style="text-align: left;"><code>ACK</code></td>
  8340. <td style="text-align: left;"><code>SYN</code></td>
  8341. <td style="text-align: left;"><code>&amp;</code></td>
  8342. <td style="text-align: left;"><code>6</code></td>
  8343. <td style="text-align: left;"><code>F</code></td>
  8344. <td style="text-align: left;"><code>V</code></td>
  8345. <td style="text-align: left;"><code>f</code></td>
  8346. <td style="text-align: left;"><code>v</code></td>
  8347. </tr>
  8348. <tr>
  8349. <td>7</td>
  8350. <td style="text-align: left;"><code>BEL</code></td>
  8351. <td style="text-align: left;"><code>ETB</code></td>
  8352. <td style="text-align: left;"><code>'</code></td>
  8353. <td style="text-align: left;"><code>7</code></td>
  8354. <td style="text-align: left;"><code>G</code></td>
  8355. <td style="text-align: left;"><code>W</code></td>
  8356. <td style="text-align: left;"><code>g</code></td>
  8357. <td style="text-align: left;"><code>w</code></td>
  8358. </tr>
  8359. <tr>
  8360. <td>8</td>
  8361. <td style="text-align: left;"><code>BS</code></td>
  8362. <td style="text-align: left;"><code>CAN</code></td>
  8363. <td style="text-align: left;"><code>(</code></td>
  8364. <td style="text-align: left;"><code>8</code></td>
  8365. <td style="text-align: left;"><code>H</code></td>
  8366. <td style="text-align: left;"><code>X</code></td>
  8367. <td style="text-align: left;"><code>h</code></td>
  8368. <td style="text-align: left;"><code>x</code></td>
  8369. </tr>
  8370. <tr>
  8371. <td>9</td>
  8372. <td style="text-align: left;"><code>TAB</code></td>
  8373. <td style="text-align: left;"><code>EM</code></td>
  8374. <td style="text-align: left;"><code>)</code></td>
  8375. <td style="text-align: left;"><code>9</code></td>
  8376. <td style="text-align: left;"><code>I</code></td>
  8377. <td style="text-align: left;"><code>Y</code></td>
  8378. <td style="text-align: left;"><code>i</code></td>
  8379. <td style="text-align: left;"><code>y</code></td>
  8380. </tr>
  8381. <tr>
  8382. <td>A</td>
  8383. <td style="text-align: left;"><code>LF</code></td>
  8384. <td style="text-align: left;"><code>SUB</code></td>
  8385. <td style="text-align: left;"><code>*</code></td>
  8386. <td style="text-align: left;"><code>:</code></td>
  8387. <td style="text-align: left;"><code>J</code></td>
  8388. <td style="text-align: left;"><code>Z</code></td>
  8389. <td style="text-align: left;"><code>j</code></td>
  8390. <td style="text-align: left;"><code>z</code></td>
  8391. </tr>
  8392. <tr>
  8393. <td>B</td>
  8394. <td style="text-align: left;"><code>VT</code></td>
  8395. <td style="text-align: left;"><code>ESC</code></td>
  8396. <td style="text-align: left;"><code>+</code></td>
  8397. <td style="text-align: left;"><code>;</code></td>
  8398. <td style="text-align: left;"><code>K</code></td>
  8399. <td style="text-align: left;"><code>[</code></td>
  8400. <td style="text-align: left;"><code>k</code></td>
  8401. <td style="text-align: left;"><code>{</code></td>
  8402. </tr>
  8403. <tr>
  8404. <td>C</td>
  8405. <td style="text-align: left;"><code>FF</code></td>
  8406. <td style="text-align: left;"><code>FS</code></td>
  8407. <td style="text-align: left;"><code>,</code></td>
  8408. <td style="text-align: left;"><code>&lt;</code></td>
  8409. <td style="text-align: left;"><code>L</code></td>
  8410. <td style="text-align: left;"><code>\</code></td>
  8411. <td style="text-align: left;"><code>l</code></td>
  8412. <td style="text-align: left;"><code>|</code></td>
  8413. </tr>
  8414. <tr>
  8415. <td>D</td>
  8416. <td style="text-align: left;"><code>CR</code></td>
  8417. <td style="text-align: left;"><code>GS</code></td>
  8418. <td style="text-align: left;"><code>-</code></td>
  8419. <td style="text-align: left;"><code>=</code></td>
  8420. <td style="text-align: left;"><code>M</code></td>
  8421. <td style="text-align: left;"><code>]</code></td>
  8422. <td style="text-align: left;"><code>m</code></td>
  8423. <td style="text-align: left;"><code>}</code></td>
  8424. </tr>
  8425. <tr>
  8426. <td>E</td>
  8427. <td style="text-align: left;"><code>SO</code></td>
  8428. <td style="text-align: left;"><code>RS</code></td>
  8429. <td style="text-align: left;"><code>.</code></td>
  8430. <td style="text-align: left;"><code>&gt;</code></td>
  8431. <td style="text-align: left;"><code>N</code></td>
  8432. <td style="text-align: left;"><code>^</code></td>
  8433. <td style="text-align: left;"><code>n</code></td>
  8434. <td style="text-align: left;"><code>~</code></td>
  8435. </tr>
  8436. <tr>
  8437. <td>F</td>
  8438. <td style="text-align: left;"><code>SI</code></td>
  8439. <td style="text-align: left;"><code>US</code></td>
  8440. <td style="text-align: left;"><code>/</code></td>
  8441. <td style="text-align: left;"><code>?</code></td>
  8442. <td style="text-align: left;"><code>O</code></td>
  8443. <td style="text-align: left;"><code>_</code></td>
  8444. <td style="text-align: left;"><code>o</code></td>
  8445. <td style="text-align: left;"><code>DEL</code></td>
  8446. </tr>
  8447. </tbody>
  8448. </table>
  8449. </div>
  8450. <h2 id="a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2 Latin Alphabet No. 1
  8451. (ISO/IEC 8859-1)</h2>
  8452. <p>ISO/IEC 8859-1 defines additional characters common in western
  8453. European languages like French, German, Italian and Spanish. This
  8454. extension is the default encoding of many barcodes (see Table <a
  8455. href="#tbl:default_character_sets">: Default Character Sets</a>) when a
  8456. codepoint above hex 9F is encoded. Note that codepoints hex 80 to 9F are
  8457. not defined.</p>
  8458. <div id="tbl:iso_iec_8869_1" class="tablenos">
  8459. <table id="tbl:iso_iec_8869_1" data-tag=": ISO/IEC 8859-1">
  8460. <caption><span>Table : ISO/IEC 8859-1</span> </caption>
  8461. <thead>
  8462. <tr>
  8463. <th>Hex</th>
  8464. <th style="text-align: left;">8</th>
  8465. <th style="text-align: left;">9</th>
  8466. <th style="text-align: left;">A</th>
  8467. <th style="text-align: left;">B</th>
  8468. <th style="text-align: left;">C</th>
  8469. <th style="text-align: left;">D</th>
  8470. <th style="text-align: left;">E</th>
  8471. <th style="text-align: left;">F</th>
  8472. </tr>
  8473. </thead>
  8474. <tbody>
  8475. <tr>
  8476. <td>0</td>
  8477. <td style="text-align: left;"></td>
  8478. <td style="text-align: left;"></td>
  8479. <td style="text-align: left;"><code>NBSP</code></td>
  8480. <td style="text-align: left;"><code>°</code></td>
  8481. <td style="text-align: left;"><code>À</code></td>
  8482. <td style="text-align: left;"><code>Ð</code></td>
  8483. <td style="text-align: left;"><code>à</code></td>
  8484. <td style="text-align: left;"><code>ð</code></td>
  8485. </tr>
  8486. <tr>
  8487. <td>1</td>
  8488. <td style="text-align: left;"></td>
  8489. <td style="text-align: left;"></td>
  8490. <td style="text-align: left;"><code>¡</code></td>
  8491. <td style="text-align: left;"><code>±</code></td>
  8492. <td style="text-align: left;"><code>Á</code></td>
  8493. <td style="text-align: left;"><code>Ñ</code></td>
  8494. <td style="text-align: left;"><code>á</code></td>
  8495. <td style="text-align: left;"><code>ñ</code></td>
  8496. </tr>
  8497. <tr>
  8498. <td>2</td>
  8499. <td style="text-align: left;"></td>
  8500. <td style="text-align: left;"></td>
  8501. <td style="text-align: left;"><code>¢</code></td>
  8502. <td style="text-align: left;"><code>²</code></td>
  8503. <td style="text-align: left;"><code>Â</code></td>
  8504. <td style="text-align: left;"><code>Ò</code></td>
  8505. <td style="text-align: left;"><code>â</code></td>
  8506. <td style="text-align: left;"><code>ò</code></td>
  8507. </tr>
  8508. <tr>
  8509. <td>3</td>
  8510. <td style="text-align: left;"></td>
  8511. <td style="text-align: left;"></td>
  8512. <td style="text-align: left;"><code>£</code></td>
  8513. <td style="text-align: left;"><code>³</code></td>
  8514. <td style="text-align: left;"><code>Ã</code></td>
  8515. <td style="text-align: left;"><code>Ó</code></td>
  8516. <td style="text-align: left;"><code>ã</code></td>
  8517. <td style="text-align: left;"><code>ó</code></td>
  8518. </tr>
  8519. <tr>
  8520. <td>4</td>
  8521. <td style="text-align: left;"></td>
  8522. <td style="text-align: left;"></td>
  8523. <td style="text-align: left;"><code>¤</code></td>
  8524. <td style="text-align: left;"><code>´</code></td>
  8525. <td style="text-align: left;"><code>Ä</code></td>
  8526. <td style="text-align: left;"><code>Ô</code></td>
  8527. <td style="text-align: left;"><code>ä</code></td>
  8528. <td style="text-align: left;"><code>ô</code></td>
  8529. </tr>
  8530. <tr>
  8531. <td>5</td>
  8532. <td style="text-align: left;"></td>
  8533. <td style="text-align: left;"></td>
  8534. <td style="text-align: left;"><code>¥</code></td>
  8535. <td style="text-align: left;"><code>μ</code></td>
  8536. <td style="text-align: left;"><code>Å</code></td>
  8537. <td style="text-align: left;"><code>Õ</code></td>
  8538. <td style="text-align: left;"><code>å</code></td>
  8539. <td style="text-align: left;"><code>õ</code></td>
  8540. </tr>
  8541. <tr>
  8542. <td>6</td>
  8543. <td style="text-align: left;"></td>
  8544. <td style="text-align: left;"></td>
  8545. <td style="text-align: left;"><code>¦</code></td>
  8546. <td style="text-align: left;"><code>¶</code></td>
  8547. <td style="text-align: left;"><code>Æ</code></td>
  8548. <td style="text-align: left;"><code>Ö</code></td>
  8549. <td style="text-align: left;"><code>æ</code></td>
  8550. <td style="text-align: left;"><code>ö</code></td>
  8551. </tr>
  8552. <tr>
  8553. <td>7</td>
  8554. <td style="text-align: left;"></td>
  8555. <td style="text-align: left;"></td>
  8556. <td style="text-align: left;"><code>§</code></td>
  8557. <td style="text-align: left;"><code>·</code></td>
  8558. <td style="text-align: left;"><code>Ç</code></td>
  8559. <td style="text-align: left;"><code>×</code></td>
  8560. <td style="text-align: left;"><code>ç</code></td>
  8561. <td style="text-align: left;"><code>÷</code></td>
  8562. </tr>
  8563. <tr>
  8564. <td>8</td>
  8565. <td style="text-align: left;"></td>
  8566. <td style="text-align: left;"></td>
  8567. <td style="text-align: left;"><code>¨</code></td>
  8568. <td style="text-align: left;"><code>¸</code></td>
  8569. <td style="text-align: left;"><code>È</code></td>
  8570. <td style="text-align: left;"><code>Ø</code></td>
  8571. <td style="text-align: left;"><code>è</code></td>
  8572. <td style="text-align: left;"><code>ø</code></td>
  8573. </tr>
  8574. <tr>
  8575. <td>9</td>
  8576. <td style="text-align: left;"></td>
  8577. <td style="text-align: left;"></td>
  8578. <td style="text-align: left;"><code>©</code></td>
  8579. <td style="text-align: left;"><code>¹</code></td>
  8580. <td style="text-align: left;"><code>É</code></td>
  8581. <td style="text-align: left;"><code>Ù</code></td>
  8582. <td style="text-align: left;"><code>é</code></td>
  8583. <td style="text-align: left;"><code>ù</code></td>
  8584. </tr>
  8585. <tr>
  8586. <td>A</td>
  8587. <td style="text-align: left;"></td>
  8588. <td style="text-align: left;"></td>
  8589. <td style="text-align: left;"><code>ª</code></td>
  8590. <td style="text-align: left;"><code>º</code></td>
  8591. <td style="text-align: left;"><code>Ê</code></td>
  8592. <td style="text-align: left;"><code>Ú</code></td>
  8593. <td style="text-align: left;"><code>ê</code></td>
  8594. <td style="text-align: left;"><code>ú</code></td>
  8595. </tr>
  8596. <tr>
  8597. <td>B</td>
  8598. <td style="text-align: left;"></td>
  8599. <td style="text-align: left;"></td>
  8600. <td style="text-align: left;"><code>«</code></td>
  8601. <td style="text-align: left;"><code>»</code></td>
  8602. <td style="text-align: left;"><code>Ë</code></td>
  8603. <td style="text-align: left;"><code>Û</code></td>
  8604. <td style="text-align: left;"><code>ë</code></td>
  8605. <td style="text-align: left;"><code>û</code></td>
  8606. </tr>
  8607. <tr>
  8608. <td>C</td>
  8609. <td style="text-align: left;"></td>
  8610. <td style="text-align: left;"></td>
  8611. <td style="text-align: left;"><code>¬</code></td>
  8612. <td style="text-align: left;"><code>¼</code></td>
  8613. <td style="text-align: left;"><code>Ì</code></td>
  8614. <td style="text-align: left;"><code>Ü</code></td>
  8615. <td style="text-align: left;"><code>ì</code></td>
  8616. <td style="text-align: left;"><code>ü</code></td>
  8617. </tr>
  8618. <tr>
  8619. <td>D</td>
  8620. <td style="text-align: left;"></td>
  8621. <td style="text-align: left;"></td>
  8622. <td style="text-align: left;"><code>SHY</code></td>
  8623. <td style="text-align: left;"><code>½</code></td>
  8624. <td style="text-align: left;"><code>Í</code></td>
  8625. <td style="text-align: left;"><code>Ý</code></td>
  8626. <td style="text-align: left;"><code>í</code></td>
  8627. <td style="text-align: left;"><code>ý</code></td>
  8628. </tr>
  8629. <tr>
  8630. <td>E</td>
  8631. <td style="text-align: left;"></td>
  8632. <td style="text-align: left;"></td>
  8633. <td style="text-align: left;"><code>®</code></td>
  8634. <td style="text-align: left;"><code>¾</code></td>
  8635. <td style="text-align: left;"><code>Î</code></td>
  8636. <td style="text-align: left;"><code>Þ</code></td>
  8637. <td style="text-align: left;"><code>î</code></td>
  8638. <td style="text-align: left;"><code>þ</code></td>
  8639. </tr>
  8640. <tr>
  8641. <td>F</td>
  8642. <td style="text-align: left;"></td>
  8643. <td style="text-align: left;"></td>
  8644. <td style="text-align: left;"><code>¯</code></td>
  8645. <td style="text-align: left;"><code>¿</code></td>
  8646. <td style="text-align: left;"><code>Ï</code></td>
  8647. <td style="text-align: left;"><code>ß</code></td>
  8648. <td style="text-align: left;"><code>ï</code></td>
  8649. <td style="text-align: left;"><code>ÿ</code></td>
  8650. </tr>
  8651. </tbody>
  8652. </table>
  8653. </div>
  8654. <h1 id="annex-b.-qt-backend-qzint">Annex B. Qt Backend QZint</h1>
  8655. <p>Used internally by Zint Barcode Studio to display the preview, the Qt
  8656. Backend <code>QZint</code> renders a barcode by drawing the vector
  8657. representation (see <a href="#buffering-symbols-in-memory-vector">5.5
  8658. Buffering Symbols in Memory (vector)</a>) provided by the Zint library
  8659. <code>libzint</code>.</p>
  8660. <p>The main class is <code>Zint::QZint</code>, which has getter/setter
  8661. properties that correspond to the <code>zint_symbol</code> structure
  8662. (see <a href="#setting-options">5.7 Setting Options</a>), and a main
  8663. method <code>render()</code> which takes a Qt <code>QPainter</code> to
  8664. paint with, and a <code>QRectF</code> rectangular area specifying where
  8665. to paint into:</p>
  8666. <div class="sourceCode" id="cb120"><pre
  8667. class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb120-1"><a href="#cb120-1" aria-hidden="true" tabindex="-1"></a><span class="co">/* Encode and display barcode in `paintRect` using `painter`.</span></span>
  8668. <span id="cb120-2"><a href="#cb120-2" aria-hidden="true" tabindex="-1"></a><span class="co"> Note: legacy argument `mode` is not used */</span></span>
  8669. <span id="cb120-3"><a href="#cb120-3" aria-hidden="true" tabindex="-1"></a><span class="dt">void</span> render<span class="op">(</span><span class="ex">QPainter</span><span class="op">&amp;</span> painter<span class="op">,</span> <span class="at">const</span> <span class="ex">QRectF</span><span class="op">&amp;</span> paintRect<span class="op">,</span></span>
  8670. <span id="cb120-4"><a href="#cb120-4" aria-hidden="true" tabindex="-1"></a> AspectRatioMode mode <span class="op">=</span> IgnoreAspectRatio<span class="op">);</span></span></code></pre></div>
  8671. <p><code>render()</code> will emit one of two Qt signals -
  8672. <code>encoded</code> on successful encoding and drawing, or
  8673. <code>errored</code> on failure. The client can connect and act
  8674. appropriately, for instance:</p>
  8675. <div class="sourceCode" id="cb121"><pre
  8676. class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb121-1"><a href="#cb121-1" aria-hidden="true" tabindex="-1"></a><span class="fu">connect</span><span class="op">(</span>qzint<span class="op">,</span> <span class="ex">SIGNAL</span><span class="op">(</span>encoded<span class="op">()),</span> <span class="ex">SLOT</span><span class="op">(</span>on_encoded<span class="op">()));</span></span>
  8677. <span id="cb121-2"><a href="#cb121-2" aria-hidden="true" tabindex="-1"></a><span class="fu">connect</span><span class="op">(</span>qzint<span class="op">,</span> <span class="ex">SIGNAL</span><span class="op">(</span>errored<span class="op">()),</span> <span class="ex">SLOT</span><span class="op">(</span>on_errored<span class="op">()));</span></span></code></pre></div>
  8678. <p>where <code>qzint</code> is an instance of <code>Zint::QZint</code>
  8679. and <code>on_encoded()</code> and <code>on_error()</code> are Qt slot
  8680. methods provided by the caller. On error, the error value and message
  8681. can be retrieved by the methods <code>getError()</code> and
  8682. <code>lastError()</code> respectively.</p>
  8683. <p>The other main method is <code>save_to_file()</code>:</p>
  8684. <div class="sourceCode" id="cb122"><pre
  8685. class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb122-1"><a href="#cb122-1" aria-hidden="true" tabindex="-1"></a><span class="co">/* Encode and print barcode to file `filename`.</span></span>
  8686. <span id="cb122-2"><a href="#cb122-2" aria-hidden="true" tabindex="-1"></a><span class="co"> Only sets `getError()` on error, not on warning */</span></span>
  8687. <span id="cb122-3"><a href="#cb122-3" aria-hidden="true" tabindex="-1"></a><span class="dt">bool</span> save_to_file<span class="op">(</span><span class="at">const</span> <span class="ex">QString</span><span class="op">&amp;</span> filename<span class="op">);</span> <span class="co">// `ZBarcode_Print()`</span></span></code></pre></div>
  8688. <p>which takes a <code>filename</code> to output to. It too will emit an
  8689. <code>errored</code> signal on failure, returning <code>false</code>
  8690. (but nothing on success, which just returns <code>true</code>). Note
  8691. that rotation is achieved through the setter method
  8692. <code>setRotateAngleValue()</code> (as opposed to the
  8693. <code>rotate_angle</code> argument used by
  8694. <code>ZBarcode_Print()</code>).</p>
  8695. <p>Various other methods are available, for instance methods for testing
  8696. symbology capabilities, and utility methods such as
  8697. <code>defaultXdim()</code> and <code>getAsCLI()</code>.</p>
  8698. <p>For full details, see <code>"backend_qt/qzint.h"</code>.</p>
  8699. <h1 id="annex-c.-tcl-backend-binding">Annex C. Tcl Backend Binding</h1>
  8700. <p>A Tcl binding is available in the <code>"backend_tcl</code>”
  8701. sub-directory. To make on Unix:</p>
  8702. <div class="sourceCode" id="cb123"><pre
  8703. class="sourceCode bash"><code class="sourceCode bash"><span id="cb123-1"><a href="#cb123-1" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> backend_tcl</span>
  8704. <span id="cb123-2"><a href="#cb123-2" aria-hidden="true" tabindex="-1"></a><span class="fu">autoconf</span></span>
  8705. <span id="cb123-3"><a href="#cb123-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./configure</span></span>
  8706. <span id="cb123-4"><a href="#cb123-4" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span>
  8707. <span id="cb123-5"><a href="#cb123-5" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> make install</span></code></pre></div>
  8708. <p>For Windows, a Visual Studio 6.0 project file is available at
  8709. <code>"backend_tcl\zint_tcl.dsp"</code>. This can also be opened (and
  8710. converted) by more modern Visual Studio versions, though some fixing up
  8711. of the project configuration will likely be required.</p>
  8712. <p>Once built and installed, invoke the Tcl/Tk CLI
  8713. <code>"wish"</code>:</p>
  8714. <div class="sourceCode" id="cb124"><pre
  8715. class="sourceCode bash"><code class="sourceCode bash"><span id="cb124-1"><a href="#cb124-1" aria-hidden="true" tabindex="-1"></a><span class="ex">wish</span></span></code></pre></div>
  8716. <p>and ignoring the Tk window click back to the command prompt
  8717. <code>"%"</code> and type:</p>
  8718. <div class="sourceCode" id="cb125"><pre
  8719. class="sourceCode bash"><code class="sourceCode bash"><span id="cb125-1"><a href="#cb125-1" aria-hidden="true" tabindex="-1"></a><span class="ex">require</span> package zint</span>
  8720. <span id="cb125-2"><a href="#cb125-2" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> help</span></code></pre></div>
  8721. <p>which will show the usage message, with options very similiar to the
  8722. Zint CLI. (One notable difference is that boolean options such as
  8723. <code>-bold</code> take a <code>1</code> or <code>0</code> as an
  8724. argument.)</p>
  8725. <p>A demonstration Tcl/Tk program which is also useful in itself is
  8726. available at <code>"backend_tcl/demo/demo.tcl"</code>. To run type:</p>
  8727. <div class="sourceCode" id="cb126"><pre
  8728. class="sourceCode bash"><code class="sourceCode bash"><span id="cb126-1"><a href="#cb126-1" aria-hidden="true" tabindex="-1"></a><span class="ex">wish</span> demo/demo.tcl</span></code></pre></div>
  8729. <p>which will display the following window.</p>
  8730. <figure>
  8731. <img src="images/tcl_demo.png" title="fig:" class="pop"
  8732. alt="Tcl/Tk demonstration program window" />
  8733. <figcaption aria-hidden="true">Tcl/Tk demonstration program
  8734. window</figcaption>
  8735. </figure>
  8736. <p>You can select the symbology, enter the data to encode, and set
  8737. options (which are the same as those given in the usage message). A
  8738. raster preview of the configured barcode is displayed once the
  8739. <code>"Generate"</code> button is pressed.</p>
  8740. <h1 id="annex-d.-man-page-zint1">Annex D. Man Page ZINT(1)</h1>
  8741. <h2 id="name">NAME</h2>
  8742. <p><code>zint</code> - encode data as a barcode image</p>
  8743. <h2 id="synopsis">SYNOPSIS</h2>
  8744. <div class="line-block"><code>zint</code> [<code>-h</code> |
  8745. <code>--help</code>]<br />
  8746. <code>zint</code> [<em>options</em>]</div>
  8747. <h2 id="description">DESCRIPTION</h2>
  8748. <p>zint takes input data from the command line or a file to encode in a
  8749. barcode which is then output to an image file.</p>
  8750. <p>Input data is UTF-8, unless <code>--binary</code> is specified.</p>
  8751. <p>Human Readable Text (HRT) is displayed by default for those barcodes
  8752. that support HRT, unless <code>--notext</code> is specified.</p>
  8753. <p>The output image file (specified with <code>-o</code> |
  8754. <code>--output</code>) may be in one of these formats: Windows Bitmap
  8755. (<code>BMP</code>), Enhanced Metafile Format (<code>EMF</code>),
  8756. Encapsulated PostScript (<code>EPS</code>), Graphics Interchange Format
  8757. (<code>GIF</code>), ZSoft Paintbrush (<code>PCX</code>), Portable
  8758. Network Format (<code>PNG</code>), Scalable Vector Graphic
  8759. (<code>SVG</code>), or Tagged Image File Format (<code>TIF</code>).</p>
  8760. <h2 id="options">OPTIONS</h2>
  8761. <dl>
  8762. <dt><code>-h</code>, <code>--help</code></dt>
  8763. <dd>
  8764. <p>Print usage information summarizing command line options.</p>
  8765. </dd>
  8766. <dt><code>-b TYPE</code>, <code>--barcode=TYPE</code></dt>
  8767. <dd>
  8768. <p>Set the barcode symbology that will be used to encode the data.
  8769. <em>TYPE</em> is the number or name of the barcode symbology. If not
  8770. given, the symbology defaults to 20 (Code 128). To see what types are
  8771. available, use the <code>-t</code> | <code>--types</code> option. Type
  8772. names are case-insensitive, and non-alphanumerics are ignored.</p>
  8773. </dd>
  8774. <dt><code>--addongap=INTEGER</code></dt>
  8775. <dd>
  8776. <p>For EAN/UPC symbologies, set the gap between the main data and the
  8777. add-on. <em>INTEGER</em> is in integral multiples of the X-dimension.
  8778. The maximum gap that can be set is 12. The minimum is 7, except for
  8779. UPC-A, when the minimum is 9.</p>
  8780. </dd>
  8781. <dt><code>--batch</code></dt>
  8782. <dd>
  8783. <p>Treat each line of an input file specified with <code>-i</code> |
  8784. <code>--input</code> as a separate data set and produce a barcode image
  8785. for each one. The barcode images are outputted by default to numbered
  8786. filenames starting with “00001.png”, “00002.png” etc., which can be
  8787. changed by using the <code>-o</code> | <code>--output</code> option.</p>
  8788. </dd>
  8789. <dt><code>--bg=COLOUR</code></dt>
  8790. <dd>
  8791. <p>Specify a background (paper) colour where <em>COLOUR</em> is in
  8792. hexadecimal <code>RRGGBB</code> or <code>RRGGBBAA</code> format or in
  8793. decimal <code>C,M,Y,K</code> percentages format.</p>
  8794. </dd>
  8795. <dt><code>--binary</code></dt>
  8796. <dd>
  8797. <p>Treat input data as raw 8-bit binary data instead of the default
  8798. UTF-8. Automatic code page translation to an ECI page is disabled, and
  8799. no validation of the data’s character encoding takes place.</p>
  8800. </dd>
  8801. <dt><code>--bind</code></dt>
  8802. <dd>
  8803. <p>Add horizontal boundary bars (also known as bearer bars) to the
  8804. symbol. The width of the boundary bars is specified by the
  8805. <code>--border</code> option. <code>--bind</code> can also be used to
  8806. add row separator bars to symbols stacked with multiple <code>-d</code>
  8807. | <code>--data</code> inputs, in which case the width of the separator
  8808. bars is specified with the <code>--separator</code> option.</p>
  8809. </dd>
  8810. <dt><code>--bindtop</code></dt>
  8811. <dd>
  8812. <p>Add a horizontal boundary bar to the top of the symbol. The width of
  8813. the boundary bar is specified by the <code>--border</code> option.</p>
  8814. </dd>
  8815. <dt><code>--bold</code></dt>
  8816. <dd>
  8817. <p>Use a bold font for the Human Readable Text (HRT).</p>
  8818. </dd>
  8819. <dt><code>--border=INTEGER</code></dt>
  8820. <dd>
  8821. <p>Set the width of boundary bars (<code>--bind</code> or
  8822. <code>--bindtop</code>) or box borders (<code>--box</code>), where
  8823. <em>INTEGER</em> is in integral multiples of the X-dimension. The
  8824. default is zero.</p>
  8825. </dd>
  8826. <dt><code>--box</code></dt>
  8827. <dd>
  8828. <p>Add a box around the symbol. The width of the borders is specified by
  8829. the <code>--border</code> option.</p>
  8830. </dd>
  8831. <dt><code>--cmyk</code></dt>
  8832. <dd>
  8833. <p>Use the CMYK colour space when outputting to Encapsulated PostScript
  8834. (EPS) or TIF files.</p>
  8835. </dd>
  8836. <dt><code>--cols=INTEGER</code></dt>
  8837. <dd>
  8838. <p>Set the number of data columns in the symbol to <em>INTEGER</em>.
  8839. Affects Codablock-F, DotCode, GS1 DataBar Expanded Stacked
  8840. (DBAR_EXPSTK), MicroPDF417 and PDF417 symbols.</p>
  8841. </dd>
  8842. <dt><code>--compliantheight</code></dt>
  8843. <dd>
  8844. <p>Warn if the height specified by the <code>--height</code> option is
  8845. not compliant with the barcode’s specification, or if
  8846. <code>--height</code> is not given, default to the height specified by
  8847. the specification (if any).</p>
  8848. </dd>
  8849. <dt><code>-d</code>, <code>--data=DATA</code></dt>
  8850. <dd>
  8851. <p>Specify the input <em>DATA</em> to encode. The <code>--esc</code>
  8852. option may be used to enter non-printing characters using escape
  8853. sequences. The <em>DATA</em> should be UTF-8, unless the
  8854. <code>--binary</code> option is given, in which case it can be
  8855. anything.</p>
  8856. </dd>
  8857. <dt><code>--direct</code></dt>
  8858. <dd>
  8859. <p>Send output to stdout, which in most cases should be re-directed to a
  8860. pipe or a file. Use <code>--filetype</code> to specify output
  8861. format.</p>
  8862. </dd>
  8863. <dt><code>--dmiso144</code></dt>
  8864. <dd>
  8865. <p>For Data Matrix symbols, use the standard ISO/IEC codeword placement
  8866. for 144 x 144 (<code>--vers=24</code>) sized symbols, instead of the
  8867. default “de facto” placement (which rotates the placement of ECC
  8868. codewords).</p>
  8869. </dd>
  8870. <dt><code>--dmre</code></dt>
  8871. <dd>
  8872. <p>For Data Matrix symbols, allow Data Matrix Rectangular Extended
  8873. (DMRE) sizes when considering automatic sizes. See also
  8874. <code>--square</code>.</p>
  8875. </dd>
  8876. <dt><code>--dotsize=NUMBER</code></dt>
  8877. <dd>
  8878. <p>Set the radius of the dots in dotty mode (<code>--dotty</code>).
  8879. <em>NUMBER</em> is in X-dimensions, and may be floating-point. The
  8880. default is 0.8.</p>
  8881. </dd>
  8882. <dt><code>--dotty</code></dt>
  8883. <dd>
  8884. <p>Use dots instead of squares for matrix symbols. DotCode is always in
  8885. dotty mode.</p>
  8886. </dd>
  8887. <dt><code>--dump</code></dt>
  8888. <dd>
  8889. <p>Dump a hexadecimal representation of the symbol’s encodation to
  8890. stdout. The same representation may be outputted to a file by using a
  8891. <code>.txt</code> extension with <code>-o</code> | <code>--output</code>
  8892. or by specifying <code>--filetype=txt</code>.</p>
  8893. </dd>
  8894. <dt><code>-e</code>, <code>--ecinos</code></dt>
  8895. <dd>
  8896. <p>Display the table of ECIs (Extended Channel Interpretations).</p>
  8897. </dd>
  8898. <dt><code>--eci=INTEGER</code></dt>
  8899. <dd>
  8900. <p>Set the ECI code for the input data to <em>INTEGER</em>. See
  8901. <code>-e</code> | <code>--ecinos</code> for a list of the ECIs
  8902. available. ECIs are supported by Aztec Code, Code One, Data Matrix,
  8903. DotCode, Grid Matrix, Han Xin Code, MaxiCode, MicroPDF417, PDF417, QR
  8904. Code, rMQR and Ultracode.</p>
  8905. </dd>
  8906. <dt><code>--embedfont</code></dt>
  8907. <dd>
  8908. <p>For vector output, embed the font in the file for portability.
  8909. Currently only available for SVG output.</p>
  8910. </dd>
  8911. <dt><code>--esc</code></dt>
  8912. <dd>
  8913. <p>Process escape characters in the input data. The escape sequences
  8914. are:</p>
  8915. <pre><code>\0 (0x00) NUL Null character
  8916. \E (0x04) EOT End of Transmission
  8917. \a (0x07) BEL Bell
  8918. \b (0x08) BS Backspace
  8919. \t (0x09) HT Horizontal Tab
  8920. \n (0x0A) LF Line Feed
  8921. \v (0x0B) VT Vertical Tab
  8922. \f (0x0C) FF Form Feed
  8923. \r (0x0D) CR Carriage Return
  8924. \e (0x1B) ESC Escape
  8925. \G (0x1D) GS Group Separator
  8926. \R (0x1E) RS Record Separator
  8927. \\ (0x5C) \ Backslash
  8928. \dNNN (NNN) Any 8-bit character where NNN is
  8929. decimal (000-255)
  8930. \oNNN (0oNNN) Any 8-bit character where NNN is
  8931. octal (000-377)
  8932. \xNN (0xNN) Any 8-bit character where NN is
  8933. hexadecimal (00-FF)
  8934. \uNNNN (U+NNNN) Any 16-bit Unicode BMP character
  8935. where NNNN is hexadecimal
  8936. \UNNNNNN (U+NNNNNN) Any 21-bit Unicode character
  8937. where NNNNNN is hexadecimal</code></pre>
  8938. </dd>
  8939. <dt><code>--extraesc</code></dt>
  8940. <dd>
  8941. <p>For Code 128 only, as well as processing the normal escape sequences
  8942. above, process the special escape sequences <code>\^A</code>,
  8943. <code>\^B</code>, <code>\^C</code> and <code>\^@</code> that allow
  8944. manual switching of Code Sets, and the special escape sequence
  8945. <code>\^1</code> that inserts an <code>FNC1</code> character. The
  8946. sequence <code>\@</code> turns off manual switching. The sequence
  8947. <code>\^^</code> can be used to encode data that contains special escape
  8948. sequences.</p>
  8949. </dd>
  8950. <dt><code>--fast</code></dt>
  8951. <dd>
  8952. <p>Use faster if less optimal encodation or other shortcuts (affects
  8953. Data Matrix, MicroPDF417, PDF417, QRCODE &amp; UPNQR only).</p>
  8954. </dd>
  8955. <dt><code>--fg=COLOUR</code></dt>
  8956. <dd>
  8957. <p>Specify a foreground (ink) colour where <em>COLOUR</em> is in
  8958. hexadecimal <code>RRGGBB</code> or <code>RRGGBBAA</code> format or in
  8959. decimal <code>C,M,Y,K</code> percentages format.</p>
  8960. </dd>
  8961. <dt><code>--filetype=TYPE</code></dt>
  8962. <dd>
  8963. <p>Set the output file type to <em>TYPE</em>, which is one of
  8964. <code>BMP</code>, <code>EMF</code>, <code>EPS</code>, <code>GIF</code>,
  8965. <code>PCX</code>, <code>PNG</code>, <code>SVG</code>, <code>TIF</code>,
  8966. <code>TXT</code>.</p>
  8967. </dd>
  8968. <dt><code>--fullmultibyte</code></dt>
  8969. <dd>
  8970. <p>Use the multibyte modes of Grid Matrix, Han Xin and QR Code for
  8971. non-ASCII data.</p>
  8972. </dd>
  8973. <dt><code>--gs1</code></dt>
  8974. <dd>
  8975. <p>Treat input as GS1 compatible data. Application Identifiers (AIs)
  8976. should be placed in square brackets <code>"[]"</code> (but see
  8977. <code>--gs1parens</code>).</p>
  8978. </dd>
  8979. <dt><code>--gs1nocheck</code></dt>
  8980. <dd>
  8981. <p>Do not check the validity of GS1 data.</p>
  8982. </dd>
  8983. <dt><code>--gs1parens</code></dt>
  8984. <dd>
  8985. <p>Process parentheses <code>"()"</code> as GS1 AI delimiters, rather
  8986. than square brackets <code>"[]"</code>. The input data must not
  8987. otherwise contain parentheses.</p>
  8988. </dd>
  8989. <dt><code>--gssep</code></dt>
  8990. <dd>
  8991. <p>For Data Matrix in GS1 mode, use <code>GS</code> (0x1D) as the GS1
  8992. data separator instead of <code>FNC1</code>.</p>
  8993. </dd>
  8994. <dt><code>--guarddescent=NUMBER</code></dt>
  8995. <dd>
  8996. <p>For EAN/UPC symbols, set the height the guard bars descend below the
  8997. main bars, where <em>NUMBER</em> is in X-dimensions. <em>NUMBER</em> may
  8998. be floating-point.</p>
  8999. </dd>
  9000. <dt><code>--guardwhitespace</code></dt>
  9001. <dd>
  9002. <p>For EAN/UPC symbols, add quiet zone indicators <code>"&lt;"</code>
  9003. and/or <code>"&gt;"</code> to HRT where applicable.</p>
  9004. </dd>
  9005. <dt><code>--height=NUMBER</code></dt>
  9006. <dd>
  9007. <p>Set the height of the symbol in X-dimensions. <em>NUMBER</em> may be
  9008. floating-point.</p>
  9009. </dd>
  9010. <dt><code>--heightperrow</code></dt>
  9011. <dd>
  9012. <p>Treat height as per-row. Affects Codablock-F, Code 16K, Code 49, GS1
  9013. DataBar Expanded Stacked (DBAR_EXPSTK), MicroPDF417 and PDF417.</p>
  9014. </dd>
  9015. <dt><code>-i</code>, <code>--input=FILE</code></dt>
  9016. <dd>
  9017. <p>Read the input data from <em>FILE</em>. Specify a single hyphen
  9018. (<code>-</code>) for <em>FILE</em> to read from stdin.</p>
  9019. </dd>
  9020. <dt><code>--init</code></dt>
  9021. <dd>
  9022. <p>Create a Reader Initialisation (Programming) symbol.</p>
  9023. </dd>
  9024. <dt><code>--mask=INTEGER</code></dt>
  9025. <dd>
  9026. <p>Set the masking pattern to use for DotCode, Han Xin or QR Code to
  9027. <em>INTEGER</em>, overriding the automatic selection.</p>
  9028. </dd>
  9029. <dt><code>--mirror</code></dt>
  9030. <dd>
  9031. <p>Use the batch data to determine the filename in batch mode
  9032. (<code>--batch</code>). The <code>-o</code> | <code>--output</code>
  9033. option can be used to specify an output directory (any filename will be
  9034. ignored).</p>
  9035. </dd>
  9036. <dt><code>--mode=INTEGER</code></dt>
  9037. <dd>
  9038. <p>For MaxiCode and GS1 Composite symbols, set the encoding mode to
  9039. <em>INTEGER</em>.</p>
  9040. <p>For MaxiCode (SCM is Structured Carrier Message, with 3 fields:
  9041. postcode, 3-digit ISO 3166-1 country code, 3-digit service code):</p>
  9042. <pre><code>2 SCM with 9-digit numeric postcode
  9043. 3 SCM with 6-character alphanumeric postcode
  9044. 4 Enhanced ECC for the primary part of the message
  9045. 5 Enhanced ECC for all of the message
  9046. 6 Reader Initialisation (Programming)</code></pre>
  9047. <p>For GS1 Composite symbols (names end in <code>_CC</code>,
  9048. i.e. EANX_CC, GS1_128_CC, DBAR_OMN_CC etc.):</p>
  9049. <pre><code>1 CC-A
  9050. 2 CC-B
  9051. 3 CC-C (GS1_128_CC only)</code></pre>
  9052. </dd>
  9053. <dt><code>--nobackground</code></dt>
  9054. <dd>
  9055. <p>Remove the background colour (EMF, EPS, GIF, PNG, SVG and TIF
  9056. only).</p>
  9057. </dd>
  9058. <dt><code>--noquietzones</code></dt>
  9059. <dd>
  9060. <p>Disable any quiet zones for symbols that define them by default.</p>
  9061. </dd>
  9062. <dt><code>--notext</code></dt>
  9063. <dd>
  9064. <p>Remove the Human Readable Text (HRT).</p>
  9065. </dd>
  9066. <dt><code>-o</code>, <code>--output=FILE</code></dt>
  9067. <dd>
  9068. <p>Send the output to <em>FILE</em>. When not in batch mode, the default
  9069. is “out.png” (or “out.gif” if zint built without PNG support). When in
  9070. batch mode (<code>--batch</code>), special characters can be used to
  9071. format the output filenames:</p>
  9072. <pre><code>~ Insert a number or 0
  9073. # Insert a number or space
  9074. @ Insert a number or * (+ on Windows)
  9075. Any other Insert literally</code></pre>
  9076. </dd>
  9077. <dt><code>--primary=STRING</code></dt>
  9078. <dd>
  9079. <p>For MaxiCode, set the content of the primary message. For GS1
  9080. Composite symbols, set the content of the linear symbol.</p>
  9081. </dd>
  9082. <dt><code>--quietzones</code></dt>
  9083. <dd>
  9084. <p>Add compliant quiet zones for symbols that specify them. This is in
  9085. addition to any whitespace specified by <code>-w</code> |
  9086. <code>--whitesp</code> or <code>--vwhitesp</code>.</p>
  9087. </dd>
  9088. <dt><code>-r</code>, <code>--reverse</code></dt>
  9089. <dd>
  9090. <p>Reverse the foreground and background colours (white on black). Known
  9091. as “reflectance reversal” or “reversed reflectance”.</p>
  9092. </dd>
  9093. <dt><code>--rotate=INTEGER</code></dt>
  9094. <dd>
  9095. <p>Rotate the symbol by <em>INTEGER</em> degrees, where <em>INTEGER</em>
  9096. can be 0, 90, 270 or 360.</p>
  9097. </dd>
  9098. <dt><code>--rows=INTEGER</code></dt>
  9099. <dd>
  9100. <p>Set the number of rows for Codablock-F or PDF417 to <em>INTEGER</em>.
  9101. It will also set the minimum number of rows for Code 16K or Code 49, and
  9102. the maximum number of rows for GS1 DataBar Expanded Stacked
  9103. (DBAR_EXPSTK).</p>
  9104. </dd>
  9105. <dt><code>--scale=NUMBER</code></dt>
  9106. <dd>
  9107. <p>Adjust the size of the X-dimension. <em>NUMBER</em> may be
  9108. floating-point, and is multiplied by 2 (except for MaxiCode) before
  9109. being applied. The default scale is 1.</p>
  9110. <p>For MaxiCode, the scale is multiplied by 10 for raster output, by 40
  9111. for EMF output, and by 2 otherwise.</p>
  9112. <p>Increments of 0.5 (half-integers) are recommended for non-MaxiCode
  9113. raster output (BMP, GIF, PCX, PNG and TIF).</p>
  9114. <p>See also <code>--scalexdimdp</code> below.</p>
  9115. </dd>
  9116. <dt><code>--scalexdimdp=X[,R]</code></dt>
  9117. <dd>
  9118. <p>Scale the image according to X-dimension <em>X</em> and resolution
  9119. <em>R</em>, where <em>X</em> is in mm and <em>R</em> is in dpmm (dots
  9120. per mm). <em>X</em> and <em>R</em> may be floating-point. <em>R</em> is
  9121. optional and defaults to 12 dpmm (approximately 300 dpi). <em>X</em> may
  9122. be zero in which case a symbology-specific default is used.</p>
  9123. <p>The scaling takes into account the output filetype, and deals with
  9124. all the details mentioned above. Units may be specified for <em>X</em>
  9125. by appending “in” (inch) or “mm”, and for <em>R</em> by appending “dpi”
  9126. (dots per inch) or “dpmm” -
  9127. e.g. <code>--scalexdimdp=0.013in,300dpi</code>.</p>
  9128. </dd>
  9129. <dt><code>--scmvv=INTEGER</code></dt>
  9130. <dd>
  9131. <p>For MaxiCode, prefix the Structured Carrier Message (SCM) with
  9132. <code>"[)&gt;\R01\Gvv"</code>, where <code>vv</code> is a 2-digit
  9133. <em>INTEGER</em>.</p>
  9134. </dd>
  9135. <dt><code>--secure=INTEGER</code></dt>
  9136. <dd>
  9137. <p>Set the error correction level (ECC) to <em>INTEGER</em>. The meaning
  9138. is specific to the following matrix symbols (all except PDF417 are
  9139. approximate):</p>
  9140. <pre><code>Aztec Code 1 to 4 (10%, 23%, 36%, 50%)
  9141. Grid Matrix 1 to 5 (10% to 50%)
  9142. Han Xin 1 to 4 (8%, 15%, 23%, 30%)
  9143. Micro QR 1 to 3 (7%, 15%, 25%) (L, M, Q)
  9144. PDF417 0 to 8 (2^(INTEGER + 1) codewords)
  9145. QR Code 1 to 4 (7%, 15%, 25%, 30%) (L, M, Q, H)
  9146. rMQR 2 or 4 (15% or 30%) (M or H)
  9147. Ultracode 1 to 6 (0%, 5%, 9%, 17%, 25%, 33%)</code></pre>
  9148. </dd>
  9149. <dt><code>--segN=ECI,DATA</code></dt>
  9150. <dd>
  9151. <p>Set the <em>ECI</em> &amp; <em>DATA</em> content for segment N, where
  9152. N is 1 to 9. <code>-d</code> | <code>--data</code> must still be given,
  9153. and counts as segment 0, its ECI given by <code>--eci</code>. Segments
  9154. must be consecutive.</p>
  9155. </dd>
  9156. <dt><code>--separator=INTEGER</code></dt>
  9157. <dd>
  9158. <p>Set the height of row separator bars for stacked symbologies, where
  9159. <em>INTEGER</em> is in integral multiples of the X-dimension. The
  9160. default is zero.</p>
  9161. </dd>
  9162. <dt><code>--small</code></dt>
  9163. <dd>
  9164. <p>Use a smaller font for Human Readable Text (HRT).</p>
  9165. </dd>
  9166. <dt><code>--square</code></dt>
  9167. <dd>
  9168. <p>For Data Matrix symbols, exclude rectangular sizes when considering
  9169. automatic sizes. See also <code>--dmre</code>.</p>
  9170. </dd>
  9171. <dt><code>--structapp=I,C[,ID]</code></dt>
  9172. <dd>
  9173. <p>Set Structured Append info, where <em>I</em> is the 1-based index,
  9174. <em>C</em> is the total number of symbols in the sequence, and
  9175. <em>ID</em>, which is optional, is the identifier that all symbols in
  9176. the sequence share. Structured Append is supported by Aztec Code, Code
  9177. One, Data Matrix, DotCode, Grid Matrix, MaxiCode, MicroPDF417, PDF417,
  9178. QR Code and Ultracode.</p>
  9179. </dd>
  9180. <dt><code>-t</code>, <code>--types</code></dt>
  9181. <dd>
  9182. <p>Display the table of barcode types (symbologies). The numbers or
  9183. names can be used with <code>-b</code> | <code>--barcode</code>.</p>
  9184. </dd>
  9185. <dt><code>--textgap=NUMBER</code></dt>
  9186. <dd>
  9187. <p>Adjust the gap between the barcode and the Human Readable Text (HRT).
  9188. <em>NUMBER</em> is in X-dimensions, and may be floating-point. Maximum
  9189. is 10 and minimum is -5. The default is 1.</p>
  9190. </dd>
  9191. <dt><code>--vers=INTEGER</code></dt>
  9192. <dd>
  9193. <p>Set the symbol version (size, check digits, other options) to
  9194. <em>INTEGER</em>. The meaning is symbol-specific.</p>
  9195. <p>For most matrix symbols, it specifies size:</p>
  9196. <pre><code>Aztec Code 1 to 36 (1 to 4 compact)
  9197. 1 15x15 13 53x53 25 105x105
  9198. 2 19x19 14 57x57 26 109x109
  9199. 3 23x23 15 61x61 27 113x113
  9200. 4 27x27 16 67x67 28 117x117
  9201. 5 19x19 17 71x71 29 121x121
  9202. 6 23x23 18 75x75 30 125x125
  9203. 7 27x27 19 79x79 31 131x131
  9204. 8 31x31 20 83x83 32 135x135
  9205. 9 37x37 21 87x87 33 139x139
  9206. 10 41x41 22 91x91 34 143x143
  9207. 11 45x45 23 95x95 35 147x147
  9208. 12 49x49 24 101x101 36 151x151
  9209. Code One 1 to 10 (9 and 10 variable width) (WxH)
  9210. 1 16x18 6 70x76
  9211. 2 22x22 7 104x98
  9212. 3 28x28 8 148x134
  9213. 4 40x42 9 Wx8
  9214. 5 52x54 10 Wx16
  9215. Data Matrix 1 to 48 (31 to 48 DMRE) (HxW)
  9216. 1 10x10 17 72x72 33 8x80
  9217. 2 12x12 18 80x80 34 8x96
  9218. 3 14x14 19 88x88 35 8x120
  9219. 4 16x16 20 96x96 36 8x144
  9220. 5 18x18 21 104x104 37 12x64
  9221. 6 20x20 22 120x120 38 12x88
  9222. 7 22x22 23 132x132 39 16x64
  9223. 8 24x24 24 144x144 40 20x36
  9224. 9 26x26 25 8x18 41 20x44
  9225. 10 32x32 26 8x32 42 20x64
  9226. 11 36x36 28 12x26 43 22x48
  9227. 12 40x40 28 12x36 44 24x48
  9228. 13 44x44 29 16x36 45 24x64
  9229. 14 48x48 30 16x48 46 26x40
  9230. 15 52x52 31 8x48 47 26x48
  9231. 16 64x64 32 8x64 48 26x64
  9232. Grid Matrix 1 to 13
  9233. 1 18x18 6 78x78 11 138x138
  9234. 2 30x30 7 90x90 12 150x150
  9235. 3 42x42 8 102x102 13 162x162
  9236. 4 54x54 9 114x114
  9237. 5 66x66 10 126x126
  9238. Han Xin 1 to 84
  9239. 1 23x23 29 79x79 57 135x135
  9240. 2 25x25 30 81x81 58 137x137
  9241. 3 27x27 31 83x83 59 139x139
  9242. 4 29x29 32 85x85 60 141x141
  9243. 5 31x31 33 87x87 61 143x143
  9244. 6 33x33 34 89x89 62 145x145
  9245. 7 35x35 35 91x91 63 147x147
  9246. 8 37x37 36 93x93 64 149x149
  9247. 9 39x39 37 95x95 65 151x151
  9248. 10 41x41 38 97x97 66 153x153
  9249. 11 43x43 39 99x99 67 155x155
  9250. 12 45x45 40 101x101 68 157x157
  9251. 13 47x47 41 103x103 69 159x159
  9252. 14 49x49 42 105x105 70 161x161
  9253. 15 51x51 43 107x107 71 163x163
  9254. 16 53x53 44 109x109 72 165x165
  9255. 17 55x55 45 111x111 73 167x167
  9256. 18 57x57 46 113x113 74 169x169
  9257. 19 59x59 47 115x115 75 171x171
  9258. 20 61x61 48 117x117 76 173x173
  9259. 21 63x63 49 119x119 77 175x175
  9260. 22 65x65 50 121x121 78 177x177
  9261. 23 67x67 51 123x123 79 179x179
  9262. 24 69x69 52 125x125 80 181x181
  9263. 25 71x71 53 127x127 81 183x183
  9264. 26 73x73 54 129x129 82 185x185
  9265. 27 75x75 55 131x131 83 187x187
  9266. 28 77x77 56 133x133 84 189x189
  9267. Micro QR 1 to 4 (M1, M2, M3, M4)
  9268. 1 11x11 3 15x15
  9269. 2 13x13 4 17x17
  9270. QR Code 1 to 40
  9271. 1 21x21 15 77x77 29 133x133
  9272. 2 25x25 16 81x81 30 137x137
  9273. 3 29x29 17 85x85 31 141x141
  9274. 4 33x33 18 89x89 32 145x145
  9275. 5 37x37 19 93x93 33 149x149
  9276. 6 41x41 20 97x97 34 153x153
  9277. 7 45x45 21 101x101 35 157x157
  9278. 8 49x49 22 105x105 36 161x161
  9279. 9 53x53 23 109x109 37 165x165
  9280. 10 57x57 24 113x113 38 169x169
  9281. 11 61x61 25 117x117 39 173x173
  9282. 12 65x65 26 121x121 40 177x177
  9283. 13 69x69 27 125x125
  9284. 14 73x73 28 129x129
  9285. rMQR 1 to 38 (33 to 38 automatic width) (HxW)
  9286. 1 7x43 14 11x77 27 15x139
  9287. 2 7x59 15 11x99 28 17x43
  9288. 3 7x77 16 11x139 29 17x59
  9289. 4 7x99 17 13x27 30 17x77
  9290. 5 7x139 18 13x43 31 17x99
  9291. 6 9x43 19 13x59 32 17x139
  9292. 7 9x59 20 13x77 33 7xW
  9293. 8 9x77 21 13x99 34 9xW
  9294. 9 9x99 22 13x139 35 11xW
  9295. 10 9x139 23 15x43 36 13xW
  9296. 11 11x27 24 15x59 37 15xW
  9297. 12 11x43 25 15x77 38 17xW
  9298. 13 11x59 26 15x99</code></pre>
  9299. <p>For a number of linear symbols, it specifies check character options
  9300. (“hide” or “hidden” means don’t show in HRT, “visible” means do display
  9301. in HRT):</p>
  9302. <pre><code>C25IATA 1 or 2 (add visible or hidden check digit)
  9303. C25IND ditto
  9304. C25INTER ditto
  9305. C25LOGIC ditto
  9306. C25STANDARD ditto
  9307. Codabar 1 or 2 (add hidden or visible check digit)
  9308. Code 11 0 to 2 (2 visible check digits to none)
  9309. 0 (default 2 visible check digits)
  9310. 1 (1 visible check digit)
  9311. 2 (no check digits)
  9312. Code 39 1 or 2 (add visible or hidden check digit)
  9313. Code 93 1 (hide the default check characters)
  9314. EXCODE39 1 or 2 (add visible or hidden check digit)
  9315. LOGMARS 1 or 2 (add visible or hidden check digit)
  9316. MSI Plessey 0 to 6 (none to various visible options)
  9317. 1, 2 (mod-10, mod-10 + mod-10)
  9318. 3, 4 (mod-11 IBM, mod-11 IBM + mod-10)
  9319. 5, 6 (mod-11 NCR, mod-11 NCR + mod-10)
  9320. +10 (hide)</code></pre>
  9321. <p>For a few other symbologies, it specifies other characteristics:</p>
  9322. <pre><code>Channel Code 3 to 8 (no. of channels)
  9323. DAFT 50 to 900 (permille tracker ratio)
  9324. DPD 1 (relabel)
  9325. PZN 1 (PZN7 instead of default PZN8)
  9326. Ultracode 2 (revision 2)
  9327. VIN 1 (add international prefix)</code></pre>
  9328. </dd>
  9329. <dt><code>-v</code>, <code>--version</code></dt>
  9330. <dd>
  9331. <p>Display zint version.</p>
  9332. </dd>
  9333. <dt><code>--vwhitesp=INTEGER</code></dt>
  9334. <dd>
  9335. <p>Set the height of vertical whitespace above and below the barcode,
  9336. where <em>INTEGER</em> is in integral multiples of the X-dimension.</p>
  9337. </dd>
  9338. <dt><code>-w</code>, <code>--whitesp=INTEGER</code></dt>
  9339. <dd>
  9340. <p>Set the width of horizontal whitespace either side of the barcode,
  9341. where <em>INTEGER</em> is in integral multiples of the X-dimension.</p>
  9342. </dd>
  9343. <dt><code>--werror</code></dt>
  9344. <dd>
  9345. <p>Convert all warnings into errors.</p>
  9346. </dd>
  9347. </dl>
  9348. <h2 id="exit-status">EXIT STATUS</h2>
  9349. <dl>
  9350. <dt><code>0</code></dt>
  9351. <dd>
  9352. Success (including when given informational options <code>-h</code> |
  9353. <code>--help</code>, <code>-e</code> | <code>--ecinos</code>,
  9354. <code>-t</code> | <code>--types</code>, <code>-v</code> |
  9355. <code>--version</code>).
  9356. </dd>
  9357. <dt><code>1</code></dt>
  9358. <dd>
  9359. Human Readable Text was truncated (maximum 199 bytes)
  9360. (<code>ZINT_WARN_HRT_TRUNCATED</code>)
  9361. </dd>
  9362. <dt><code>2</code></dt>
  9363. <dd>
  9364. Invalid option given but overridden by Zint
  9365. (<code>ZINT_WARN_INVALID_OPTION</code>)
  9366. </dd>
  9367. <dt><code>3</code></dt>
  9368. <dd>
  9369. Automatic ECI inserted by Zint (<code>ZINT_WARN_USES_ECI</code>)
  9370. </dd>
  9371. <dt><code>4</code></dt>
  9372. <dd>
  9373. Symbol created not compliant with standards
  9374. (<code>ZINT_WARN_NONCOMPLIANT</code>)
  9375. </dd>
  9376. <dt><code>5</code></dt>
  9377. <dd>
  9378. Input data wrong length (<code>ZINT_ERROR_TOO_LONG</code>)
  9379. </dd>
  9380. <dt><code>6</code></dt>
  9381. <dd>
  9382. Input data incorrect (<code>ZINT_ERROR_INVALID_DATA</code>)
  9383. </dd>
  9384. <dt><code>7</code></dt>
  9385. <dd>
  9386. Input check digit incorrect (<code>ZINT_ERROR_INVALID_CHECK</code>)
  9387. </dd>
  9388. <dt><code>8</code></dt>
  9389. <dd>
  9390. Incorrect option given (<code>ZINT_ERROR_INVALID_OPTION</code>)
  9391. </dd>
  9392. <dt><code>9</code></dt>
  9393. <dd>
  9394. Internal error (should not happen)
  9395. (<code>ZINT_ERROR_ENCODING_PROBLEM</code>)
  9396. </dd>
  9397. <dt><code>10</code></dt>
  9398. <dd>
  9399. Error opening output file (<code>ZINT_ERROR_FILE_ACCESS</code>)
  9400. </dd>
  9401. <dt><code>11</code></dt>
  9402. <dd>
  9403. Memory allocation (malloc) failure (<code>ZINT_ERROR_MEMORY</code>)
  9404. </dd>
  9405. <dt><code>12</code></dt>
  9406. <dd>
  9407. Error writing to output file (<code>ZINT_ERROR_FILE_WRITE</code>)
  9408. </dd>
  9409. <dt><code>13</code></dt>
  9410. <dd>
  9411. Error counterpart of warning if <code>--werror</code> given
  9412. (<code>ZINT_ERROR_USES_ECI</code>)
  9413. </dd>
  9414. <dt><code>14</code></dt>
  9415. <dd>
  9416. Error counterpart of warning if <code>--werror</code> given
  9417. (<code>ZINT_ERROR_NONCOMPLIANT</code>)
  9418. </dd>
  9419. <dt><code>15</code></dt>
  9420. <dd>
  9421. Error counterpart of warning if <code>--werror</code> given
  9422. (<code>ZINT_ERROR_HRT_TRUNCATED</code>)
  9423. </dd>
  9424. </dl>
  9425. <h2 id="examples">EXAMPLES</h2>
  9426. <p>Create “out.png” (or “out.gif” if zint built without PNG support) in
  9427. the current directory, as a Code 128 symbol.</p>
  9428. <div class="sourceCode" id="cb135"><pre
  9429. class="sourceCode bash"><code class="sourceCode bash"><span id="cb135-1"><a href="#cb135-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&#39;This Text&#39;</span></span></code></pre></div>
  9430. <p>Create “qr.svg” in the current directory, as a QR Code symbol.</p>
  9431. <div class="sourceCode" id="cb136"><pre
  9432. class="sourceCode bash"><code class="sourceCode bash"><span id="cb136-1"><a href="#cb136-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> QRCode <span class="at">-d</span> <span class="st">&#39;This Text&#39;</span> <span class="at">-o</span> <span class="st">&#39;qr.svg&#39;</span></span></code></pre></div>
  9433. <p>Use batch mode to read from an input file “ean13nos.txt” containing a
  9434. list of 13-digit GTINs, each on a separate line, to create a series of
  9435. EAN-13 barcodes, formatting the output filenames to “ean001.gif”,
  9436. “ean002.gif” etc. using the special character “~”.</p>
  9437. <div class="sourceCode" id="cb137"><pre
  9438. class="sourceCode bash"><code class="sourceCode bash"><span id="cb137-1"><a href="#cb137-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">--batch</span> <span class="at">-i</span> <span class="st">&#39;ean13nos.txt&#39;</span> <span class="at">-o</span> <span class="st">&#39;ean~~~.gif&#39;</span></span></code></pre></div>
  9439. <h2 id="bugs">BUGS</h2>
  9440. <p>Please send bug reports to
  9441. https://sourceforge.net/p/zint/tickets/.</p>
  9442. <h2 id="see-also">SEE ALSO</h2>
  9443. <p>Full documention for <code>zint</code> (and the API
  9444. <code>libzint</code> and the GUI <code>zint-qt</code>) is available
  9445. from</p>
  9446. <pre><code> https://zint.org.uk/manual/</code></pre>
  9447. <p>and at</p>
  9448. <pre><code> https://sourceforge.net/p/zint/docs/manual.txt</code></pre>
  9449. <h2 id="conforming-to">CONFORMING TO</h2>
  9450. <p>Zint is designed to be compliant with a number of international
  9451. standards, including:</p>
  9452. <p>ISO/IEC 24778:2008, ANSI/AIM BC12-1998, EN 798:1996, AIM ISS-X-24
  9453. (1995), ISO/IEC 15417:2007, EN 12323:2005, ISO/IEC 16388:2007, ANSI/AIM
  9454. BC6-2000, ANSI/AIM BC5-1995, AIM USS Code One (1994), ISO/IEC
  9455. 16022:2006, ISO/IEC 21471:2019, ISO/IEC 15420:2009, AIMD014 (v 1.63)
  9456. (2008), ISO/IEC 24723:2010, ISO/IEC 24724:2011, ISO/IEC 20830:2021,
  9457. ISO/IEC 16390:2007, ISO/IEC 16023:2000, ISO/IEC 24728:2006, ISO/IEC
  9458. 15438:2015, ISO/IEC 18004:2015, ISO/IEC 23941:2022, AIM ITS/04-023
  9459. (2022)</p>
  9460. <h2 id="copyright">COPYRIGHT</h2>
  9461. <p>Copyright © 2024 Robin Stuart. Released under GNU GPL 3.0 or
  9462. later.</p>
  9463. <h2 id="author">AUTHOR</h2>
  9464. <p>Robin Stuart <a href="mailto:robin@zint.org.uk"
  9465. class="email">robin@zint.org.uk</a></p>
  9466. <section id="footnotes" class="footnotes footnotes-end-of-document"
  9467. role="doc-endnotes">
  9468. <hr />
  9469. <ol>
  9470. <li id="fn1"><p>See the Homebrew website <a
  9471. href="https://brew.sh">https://brew.sh</a>.<a href="#fnref1"
  9472. class="footnote-back" role="doc-backlink">↩︎</a></p></li>
  9473. <li id="fn2"><p>In Unicode contexts, BMP stands for Basic Multilingual
  9474. Plane, the plane 0 codeset from U+0000 to U+D7FF and U+E000 to U+FFFF
  9475. (i.e. excluding surrogates). Not to be confused with the Windows Bitmap
  9476. file format BMP!<a href="#fnref2" class="footnote-back"
  9477. role="doc-backlink">↩︎</a></p></li>
  9478. <li id="fn3"><p>The symbologies marked with an asterisk (<code>*</code>)
  9479. in Table <a href="#tbl:barcode_types">: Barcode Types (Symbologies)</a>
  9480. above used different names in Zint before version 2.9.0. For example,
  9481. symbology 29 used the name <code>BARCODE_RSS14</code>. These names are
  9482. now deprecated but are still recognised by Zint and will continue to be
  9483. supported in future versions.<a href="#fnref3" class="footnote-back"
  9484. role="doc-backlink">↩︎</a></p></li>
  9485. <li id="fn4"><p>The background is omitted for vector outputs EMF, EPS
  9486. and SVG when <code>--nobackground</code> is given. For raster outputs
  9487. GIF, PCX, PNG and TIF, the background’s alpha channel is set to zero
  9488. (fully transparent).<a href="#fnref4" class="footnote-back"
  9489. role="doc-backlink">↩︎</a></p></li>
  9490. <li id="fn5"><p>Shift JIS (JIS X 0201 Roman) re-maps two ASCII
  9491. characters: backslash (<code>\</code>) to the yen sign (¥), and tilde
  9492. (<code>~</code>) to overline (U+203E).<a href="#fnref5"
  9493. class="footnote-back" role="doc-backlink">↩︎</a></p></li>
  9494. <li id="fn6"><p>ISO/IEC 646 Invariant is a subset of ASCII with 12
  9495. characters undefined: <code>#</code>, <code>$</code>, <code>@</code>,
  9496. <code>[</code>, <code>\</code>, <code>]</code>, <code>^</code>,
  9497. <code>`</code>, <code>{</code>, <code>|</code>, <code>}</code>,
  9498. <code>~</code>.<a href="#fnref6" class="footnote-back"
  9499. role="doc-backlink">↩︎</a></p></li>
  9500. <li id="fn7"><p>BARCODE_MEMORY_FILE textual formats EPS and SVG will
  9501. have Unix newlines (LF) on both Windows and Unix, i.e. not CR+LF on
  9502. Windows.<a href="#fnref7" class="footnote-back"
  9503. role="doc-backlink">↩︎</a></p></li>
  9504. <li id="fn8"><p>The <code>height</code> value is ignored for Aztec
  9505. (including HIBC and Aztec Rune), Code One, Data Matrix (including HIBC),
  9506. DotCode, Grid Matrix, Han Xin, MaxiCode, QR Code (including HIBC, Micro
  9507. QR, rMQR and UPNQR), and Ultracode - all of which have a fixed
  9508. width-to-height ratio (or, in the case of Code One, a fixed height).<a
  9509. href="#fnref8" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
  9510. <li id="fn9"><p>For Windows, <code>outfile</code> is assumed to be UTF-8
  9511. encoded.<a href="#fnref9" class="footnote-back"
  9512. role="doc-backlink">↩︎</a></p></li>
  9513. <li id="fn10"><p>The <code>BARCODE_BIND_TOP</code> flag is set by
  9514. default for DPD - see <a href="#dpd-code">6.1.10.7 DPD Code</a>.<a
  9515. href="#fnref10" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
  9516. <li id="fn11"><p>The <code>BARCODE_BIND</code> flag is always set for
  9517. Codablock-F, Code 16K and Code 49. Special considerations apply to
  9518. ITF-14 - see <a href="#itf-14">6.1.2.6 ITF-14</a>.<a href="#fnref11"
  9519. class="footnote-back" role="doc-backlink">↩︎</a></p></li>
  9520. <li id="fn12"><p>Codablock-F, Code 16K, Code 49, EAN-2 to EAN-13, ISBN,
  9521. ITF-14, UPC-A and UPC-E have compliant quiet zones added by default.<a
  9522. href="#fnref12" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
  9523. <li id="fn13"><p><code>ZINT_CAP_EANUPC</code> was previously named
  9524. <code>ZINT_CAP_EXTENDABLE</code>, which is still recognised.<a
  9525. href="#fnref13" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
  9526. <li id="fn14"><p><code>BARCODE_CODE128AB</code> previously used the name
  9527. <code>BARCODE_CODE128B</code>, which is still recognised.<a
  9528. href="#fnref14" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
  9529. <li id="fn15"><p>The DX Number may be looked up in The (Modified) Big
  9530. Film Database at <a
  9531. href="https://thebigfilmdatabase.merinorus.com">https://thebigfilmdatabase.merinorus.com</a>.<a
  9532. href="#fnref15" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
  9533. </ol>
  9534. </section>
  9535. </body>
  9536. </html>