pax_global_header00006660000000000000000000000064123100747410014511gustar00rootroot0000000000000052 comment=2d533f9627b24760905cf92503115dc762426433 postscriptbarcode-2014-03-12/000077500000000000000000000000001231007474100156335ustar00rootroot00000000000000postscriptbarcode-2014-03-12/.gitignore000066400000000000000000000001541231007474100176230ustar00rootroot00000000000000src/*.d build/monolithic/ build/monolithic_package/ build/packaged_resource/ build/resource/ build/release/ postscriptbarcode-2014-03-12/.travis.yml000066400000000000000000000000641231007474100177440ustar00rootroot00000000000000language: bash script: make -j `nproc` && make test postscriptbarcode-2014-03-12/CHANGES000066400000000000000000000774731231007474100166500ustar00rootroot000000000000002014-03-12: * A bug in the calculation of the checksum of HIBC symbols was fixed. 2014-03-11: * Support was added for the GS1 QR Code symbology. * Input validation was added to the ISBN, ISMN and ISSN symbologies. 2014-01-30: * The ITF-14 encoder was amended to allow override of the height, borderleft, borderright and textyoffset properties. 2014-01-19: * VMusage was added to the DSC data. * DSC comments were added to the non-packaged resources. 2014-01-07: * The barcolor and backgroundcolor options were enabled for Maxicode symbols. 2014-01-06: * The renmatrix renderer has been updated to generate 2D symbols using paths. * The colour option for 2D symbols was renamed from "color" to "barcolor". 2014-01-03: * The arguments to the imagemask operator where changed to explicitly disable image interpolation. 2013-11-11: * Version bump after documentation cleanups. No functional changes. 2013-11-02: * Version bump for launchpad autobuild testing. No functional changes. 2013-10-31-1: * Update to Debian packaging for GitHub. No functional changes. 2013-10-31: * New signed release in git. No functional changes. 2013-10-06: * Support for C40, TEXT and X12 encodings was added to the Data Matrix symbology. 2013-07-15: * Removed the incomplete input validation from the Telepen symbology. 2013-06-12: * The REQUIRES metadata from databartruncated was fixed. 2013-06-07: * Input validation was added to the Flattermarken symbology. 2013-06-03: * Input validation was added to the Channel Code symbology. 2013-06-02-1: * Input validation was added to the HIBC Code 39, HIBC Code 128, HIBC Data Matrix, HIBC PDF417, HIBC MicroPDF417, HIBC QR Code and HIBC Codablock F symbologies. 2013-06-02: * Code 39 input validation was fixed. 2013-06-01-1: * Input validation was added to the USPS POSTNET and USPS PLANET symbologies. 2013-06-01: * Input validation was added to the KIX symbology. 2013-05-31: * Input validation was added to the RM4SCC symbology. 2013-05-30-3: * Input validation was added to the Plessey UK symbology. 2013-05-30-2: * Input validation was added to the GS1 DataBar Limited symbology. 2013-05-30-1: * Input validation was added to the GS1 DataBar Omnidirectional, GS1 DataBar Stacked, GS1 DataBar Stacked Omnidirectional and GS1 DataBar Truncated symbologies. 2013-05-30: * Input validation was added to the Codabar symbology. * An altstartstop option was added to the Codabar symbology. 2013-05-29-2: * Input validation was added to the symbol, raw and DAFT encoders. 2013-05-29-1: * Input validation was added to the Code 11 symbology. 2013-05-28-2: * Input validation was added to the Code 39 Extended symbology. 2013-05-28-1: * Input validation was added to the Code 39 symbology. 2013-05-28: * Input validation was added to the BC412 symbology. 2013-05-27-1: * The validatecheck option was fixed in the Code 2 of 5 symbology. 2013-05-27: * Input validation was added to the Pharmacode, Two-track Pharmacode and Code 2 of 5 symbologies. 2013-05-25: * Input validation was added to the EAN-14, SSCC-18, Italian Pharmacode and PZN symbologies. 2013-05-24-2: * The PREAMBLE section was changed into RESOURCE metadata. 2013-05-24-1: * The renderers are now included in the REQUIRES metadata. 2013-05-24: * Input validation was added to the Interleaved 2 of 5, ITF-14, Leitcode and Identcode symbologies. 2013-05-23: * Input validation was added to the EAN-13, EAN-8, UPC-A, UPC-E, EAN-5 and EAN-2 symbologies. 2013-05-22: * The EAN-8, UPC-A and UPC-E check digits are validated if provided. 2013-05-21: * The EAN-13 check digit is validated if provided. 2013-05-20-1: * The SUGGESTS metadata fields were changed to REQUIRES. 2013-05-20: * The initial error handling facility was added. 2013-05-19: * Fixed generic named resource definition when packed arrays are not available. 2013-02-27: * The ISSN encoder was modified to permit a five digit addon. 2013-01-25: * A bug in the generation of the mode message for Aztec Code symbols performing reader initialisation was fixed. 2013-01-17-1: * The isbnfont. isbnsize and isbnpos options were changed to isbntextfont, isbntextsize and isbntextyoffset respectively for the ISBN symbology. Similar changes were made to the ISMN and ISSN symbologies. * An isbntextxoffset option was added to the ISBN symbology. Similar changes were made to the ISMN and ISSN symbologies. 2013-01-17: * The textxalign option was enabled for EAN-13, EAN-8, UPC-A and UPC-E. * The addontextxoffset, addontextyoffset, addontextfont and addontextsize options were added for EAN-13, EAN-8, UPC-A and UPC-E. 2012-12-12: * The encoding of numeric data following an FNC1 codeword was fixed in the GS1 DataBar Expanded and GS1 Composite Component symbologies. 2012-11-15: * renlinear was modified to avoid a clash with a predefined name in Distiller. 2012-06-26: * The QR Code encoder was modified to opportunistically raise the error correction level when this does not increase the symbol size. * The QR Code encoder was modified to that Micro QR Code symbols do not require the use of raw mode. * The default error correction level for Micro QR Code symbols was changed to L. 2012-06-25: * The QR Code encoder was modified to select an optimal encoder based on the data. 2012-06-24: * A bug in the symbol size selection for QR Code was fixed. * The QR Code encoder was optimised by allowing the terminator pattern to be trimmed. 2012-06-23: * Support for the alphanumeric, numeric and kanji encodings was added to the qrcode encoder. 2012-04-26: * The PZN symbology was extended with support for PZN8. 2011-05-10: * The 1.5 scale factor was removed from the DataMatrix encoder. 2011-04-14-1: * Support for the GS1 Data Matrix symbology was added. 2011-04-14: * A bug in double digit ASCII encodation of the Data Matrix symbology was fixed. 2011-04-13: * The high level encoding for the Data Matrix symbology was changed from byte mode to ASCII mode. * The EDIFACT, C40, TEXT and X12 encodation schemes were removed from the Data Matrix symbology as these were buggy. * Support for FNC1 character as added to the Data Matrix symbology. 2011-03-21: * A bug in the options parsing for the symbol encoder was fixed. 2011-03-09: * The error correction code for Maxicode symbols was improved. 2011-03-07: * Codablock F was fixed for short data inputs. 2011-03-06: * Support for the Codablock F symbology was added. * Support for the HIBC Codablock F symbology was added. 2011-02-28-1: * The optimised encoding of Code 16K symbols was simplified. 2011-02-28: * The optimised encoding of Code 128 symbols was simplified and improved. 2011-02-24: * The optimised encoding of Code 128 symbols was improved. 2011-02-20: * Support for the extended datalength option was added to the Code 16K symbology. 2011-02-19: * Support for the Code 16K symbology was added. 2011-02-17: * The optimal start character selection for Code 128 symbols was improved. 2011-02-13: * Support for the Code 49 symbology was added. 2011-02-05: * Support for the Code One symbology was added. 2011-01-25-1: * The GS1 DataBar Expanded Composite and GS1 DataBar Expanded Stacked Composite symbologies were amended so that their separator patterns are correctly generated. 2011-01-25: * The GS1 DataBar Omnidirectional Composite, GS1 DataBar Stacked Composite, GS1 DataBar Stacked Omnidirectional Composite, GS1 DataBar Truncated symbologies were amended so that their separator patterns are correctly generated. 2011-01-22: * GS1-128 Composite was fixed so that the 2D component is correctly aligned. 2011-01-20: * Preliminary support for the GS1 DataBar Omnidirectional Composite, GS1 DataBar Stacked Composite, GS1 DataBar Stacked Omnidirectional Composite, GS1 DataBar Truncated, GS1 DataBar Limited, GS1 DataBar Expanded, GS1 DataBar Expanded Stacked symbologies were added. 2011-01-16: * The default height for the GS1-128 symbologies was changed. * Preliminary support for the GS1 DataBar Limited Composite symbology was added. 2011-01-15-1: * Preliminary support for the EAN-8 Composite, UPC-A Composite and UPC-E Composite symbologies was added. 2011-01-15: * Support for the GS1 Composite 2D components was added. * Preliminary support for the EAN-13 Composite symbology was added. 2011-01-14: * Renamed rss14 to databaromni, rsslimited to databarlimited, rssexpanded to databarexpanded. * Added convenience encoders for GS1 DataBar Stacked, GS1 DataBar Stacked Omnidirectional, GS1 DataBar Truncated and GS1 DataBar Expanded Stacked. 2011-01-07-1: * Support for the HIBC MicroPDF417 symbology was added. 2011-01-07: * Support for the MicroPDF417 symbology was added. 2010-12-24: * Support for CC-A/B amd CC-C composite linkage was added to the GS1-128 symbology. * The Code 128 symbology was extended with support for composite linkage pseudo characters. 2010-12-19-1: * PDF417 was amended to automatically select an appropriate number of columns when not provided. 2010-12-19: * The default error correction levels for PDF417 symbols were updated. 2010-12-17: * A bug in the encoding of the general purpose field ending in numeric mode of GS1 DataBar expanded symbols was fixed. 2010-12-08: * Renamed occurrences of alpha mode to alphanumeric in GS1 Databar Expanded symbology to disambiguate from the standard GS1 alpha encoding. 2010-12-06: * The list of FNC1 exempt GS-1 application identifiers was fixed in the GS1-128 and GS1 DataBar symbologies. 2010-12-03: * Fixed occurances of a bad programming paradigm that could result in the incorrect generation of certain symbols when including multiple instances. 2010-12-01-1: * Support for the Deutsche Post Leitcode Symbology was added. 2010-12-01: * Support for the Deutsche Post Identcode Symbology was added. 2010-11-29: * A checkoffset option was added to the posicode encoder to facilitate multirow symbols. 2010-11-28: * Support for the Flattermarken symbology was added. 2010-11-26: * Checksum support for the Channel Code encoder was added. 2010-11-22: * Support for the PosiCode symbology was added. 2010-11-18: * An option to use a short finder pattern was added to the Channel Code encoder. 2010-11-17: * Support for the Channel Code symbology was added. 2010-11-16: * Support for the HIBC Code 39, HIBC Code 128, HIBC Data Matrix, HIBC PDF417 and HIBC QR Code symbologies was added. 2010-11-15: * The efficiency of the Two-Track Pharmacode encoder was improved. 2010-11-10: * The escape sequences for the special shift characters were changed. * Support for the Code 93 Extended symbology was added. 2010-11-09: * Support for the Code 39 Extended symbology was added. 2010-11-07: * Support for the ITF-14 symbology was added. 2010-11-06-1: * Support for the SSCC-18 symbology was added. * Support for the GS1-14 symbology was added. 2010-11-06: * Support for the GS1-128 symbology was added. 2010-11-05: * The code128 encoder was modified to automatically encode the input. 2010-10-30: * Support for the Pharmazentralnummer (PZN) symbology was added. 2010-10-29-1: * The text parameters for EAN an UPC symbols are now applied to the addons. 2010-10-29: * A bug in the display of the ISSN check digit was fixed. 2010-10-28: * Support for Code 32 (Italian Pharmacode) was added. 2010-10-19: * Added daft encoder to make it easier to create miscellaneous symbols in a custom 4 state symbology. 2010-10-18-1: * Support was added to the Plessey symbology for the unidirectional variant. 2010-10-18: * Support for the BC412 symbology was added. 2010-10-11-1: * A bug in the calculation of the border height was fixed. * The example for Two-track Pharmacode was changes to display a border. 2010-10-11: * Support for the Two-track Pharmacode symbology was added. 2010-10-08-1: * Support for the ISSN symbology was added. 2010-10-08: * Support for the ISMN symbology was added. 2010-10-07: * The ISBN encoder was improved to upgrade ISBN-10 input to ISBN-13. 2010-10-05: * The code2of5 encoder was improved to support the IATA, matrix, COOP, and Datalogic versions of the symbology. 2010-10-04-1: * A bug was fixed that could allow the generation of invalid MSI symbols when using a modulus 11 check digit. 2010-10-04: * Support for the Telepen symbology was added. 2010-10-01: * A bug in the placement of human readable text for Plessey and MSI symbols was fixed. 2010-09-30-1: * The bar-space widths were amended for Plessey and MSI symbols were amended to better conform to their specifications. 2010-09-30: * A bug in the calculation of the checksum of Plessey symbols was fixed. 2010-09-27: * A bug in the calculation of the checksum of MSI symbols was fixed. * Additional checksum types where added to the MSI symbology. 2010-07-16-1: * A bug in the determination of the error correction level of PDF417 symbols was fixed. 2010-07-16: * A bug in the determination of the error correction level of PDF417 symbols was fixed. 2010-06-20: * A bug in QR Code mask evaluation was fixed. 2010-05-20: * Support for the USPS PLANET symbology was added. * An input handling bug in the USPS POSTNET encoder was fixed. 2010-01-27: * The list of FNC1 exempt application identifiers in GS1 DataBar Expanded was fixed. 2010-01-26: * A bug in the numeric encoding of the general purpose field of GS1 DataBar Expanded symbols was fixed. 2010-01-15: * Support for UPC-E1 was added to the upce encoder. 2010-01-05: * Converted to a set of PostScript named resources rather than a procedure list. 2009-11-15: * A bug in the symbol selection algorithm for QR Code was fixed. * Ensure that auto-encoding a micro-format QR Code symbol fails rather than produces a full-format symbol. 2009-11-06: * Convert interleaved2of5 encoder to use barratio and spaceratio to set the narrow to wide bar ratio. 2009-11-05: * Ensure that the UPC-E encoder does not fail silently when an invalid input is given. 2009-10-13: * Changed the barcode dict to pass an encoder reference rather than a procedure name. 2009-08-12: * A bug in the Reed-Solomon error correction routine for PDF417 was fixed. 2009-08-06-1: * A bug in the Code 11 start character was fixed. 2009-08-06: * A parse option was added to the pdf417, datamatrix, qrcode and azteccode encoders to allow input characters to be represented using ^NNN notation. 2009-07-31: * The rss14 and rsslimited encoders were amended to require the input to start with the (01) application identifier. * The rss14 andd rsslimited encoders were amended to automatically generate the human readable check digit if it is not supplied. 2009-07-30-1: * A bug affecting the padding of GS1 DataBar Expanded symbols was fixed. 2009-07-30: * An autoencoder was added to the GS1 DataBar Expanded encoder. * A finder pattern selection bug in GS1 DataBar Expanded symbols was fixed. * A check digit calculation bug in GS1 DataBar Expanded symbols was fixed. 2009-07-19: * Added support for GS1 DataBar Expanded Stacked to the rss14expanded encoder with option segments=2n. 2009-07-17: * A bug in the placement of the final finder pattern in GS1 DataBar Expanded symbols with an odd numer of segments was fixed. 2009-07-14: * The GS1 DataBar Limited default height was changed to match the minimum permitted height. 2009-07-12: * Added support for GS1 DataBar Truncated to the rss14 encoder with option format=truncated. * Added support for GS1 DataBar Stacked to the rss14 encoder with option format=stacked. * Added support for GS1 DataBar Stacked Omnidirectional to the rss14 encoder with option format=stackedomni. 2009-07-06-1: * Fixed bug in the padding of maxicode symbols where the data terminates in code set C, D or E. * Cleaned up the maxicode implementation by inlining the high-level encoding procedure. 2009-07-06: * The font height calculation performed by the linear renderer was improved. * The human readable text for OneCode symbols was improved to match the specification. 2009-07-03-2: * The pad characters from character set B were disambiguated. 2009-07-03-1: * A bug with the ordinal parser in the maxicode encoder was fixed. 2009-07-03: * An autoencoder was added to the maxicode encoder. 2009-06-22: * C40, TEXT and X12 encoders were added to datamatrix. 2009-06-21: * Added checksum support to ean8 encoder. * Fixed breakage in ean8 when includetext not in use. 2009-06-20-1: * Fix looping in datamatrix ASCII-mode encoder. 2009-06-20: * The ASCII-mode encoder for datamatrix was improved to compact pairs of digits. 2009-06-19: * An EDIFACT-mode autoencoder was added to the datamatrix encoder. 2009-06-03: * A byte-mode autoencoder was added to the datamatrix encoder and set as default. 2009-05-20: * A byte-mode-only autoencoder was added to the pdf417 encoder to simplify the use of the pdf417 encoder for common tasks. 2009-05-17: * A byte-mode-only autoencoder was added to the azteccode encoder to simplify the use of the azteccode encoder for common tasks. 2009-05-15: * A byte-mode-only autoencoder was added to the qrcode encoder to simplify the use of the qrcode encoder for common tasks. 2009-05-13: * An ASCII-mode-only autoencoder was added to the datamatrix encoder to simplify the use of the datamatrix encoder for common tasks. 2009-04-28: * Update the descriptions of the RSS symbologies to GS1 DataBar. 2009-03-16: * A textgaps option was added to adjust the inter-character gap in non-default text alignment modes for linear barcodes. * A justify mode was added to the textxalign option in linear barcodes. 2009-03-06: * The encoders were amended to automatically invoke the appropriate renderer. * The dispatcher procedure was removed. * A dontdraw option was added to each encoder to suppress automatic rendering. * The encoders were reordered by their dependancy chain and references to dependant procedures were changed to use immediately evalutated name syntax. 2009-02-26: * Minor fixups were made to the addon positioning. * The samples were amended to demonstrate the new dict option passing mechanism and alttext option. 2009-02-25-1: * The EAN-5 and EAN-2 addon encoders were folded into the EAN, UPC and ISBN encoders. 2009-02-25: * The options parser of each encoder was improved to also accept a dict of options. * An alttext option was added to the renlinear renderer which allows alternative human readable text to be specified. 2009-02-10: * Support for the JapanPost symbology was added. 2009-01-11: * The efficiency the RSS symbol generation was slightly improved. 2008-12-28: * The efficiency of Data Matrix symbol generation was further improved. 2008-12-27: * The efficiency of Data Matrix symbol generation was improved. 2008-12-26: * Minor efficiency improvements where made to the Reed-Solomon error correction routines. 2008-12-22: * The efficiency of the mask evaluation for full QR Code symbols was significantly improved. 2008-12-14: * A bug in the placement of error correction modules within 144x144 Data Matrix symbols was fixed. 2008-12-07: * Switched from the image operator to the imagemask operator for rendering of 2D matrix symbologies. * Support for color and backgroundcolor for 2D matrix symbologies was added. 2008-12-06-1: * The line caps are explicitly squared off to prevent interference from the environment. 2008-12-06: * The syntax for constructing the dictionary for passing the barcode paramaters to the renderer was updated. 2008-12-01: * Removed unnecessary DSC comment %%EndProlog. 2008-11-25: * The QR Code encoder was improved so that it performs mask evaluation for full mode symbols. 2008-11-16: * A bug introduced in version 2008-10-17 that resulted in incorrect checksum handling for UPC-E symbols was fixed. 2008-10-27: * The efficiency of the RSS symbologies was significantly improved. 2008-10-24: * The efficiency of the RSS symbologies was improved. 2008-10-17: * The ability to override the automatic checksum calculation for EAN-13, UPC-A, UPC-E and ISBN was removed. 2008-09-14: * Support for hiding the asterisks in the human readable text of Code 39 symbols was added. 2008-07-10: * The efficiency of the OneCode encoder was improved by replacing routines that generate tables of constants by the tables of constants themselves. 2008-04-06-1: * The Data Matrix encoder was shortened by replacing the list of all possible generator polynomials by a routine that derives only the required set. 2008-04-06: * The PDF417 encoder was shortened by replacing the list of all possible generator polynomials by a routine that derives only the required set. 2008-03-30-1: * The superfluous size option was removed from the QR Code encoder. 2008-03-30: * The QR Code encoder was amended to select full format symbols unless instructed otherwise. 2008-03-29: * Support for the QR Code 2D symbology was added. 2008-03-13: * Added support for FCC type 45 (Reply Paid Barcode) to the Auspost symbology. 2008-03-08: * A bug in the treatment of the human readable text when using special text alignment with Code 128C was fixed. 2008-03-01: * A bug in the check-bars calculation for the RSS Limited symbology was fixed. 2008-02-25: * Bugs in the Reduced Space Symbologies were fixed. 2008-02-17: * Support for the Aztec Code 2D symbology was added. 2008-02-15: * Fixed some occurances of a bad programming paradigm that could result in the incorrect generation of certain symbols when including multiple instances. 2008-01-25: * A bug in the generation of the pseudo-randomised padding characters for Data Matrix was corrected. 2008-01-19: * Fixed logic error that resulted in incorrect codeword lengths for modes 4, 5 and 6 in MaxiCode. 2008-01-15: * Support for the Data Matrix ECC200 2D symbology was added. 2008-01-02: * The PDF417 encoder was amended to opportunistically raise the error correction level if there is a better fit to the derived size of the matrix. 2008-01-01: * Support for the PDF417 2D symbology was added. 2007-12-21: * The ISBN encoder was slightly improved so that it generates the check digit even when the user does not omit the final dash. 2007-12-03: * Human readable text support was added to RSS-14, RSS Limited, OneCode and Pharmacode symbologies. * Default font and spacing for specifically aligned text was change to make it more consistant with default text placement. * A bug that made textxalign=left ineffective was fixed. 2007-12-01: * Added textxalign and textyalign options to control the positioning and formatting of human readable text. 2007-07-02: * Support for the MaxiCode 2D symbology was added. 2007-06-16: * Code was refactored to support multiple renderers. * Added parsable renderer field to each encoder. * Renderer for maxicode symbols was added, but there is no encoder for this yet. 2007-05-19: * Added parsable example options field to each encoder. 2007-05-18: * An encoder for the Pharmaceutical Binary Code symbology was added. 2007-04-22: * Added CMYK colorspace support. 2007-02-25: * Fixed incorrect checksum calculation for UPC-E symbols. 2006-09-26: * Added raw encoder to make it easier to create miscellaneous symbols in a custom symbology. 2006-09-14: * Functional comments were added to the head of the encoders to allow applications to extract the symbology name and example input data. 2006-05-26: * An encoder for the Reduced Space Symbology RSS Expanded was added. 2006-05-25: * The incorrect definition of the USPS FIM-B symbol was fixed. 2006-05-23: * An encoder for the Reduced Space Symbology RSS Limited was added. * The efficiency of RSS-14 was improved. 2006-05-22: * An encoder for the Reduced Space Symbology RSS-14 was added. 2006-05-16: * An encoder for the new OneCode symbology used by the US Postal Service was added. 2006-03-04: * The FIM symbols now render according to their specification. 2006-03-03: * The Postnet, Royal Mail, AusPost and KIX encoders were amended so that the metrics of their default symbols confirms strongly to their respective specifications. 2006-03-02: * The encoders now pass an array containing the widths of the bar space succession to the renderer allowing for sub-point horizontal precision. 2006-01-19: * The default border positions for EAN and UPC symbols were amended to properly enclose the human readable text. 2006-01-18: * The colour support code was fixed to prevent overwriting of the current colour when values are left unspecified. 2006-01-17: * The logic to guard whitespace in EAN symbols was migrated from the encoders to the renderer. * The whitespace guard symbols are now drawn directly making them independant of any font. * The inter-guard bar height of EANs and UPCs was amended. 2006-01-16: * The renderer was amended to support the passing of encoder specific arguments. 2006-01-08: * The options barcolor, textcolor, bordercolor, showbackground and backgroundcolor were added to the renderer. * A flaw in the derivation of the top border height was fixed. 2005-12-17: * The renderer was amended to plot symbols from the current point rather than the origin. 2005-11-01: * The performance of the renderer was improved by avoiding unnecessary calls of setfont. 2005-10-28: * The auspost encoder was extended to support the customer information field. 2005-10-24: * A new encoder for the barcodes used by the Australian Postal Service was added. 2005-10-17: * A checksum was added to the Code 2 of 5 encoder. 2005-10-16: * A checksum was added to the Code 11 encoder. 2005-10-14: * A new renderer option was added that forces any symbol to a user supplied width. 2005-09-26: * A new encoder was added to support the generation of miscellaneous symbols. * Support for generation of FIM symbols used on US Postal service reply mail was added. 2005-09-15: * A new encoder for the KIX symbology used by the Dutch postal service was added. 2005-09-12: * Options were added that allow precise adjustments to be made to the ratio of bar widths and space widths. 2005-09-11: * Placement problems with the border of EAN-2 and EAN-5 symbols have been fixed by amending the baseline of the bars. 2005-09-10: * The options required to enable a customisable border around any barcode symbol were added to the renderer. 2005-09-08: * An options parser was added to the renderer. * Each renderer was modified to pass a copy of its user-defined options to the renderer. * A new user-definable option called inkspread that reduces the width of the bars was added to the renderer. 2005-08-08: * The options parser for each of the encoders was upgraded to remove the 30 character size limitation from individual options within a given option string. 2005-08-07: * The ISBN encoder was upgraded to support the emerging ISBN-13 symbology. 2005-08-02: * PostScript and PDF documentation is now created using the new pst-barcode LaTeX package to generate the barcode images. 2005-06-21: * The isbnfont, isbnsize, and isbnpos options were added to allow the independant manipulation of the upper part of the human readable text within the ISBN symbology. 2005-06-09: * A minor fix was made to the positioning of human readable text within the Code 128 symbology. 2005-06-06: * Optional whitespace guards have been added to the human readable text of EAN barcodes. * The position of the first character of EAN-13s has been adjusted to guard the whitespace to the left of the bars. 2005-05-10: * The ability to allow the code to remain resident within most printer's PostScript virtual machines, until a hard reset is performed, was added. 2005-04-12: * The default textpos for EAN-2 and EAN-5 was changed so that it is now a function of the supplied height. * Delimiter comments were added around the encoders so that the file can be easily parsed as a template. 2005-04-09: * Delimiters were added around individual encoders to simplify parsing. 2005-03-29: * A bug in the calculation of Code 93 barcode length when using extended full ASCII characters was fixed. 2005-03-21: * Support for the Royal Mail/RM4SCC symbology was added. * A minor fix was made to the positioning of human readable text in the PostNet symbology. 2005-03-05: * The Postnet encoder was amended to generate correctly proportioned bars. 2005-02-28: * A bug that resulted in the incorrect generation of Code 93 check digits for data exceeding 15 characters in length was fixed. 2005-02-03: * A user option to override the default barcode height was added. 2005-02-01: * The option passing mechanism was improved to allow the user to override many default variables. 2005-01-25: * Human readable text was added to the remaining encoders. * Support for a string of options to enable or disable features of an encoder for each barcode instance was added. 2005-01-22: * Human readable text, with an option to suppress display of the check digit, was added to Code-39, Interleaved 2 of 5, and Postnet symbologies. * The ability to suppress human readable text to EANs, UPCs, ISBN, and all other symbologies that show text was added. * Encoders now pass font information to the renderer. * The encoders were restructured to prepare for the passing of switches to enable or disable features of the encoder. 2005-01-19: * The ability to suppress checkdigit for codabar, code39, code93, and interleaved 2 of 5 symbologies was added. 2005-01-05: * Support for Code 93 and Code 11 was added. * A checksum was added to Code 39 and Interleaved 2 of 5. * Incorrect generation of X human readable check-digit for ISBN was fixed. 2005-01-02: * This release adds support for the EAN-2 and EAN-5 (the EAN/UPC add-ons) symbologies, MSI symbology, and Plessey symbology. * The narrow:wide ratio for Code 2 of 5 has been changed. 2004-12-29: * This release fixes the incorrect generation of Code 128 check digits. 2004-12-27: * This release adds a code128 encoder that fully supports character alphabets A, B, and C. This allows for UCC/EAN-128 support. * The obsolete code128b encoder has been dropped. 2004-12-24: * This release fixes a bug in code128b where first ^ character in string of available characters should be &. 2004-12-21: * The Supported Symbologies section of the documentation was enhanced to include samples of all the supported barcode types. 2004-12-14: * Incorrect generation of human-readable check digits for the ISBN encoder was fixed and the documentation was updated with an example of use from within Perl. 2004-12-11: * Support for the ISBN barcode format was added. 2004-12-09: * Documentation is now available in PDF and HTML formats. * The orignal .tex files are shipped in the tarball. 2004-12-07: * Support for human readable text on the EAN and UPC formats was added. * Redundant code was removed from the UPC-A format. * Minor code cleanups were made. * A mailing list and support group is now available. 2004-12-04: * EANs and UPCs now have elongated guard bars. * The efficiency of the renderer was improved. * A bug that printed a tiny artifact at the bottom-left of barcodes was fixed. * All barcodes now default to 1 inch in height with a narrow bar width of 1 pt. 2004-12-03-1: * Support has been added for the Postnet barcode format. * The renderer has been improved to allow support for symbologies with variable height bars. 2004-12-03: * This version changes the renderer to accept a dictionary of arguments rather than an sbs string, so that it can have optional arguments such as text and bar heights passed to it. The encoders were upgraded accordingly. 2004-11-30: * Efficiency was improved by adding the bind operator to procedure definitions to make use of early operator resolution. 2004-11-26: * This release adds a PostScript file and a tarball on the homepage to ease downloading and patching. 2004-11-23: * This release added support for the UPC-E barcode format. 2004-11-21: * Support has been added for EAN-13, EAN-8, and UPC-A barcode formats. 2004-11-19: * This release adds support for printing the EAN-13 barcode format. * The software now supports EAN-13, Code 128-B, Code 39, Interleaved 2 of 5, Code 2 of 5, and Codabar. postscriptbarcode-2014-03-12/LICENSE000066400000000000000000000021641231007474100166430ustar00rootroot00000000000000Barcode Writer in Pure PostScript http://www.terryburton.co.uk/barcodewriter/ Copyright (c) 2004-2014 Terry Burton Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. postscriptbarcode-2014-03-12/Makefile000066400000000000000000000225611231007474100173010ustar00rootroot00000000000000# Barcode Writer in Pure PostScript # http://www.terryburton.co.uk/barcodewriter/ # # Copyright (c) 2004-2014 Terry Burton # # $Id$ SRCDIR = src DSTDIR = build VERSION_FILE=$(SRCDIR)/VERSION VERSION:=$(shell head -n 1 $(VERSION_FILE)) SOURCES:=$(wildcard $(SRCDIR)/*.ps) TARGETS:=$(basename $(notdir $(SOURCES))) TARGETS:=$(filter-out preamble, $(TARGETS)) UPR_FILE = $(SRCDIR)/uk.co.terryburton.bwipp.upr RESDIR = $(DSTDIR)/resource RESMKDIRS:=$(RESDIR) RESMKDIRS+=$(RESDIR)/Resource RESMKDIRS+=$(RESDIR)/Resource/Category RESMKDIRS+=$(RESDIR)/Resource/uk.co.terryburton.bwipp RESMKDIRSTAMP:=$(RESDIR)/.dirstamp TARGETS_RES:=$(addprefix $(RESDIR)/Resource/uk.co.terryburton.bwipp/,$(TARGETS)) TARGETS_RES+=$(RESDIR)/Resource/Category/uk.co.terryburton.bwipp TARGETS_RES+=$(RESDIR)/Resource/uk.co.terryburton.bwipp.upr TARGETS_RES+=$(RESDIR)/README TARGETS_RES+=$(RESDIR)/LICENSE TARGETS_RES+=$(RESDIR)/CHANGES TARGETS_RES+=$(RESDIR)/sample.ps cleanlist += $(TARGETS_RES) $(RESMKDIRSTAMP) PACKAGEDIR = $(DSTDIR)/packaged_resource PACKAGEMKDIRS:=$(PACKAGEDIR) PACKAGEMKDIRS+=$(PACKAGEDIR)/Resource PACKAGEMKDIRS+=$(PACKAGEDIR)/Resource/Category PACKAGEMKDIRS+=$(PACKAGEDIR)/Resource/uk.co.terryburton.bwipp PACKAGEMKDIRSTAMP:=$(PACKAGEDIR)/.dirstamp TARGETS_PACKAGE:=$(addprefix $(PACKAGEDIR)/Resource/uk.co.terryburton.bwipp/,$(TARGETS)) TARGETS_PACKAGE+=$(PACKAGEDIR)/Resource/Category/uk.co.terryburton.bwipp TARGETS_PACKAGE+=$(PACKAGEDIR)/Resource/uk.co.terryburton.bwipp.upr TARGETS_PACKAGE+=$(PACKAGEDIR)/README TARGETS_PACKAGE+=$(PACKAGEDIR)/LICENSE TARGETS_PACKAGE+=$(PACKAGEDIR)/CHANGES TARGETS_PACKAGE+=$(PACKAGEDIR)/sample.ps cleanlist += $(TARGETS_PACKAGE) $(PACKAGEMKDIRSTAMP) MONOLITHIC_DIR = $(DSTDIR)/monolithic MONOLITHIC_MKDIRS:=$(MONOLITHIC_DIR) MONOLITHIC_MKDIRSTAMP:=$(MONOLITHIC_DIR)/.dirstamp MONOLITHIC_FILE = $(MONOLITHIC_DIR)/barcode.ps MONOLITHIC_FILE_WITH_SAMPLE = $(MONOLITHIC_DIR)/barcode_with_sample.ps TARGETS_MONOLITHIC:=$(MONOLITHIC_FILE) $(MONOLITHIC_FILE_WITH_SAMPLE) TARGETS_MONOLITHIC+=$(MONOLITHIC_DIR)/README TARGETS_MONOLITHIC+=$(MONOLITHIC_DIR)/LICENSE TARGETS_MONOLITHIC+=$(MONOLITHIC_DIR)/CHANGES cleanlist += $(TARGETS_MONOLITHIC) $(MONOLITHIC_MKDIRSTAMP) MONOLITHIC_PACKAGE_DIR = $(DSTDIR)/monolithic_package MONOLITHIC_PACKAGE_MKDIRS:=$(MONOLITHIC_PACKAGE_DIR) MONOLITHIC_PACKAGE_MKDIRSTAMP:=$(MONOLITHIC_PACKAGE_DIR)/.dirstamp MONOLITHIC_PACKAGE_FILE = $(MONOLITHIC_PACKAGE_DIR)/barcode.ps MONOLITHIC_PACKAGE_FILE_WITH_SAMPLE = $(MONOLITHIC_PACKAGE_DIR)/barcode_with_sample.ps TARGETS_MONOLITHIC_PACKAGE:=$(MONOLITHIC_PACKAGE_FILE) $(MONOLITHIC_PACKAGE_FILE_WITH_SAMPLE) TARGETS_MONOLITHIC_PACKAGE+=$(MONOLITHIC_PACKAGE_DIR)/README TARGETS_MONOLITHIC_PACKAGE+=$(MONOLITHIC_PACKAGE_DIR)/LICENSE TARGETS_MONOLITHIC_PACKAGE+=$(MONOLITHIC_PACKAGE_DIR)/CHANGES cleanlist += $(TARGETS_MONOLITHIC_PACKAGE) $(MONOLITHIC_PACKAGE_MKDIRSTAMP) RELEASEDIR := $(DSTDIR)/release RELEASEMKDIRS:=$(RELEASEDIR) RELEASEMKDIRSTAMP:=$(RELEASEDIR)/.dirstamp RELEASE_RESOURCE_TARBALL := $(RELEASEDIR)/postscriptbarcode-resource-$(VERSION).tgz RELEASE_PACKAGED_RESOURCE_TARBALL := $(RELEASEDIR)/postscriptbarcode-packaged-resource-$(VERSION).tgz RELEASE_MONOLITHIC_TARBALL := $(RELEASEDIR)/postscriptbarcode-monolithic-$(VERSION).tgz RELEASE_MONOLITHIC_PACKAGE_TARBALL := $(RELEASEDIR)/postscriptbarcode-monolithic-package-$(VERSION).tgz RELEASE_RESOURCE_ZIPFILE := $(RELEASEDIR)/postscriptbarcode-resource-$(VERSION).zip RELEASE_PACKAGED_RESOURCE_ZIPFILE := $(RELEASEDIR)/postscriptbarcode-packaged-resource-$(VERSION).zip RELEASE_MONOLITHIC_ZIPFILE := $(RELEASEDIR)/postscriptbarcode-monolithic-$(VERSION).zip RELEASE_MONOLITHIC_PACKAGE_ZIPFILE := $(RELEASEDIR)/postscriptbarcode-monolithic-package-$(VERSION).zip RELEASE_SOURCE_TARBALL := $(RELEASEDIR)/postscriptbarcode-source-$(VERSION).tgz RELEASEFILES:=$(RELEASE_RESOURCE_TARBALL) $(RELEASE_PACKAGED_RESOURCE_TARBALL) $(RELEASE_MONOLITHIC_TARBALL) $(RELEASE_MONOLITHIC_PACKAGE_TARBALL) RELEASEFILES+=$(RELEASE_RESOURCE_ZIPFILE) $(RELEASE_PACKAGED_RESOURCE_ZIPFILE) $(RELEASE_MONOLITHIC_ZIPFILE) $(RELEASE_MONOLITHIC_PACKAGE_ZIPFILE) RELEASEFILES+=$(RELEASE_SOURCE_TARBALL) cleanlist += $(RELEASEFILES) $(RELEASEMKDIRSTAMP) #------------------------------------------------------------ .PHONY : all clean test resource packaged_resource monolithic monolithic_package release all: resource packaged_resource monolithic monolithic_package clean: $(RM) $(cleanlist) test: tests/run_tests $(SRCDIR)/%.d: $(SRCDIR)/%.ps $(UPR_FILE) $(DSTDIR)/make_deps $< $(addsuffix /Resource,$(RESDIR) $(PACKAGEDIR)) >$@ cleanlist += ${SOURCES:.ps=.d} ifneq "$(MAKECMDGOALS)" "clean" -include ${SOURCES:.ps=.d} endif #------------------------------------------------------------ resource: $(TARGETS_RES) $(RESMKDIRSTAMP): mkdir -p $(RESMKDIRS) touch $@ $(RESDIR)/Resource/uk.co.terryburton.bwipp/%: $(SRCDIR)/%.ps $(SRCDIR)/ps.head $(VERSION_FILE) $(RESMKDIRSTAMP) $(DSTDIR)/make_resource $< $@ $(RESDIR)/Resource/Category/uk.co.terryburton.bwipp: $(SRCDIR)/preamble.ps $(SRCDIR)/ps.head $(VERSION_FILE) $(RESMKDIRSTAMP) $(DSTDIR)/make_resource $< $@ $(RESDIR)/Resource/uk.co.terryburton.bwipp.upr: $(UPR_FILE) $(RESMKDIRSTAMP) cp $< $@ $(RESDIR)/README: $(SRCDIR)/README.resource $(RESMKDIRSTAMP) cp $< $@ $(RESDIR)/sample.ps: $(SRCDIR)/sample $(RESMKDIRSTAMP) cp $< $@ $(RESDIR)/LICENSE: LICENSE $(RESMKDIRSTAMP) cp $< $@ $(RESDIR)/CHANGES: CHANGES $(RESMKDIRSTAMP) cp $< $@ #------------------------------------------------------------ packaged_resource: $(TARGETS_PACKAGE) $(PACKAGEMKDIRSTAMP): mkdir -p $(PACKAGEMKDIRS) touch $@ $(PACKAGEDIR)/Resource/uk.co.terryburton.bwipp/%: $(SRCDIR)/%.ps $(SRCDIR)/ps.head $(VERSION_FILE) $(PACKAGEMKDIRSTAMP) $(DSTDIR)/make_resource $< $@ $(PACKAGEDIR)/Resource/Category/uk.co.terryburton.bwipp: $(SRCDIR)/preamble.ps $(SRCDIR)/ps.head $(VERSION_FILE) $(PACKAGEMKDIRSTAMP) $(DSTDIR)/make_resource $< $@ $(PACKAGEDIR)/Resource/uk.co.terryburton.bwipp.upr: $(UPR_FILE) $(PACKAGEMKDIRSTAMP) cp $< $@ $(PACKAGEDIR)/README: $(SRCDIR)/README.resource $(PACKAGEMKDIRSTAMP) cp $< $@ $(PACKAGEDIR)/sample.ps: $(SRCDIR)/sample $(PACKAGEMKDIRSTAMP) cp $< $@ $(PACKAGEDIR)/LICENSE: LICENSE $(PACKAGEMKDIRSTAMP) cp $< $@ $(PACKAGEDIR)/CHANGES: CHANGES $(PACKAGEMKDIRSTAMP) cp $< $@ #------------------------------------------------------------ monolithic: $(TARGETS_MONOLITHIC) $(MONOLITHIC_MKDIRSTAMP): mkdir -p $(MONOLITHIC_MKDIRS) touch $@ $(MONOLITHIC_FILE): $(TARGETS_RES) $(SRCDIR)/ps.head $(VERSION_FILE) $(UPR_FILE) $(MONOLITHIC_MKDIRSTAMP) $(DSTDIR)/make_monolithic $(RESDIR)/Resource >$@ $(MONOLITHIC_FILE_WITH_SAMPLE): $(MONOLITHIC_FILE) $(SRCDIR)/sample $(MONOLITHIC_MKDIRSTAMP) cat $(MONOLITHIC_FILE) $(SRCDIR)/sample > $@ $(MONOLITHIC_DIR)/README: $(SRCDIR)/README.monolithic $(MONOLITHIC_MKDIRSTAMP) cp $< $@ $(MONOLITHIC_DIR)/LICENSE: LICENSE $(MONOLITHIC_MKDIRSTAMP) cp $< $@ $(MONOLITHIC_DIR)/CHANGES: CHANGES $(MONOLITHIC_MKDIRSTAMP) cp $< $@ #------------------------------------------------------------ monolithic_package: $(TARGETS_MONOLITHIC_PACKAGE) $(MONOLITHIC_PACKAGE_MKDIRSTAMP): mkdir -p $(MONOLITHIC_PACKAGE_MKDIRS) touch $@ $(MONOLITHIC_PACKAGE_FILE): $(TARGETS_PACKAGE) $(SRCDIR)/ps.head $(VERSION_FILE) $(UPR_FILE) $(MONOLITHIC_PACKAGE_MKDIRSTAMP) $(DSTDIR)/make_monolithic $(PACKAGEDIR)/Resource >$@ $(MONOLITHIC_PACKAGE_FILE_WITH_SAMPLE): $(MONOLITHIC_PACKAGE_FILE) $(SRCDIR)/sample $(MONOLITHIC_PACKAGE_MKDIRSTAMP) cat $(MONOLITHIC_PACKAGE_FILE) $(SRCDIR)/sample > $@ $(MONOLITHIC_PACKAGE_DIR)/README: $(SRCDIR)/README.monolithic $(MONOLITHIC_PACKAGE_MKDIRSTAMP) cp $< $@ $(MONOLITHIC_PACKAGE_DIR)/LICENSE: LICENSE $(MONOLITHIC_PACKAGE_MKDIRSTAMP) cp $< $@ $(MONOLITHIC_PACKAGE_DIR)/CHANGES: CHANGES $(MONOLITHIC_PACKAGE_MKDIRSTAMP) cp $< $@ #------------------------------------------------------------ release: $(RELEASEFILES) $(RELEASEMKDIRSTAMP): mkdir -p $(RELEASEMKDIRS) touch $@ define TARBALL tar --exclude-vcs --exclude=.dirstamp --numeric-owner --owner=0 --group=0 --mtime=./$(VERSION_FILE) --transform='s,^$(DSTDIR)/,postscriptbarcode-$(VERSION)/,' -czf $@ $(1) endef define ZIPFILE $(RM) $@; FILE=`readlink -f $@` && cd $(1) && zip -q -X -x '*.dirstamp' -r $$FILE . endef $(RELEASE_RESOURCE_TARBALL): $(TARGETS_RES) $(VERSION_FILE) $(RELEASEMKDIRSTAMP) $(call TARBALL,$(RESDIR)) $(RELEASE_RESOURCE_ZIPFILE): $(TARGETS_RES) $(VERSION_FILE) $(RELEASEMKDIRSTAMP) $(call ZIPFILE,$(RESDIR)) $(RELEASE_PACKAGED_RESOURCE_TARBALL): $(TARGETS_PACKAGE) $(VERSION_FILE) $(RELEASEMKDIRSTAMP) $(call TARBALL,$(PACKAGEDIR)) $(RELEASE_PACKAGED_RESOURCE_ZIPFILE): $(TARGETS_PACKAGE) $(VERSION_FILE) $(RELEASEMKDIRSTAMP) $(call ZIPFILE,$(PACKAGEDIR)) $(RELEASE_MONOLITHIC_TARBALL): $(TARGETS_MONOLITHIC) $(VERSION_FILE) $(RELEASEMKDIRSTAMP) $(call TARBALL,$(MONOLITHIC_DIR)) $(RELEASE_MONOLITHIC_ZIPFILE): $(TARGETS_MONOLITHIC) $(VERSION_FILE) $(RELEASEMKDIRSTAMP) $(call ZIPFILE,$(MONOLITHIC_DIR)) $(RELEASE_MONOLITHIC_PACKAGE_TARBALL): $(TARGETS_MONOLITHIC_PACKAGE) $(VERSION_FILE) $(RELEASEMKDIRSTAMP) $(call TARBALL,$(MONOLITHIC_PACKAGE_DIR)) $(RELEASE_MONOLITHIC_PACKAGE_ZIPFILE): $(TARGETS_MONOLITHIC_PACKAGE) $(VERSION_FILE) $(RELEASEMKDIRSTAMP) $(call ZIPFILE,$(MONOLITHIC_PACKAGE_DIR)) $(RELEASE_SOURCE_TARBALL): $(VERSION_FILE) $(RELEASEMKDIRSTAMP) tar --exclude-vcs --exclude=$(RELEASEDIR) $(addprefix --exclude=,$(cleanlist)) --numeric-owner --owner=0 --group=0 --mtime=./$(VERSION_FILE) --transform='s,^.,postscriptbarcode-$(VERSION),' -czf $@ . postscriptbarcode-2014-03-12/README000066400000000000000000000062341231007474100165200ustar00rootroot00000000000000Barcode Writer in Pure PostScript Homepage: https://www.terryburton.co.uk/barcodewriter/ Documentation: https://code.google.com/p/postscriptbarcode/wiki/Symbologies Download: https://github.com/terryburton/postscriptbarcode/releases Source: https://github.com/terryburton/postscriptbarcode.git Mailing list: http://groups.google.co.uk/group/postscriptbarcode Blog: http://blog.terryburton.co.uk/search/label/bwipp About BWIPP Barcode Writer in Pure Postscript generates all barcode formats entirely within PostScript so that the process of converting the input data into the printed output can be performed by the printer or RIP itself. This is ideal for variable data printing (VDP) and avoids the need to re-implement the barcode generation process whenever your language needs change. Since this resource is written in PostScript and interpretted within the virtual machine of a printer it is compatible with any operating system and hardware platform. It makes including any barcode within a PostScript document as simple as inserting the following directive: 0 0 moveto (978-1-56581-231-4) (includetext) /isbn /uk.co.terryburton.bwipp findresource exec There is a web-based demonstration of the project here: http://www.terryburton.co.uk/barcodewriter/generator/ The Resources BWIPP is essentially a set of generic PostScript Level 2 named resources that are provided in four flavours for ease of use. The one to use depends on how you intend to deploy the library. "Packaged" or "unpackaged": The named resources have been packaged for DSC conformance, portability and ease of distribution. You will most likely want to use a packaged flavour in production, however the unpackaged versions of the resources are useful for understanding the code, developing the library and debugging. "Separate files" or "monolithic": The resource is provided as separate files that are formatted for direct use by Adobe Distiller, GhostScript, a printer hard disk or a document manager. The monolithic flavours contain all of the resources in a single file that is suitable for inclusion in the Prolog section of a PostScript document template or installing to a printer's initial job VM. This leads to the following set of four files. For production use: * postscriptbarcode-packaged-resource – Packaged; Separate files. * postscriptbarcode-monolithic-package – Packaged; Monolithic file. For BWIPP development: * postscriptbarcode-resource – Unpackaged; Seperate files. * postscriptbarcode-monolithic – Unpackaged; Monolithic file. Downloading You can download the prepared packages and the sources from here: https://github.com/terryburton/postscriptbarcode/releases Alternatively you can clone the repository: $ git clone https://github.com/terryburton/postscriptbarcode.git If you are using Ubuntu you can download the daily build of the trunk of BWIPP from PPA: $ sudo add-apt-repository ppa:postscriptbarcode-maintainers/ppa $ sudo apt-get update $ sudo apt-get install libpostscriptbarcode Building The build requirements are Perl, GNU Make and GhostScript. Just run make from the root of the source distribution. The flavours are built into subdirectories of the build/ directory. postscriptbarcode-2014-03-12/TODO000066400000000000000000000053371231007474100163330ustar00rootroot00000000000000Barcode Writer in Pure PostScript http://www.terryburton.co.uk/barcodewriter/ Copyright (c) 2004-2014 Terry Burton $Id$ This is the TODO list for BWIPP. If there is any feature (listed here or not) that you require or whose development you would like to assist with or sponsor, then either create or "bump" an entry in the project's issue tracker [1] or participate on the mailing list [2]. [1] http://code.google.com/p/postscriptbarcode/issues/list [2] http://groups.google.com/group/postscriptbarcode/topics TODO list: * PDF417 improvements o text o numeric o optimised encoding o reader init o ECI o MacroPDF * Aztec Code improvements o text o optimised encoding o FLG(n) * QR Code improvements o optimised encoding o SAM o ECI * Data Matrix improvements o optimised encoding o EDIFACT o SAM o ECI * MaxiCode improvements o ECI * Code 128 improvements o Suppress mode C o FNC4 extended ASCII * Code 16K improvements o FNC4 extended ASCII * DPD Code * Codablock F improvements o FNC4 extended ASCII o FNC1 mode * Code One improvements o optimised encoding * HIBC improvements o LIC and PAS structure parsing * PosiCode improvements o Stacked o FNC4 extended ASCII * CPC Binary * Canada Post * Korean Post * Grid Matrix * GS1 Composite o Fix method 10 encoding o Fix CC-C * imaging improvements o grid-fitting * input validation o general options o auspost o azteccode o codablockf o code128 o code16k o code49 o code93 o code93ext o codeone o databarexpanded o databarexpandedcomposite o databarexpandedstacked o databarexpandedstackedcomposite o databarlimitedcomposite o databaromnicomposite o databarstackedcomposite o databarstackedomnicomposite o databartruncatedcomposite o ean13composite o ean8composite o gs1-128 o gs1-128composite o gs1-cc o gs1datamatrix o japanpost o maxicode o micropdf417 o msi o onecode o pdf417 o posicode o qrcode o telepen o upcacomposite o upcecomposite o renlinear o renmatrix o renmaximatrix postscriptbarcode-2014-03-12/build/000077500000000000000000000000001231007474100167325ustar00rootroot00000000000000postscriptbarcode-2014-03-12/build/make_deps000077500000000000000000000016511231007474100206130ustar00rootroot00000000000000#!/usr/bin/perl -Tw # $Id$ use strict; my $srcfile=shift @ARGV || ''; open(SRC,$srcfile) || die "Unable to open source file: $srcfile"; my $src=join('',); close(SRC); open(UPR,'src/uk.co.terryburton.bwipp.upr') || die 'Unable to open UPR file'; my $upr=join('',); close(UPR); (my $begin, $_, my $resource, my $meta, $_, my $end)=$src=~/ (^%\ --BEGIN\ (ENCODER|RENDERER|RESOURCE)\ ([\w-]+?)--$) (.*?) (^[^%].*?) (^%\ --END\ \2\ \3--$) /msgx; $resource='uk.co.terryburton.bwipp' if $resource eq 'preamble'; (my $reqs)=$meta=~/^% --REQUIRES (.*)--$/mg; $reqs='' unless defined $reqs; (my $provfile)=$upr=~/^$resource=(.*)$/m; while (my $targetdir=shift @ARGV) { my $reqfiles="$targetdir/$provfile : "; foreach my $req (split /\s+/, $reqs) { $req='uk.co.terryburton.bwipp' if $req eq 'preamble'; (my $reqfile)=$upr=~/^$req=(.*)$/m; $reqfiles.="$targetdir/$reqfile "; } print "$reqfiles\n"; } postscriptbarcode-2014-03-12/build/make_monolithic000077500000000000000000000023761231007474100220320ustar00rootroot00000000000000#!/usr/bin/perl -Tw # $Id$ use strict; my $resourcedir=$ARGV[0] || ''; open(UPR,'src/uk.co.terryburton.bwipp.upr') || die 'Unable to open UPR file'; my $upr=join('',); close(UPR); open(VER,'src/VERSION') || die 'Unable to open VERSION'; my $version=join('',); close VER; chomp $version; open(HEAD,'src/ps.head') || die 'Unable to open ps.head'; my $head=join('',); close HEAD; $head=~s/XXXX-XX-XX/$version/; print $head; print "% --BEGIN TEMPLATE--\n\n"; while ($upr=~/^(.*)=(.*)$/mg) { my $srcfile="src/$1.ps"; $srcfile='src/preamble.ps' if $1 eq 'uk.co.terryburton.bwipp'; my $resfile="$resourcedir/$2"; open(SRC,$srcfile) || die "Unable to open source file: $srcfile"; my $src=join('',); close(SRC); (my $begin, $_, $_, my $meta, my $end)=$src=~/ (^%\ --BEGIN\ (ENCODER|RENDERER|RESOURCE)\ ([\w-]+?)--$) (.*?) ^[^%].*? (^%\ --END\ \2\ \3--$) /msgx; open(RES,$resfile) || die "Unable to open resource file: $resfile"; my $res=join('',); close(RES); $res=~/ (^%%BeginResource:\ [\w\.]+\ [\w\.-]+?\ .*?$) .* (^%%BeginData:.*?$ .* ^%%EndResource$) /msgx; my $body="$1\n$2\n"; print $begin; print $meta; print $body; print "$end\n\n"; } print "% --END TEMPLATE--\n"; postscriptbarcode-2014-03-12/build/make_packaged_resource.ps000066400000000000000000001520221231007474100237430ustar00rootroot00000000000000%!PS % ------------------8<------------------------8<-------------------------- % % The initial definitions in the file are from net.anastigmatix.Packager % and its supporting resources, by Chapman Flack. % % Information here: http://www.anastigmatix.net/postscript/Packager.html % %%BeginResource: procset net.anastigmatix.MetaPre 0.1 21 7700 28 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 5096 % Why MetaPre? Because it was inspired by other metaprogramming systems % like MetaML, it works as a kind of preprocessor, and the name MetaPost % was taken. % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 75 ASCII Lines currentfile /ASCII85Decode filter cvx exec 05b? C/n&X+F*),/D..O#GV2^%FCA!dAM6l#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``cf05PfJ+Dc4;L]NY>OuY0K/no3;A8,OqP!>*cOu"aE/o>0A@;p6uG_cDS05,'1AWf9@!g7\^ !g6ZKD..OLEdNs5@<dB9GH7!KpQJWKKq.0.p[C@s)XO5;+ZB A9Da.P!=AX%[)("hfE@NE+*6lBl7R104f0EDfTo@Df@@@G]7SAF>%3CEA(j6EA(p % net.anastigmatix.Packager 0.1 12 %%EndData %%EndResource %%BeginResource: Category net.anastigmatix.filter 0.1 7 4931 3498 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 3149 % User-definable filters for use with net.anastigmatix.StreamIO's extfilter. % Predefined in this category: % SourceArrayDecode SourceQueueDecode TapDecode StringQueueEncode TeeEncode % % See http://www.anastigmatix.net/postscript/StreamIO.html on how to % define new filters. Please use inverted-domain naming (com.example...) % for non-Anastigmatix filters to be distributed in this category. % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 49 ASCII Lines currentfile /ASCII85Decode filter cvx exec 05b?C/n&X+F*),/D..O#GV3TBCij6/010/iAS5q%Gp%-=F)Q2A@qB_'@@:X_J3/@Tu99M8j!0U!<5CJ\)Ou"aDDK Tc3GA (E,D In'7H ]i N7F cpm1 Fbg ']=G Qs( P')q1NW=KjG _cEa=HYY" !g 7PdG_c KcEK YQpOq*X 20.q -b Ci!` qF DbZ7 F>#: " DKTc3GA(E,DI n'7OuSV6 L]im ?L]il )P"_ #p0 .pgTAT3 !Z5* C& O5*C &:Oq* X20.ps[B4ZFG! KpQ@!g63 >5CJ\ )Ou" aDGA_LF 4? P9 *hN W>5Z 0/ "qhE +O !8P ')pIL] ET2P!=AXAH\ _]c =GR$ A9. qqNB ldouP !>*oOuSI%P&2 j*/nK!5E-mBAP$!M@P"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10/11 03:22:00 chap Exp $ %%EndData %%EndResource %%BeginResource: procset net.anastigmatix.StreamIO 0.1 15 9066 92 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 2294 % src tgt *copyfile* - % src|tgt dict name|proc *extfilter* file % src nbytes *flushn* - % src string *flushthru* - % proc bufsize *hold* queue nbytes % proc bs *holdfile* file nbytes % proc bs *holdstring* string % - *nullsrc* file % - *nulltgt* file % - *std{in,out,err}* file (these are procs, not file objects) % string *{r,w,a,r+,w+,a+}file* file % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. % test for the bug with flushfile on proc-based filters in HP's PS knockoff. % for some reason the test has to be here; if moved inside the packed part % it fails to detect the bug. { () } 0 () /SubFileDecode filter { flushfile } stopped dup { exch pop $error /newerror false put } if %%BeginData: 41 ASCII Lines currentfile /ASCII85Decode filter cvx exec 05b? C/n&X+F*),/D..O#GV2p:Eb/Zr8P_!9Ec5GdATT&8ATMd4Ear[%FCB9 6F*j'mL]W`O H] iN7+-K-BP#Qjm<%i-#F=q!>@<6O)B5M(!Bm;7)ATV?WEb -n# Ec5GdATX * hOq! 3iO u8C304np7FCfJ^Cisf4Anc'm6?Qq(5*@^3F`MM6D KKi +@r# drB8lq5A T Vm"@r# drB 9Ll+!Ku>EN<*=3P&Pb"0mk*JL]NZ@>p+MHL]ED7P 'D D<<0DB a!?cf-A T V?iBl7H7 : 3 CA h7; cUR A7^ qW @r-()AS, XmAV^>L 9 .smkCij 6/6 Yp[ ^AO :NP P!5 $bN Ws MS G:R ) PEb/ZiDf 0B:OuR fE" Gd,8 !f- o6!/ L]4" Gd)7!f- l5! /LZ( H]h' c5* @ mRL]V:.B 6%p5E- !.HAoD ]uC i#8 WP' )+)E \DV i@4u XO06 \p" @ 4QbQP!5$ bI?I/T Eb9$%A U? '`E fr_ :O q *X2 06_# BCh7 rH0 6` RFI?G)'1 G<0KBl% @ -0/$as 6% +n+ Ou"b 3.qWL3A U?'` E\! ;=I? G)'1 G#De*E%/UT3)Anc( 'ATC 7V F`V5 .Bl%?IF_? &JP1bWkNW:_2F ^dgSC h6"G@rGmhI=6HhI=78YHnCN7P"0q ;AT V ?iBl 7IE1G:@mB l%m:E+L.S4>0* 6@rGm hH[?keHluXV5$]:Y/Wr)L!0 U !<5 C J=fN W:_2F^dgS Ch6"G@rGmh+>% so04n p7 FCfJ^Cisf4Anc'm6?QpfH]m ' EV0U+F Gbs!0U!<5C G1[F_kk_DI[TqAUP\XD(dOp G\2 :UDIm oB@ ;]LpF D5B)@0'?F`);W"Hlk?6?QmPATC^`H=_mG%bT#ALh2.P!De*E404fBMAnc('ATEquP!4[&P$!l2P,4=$NW> 5ZH]ii+H]gR@P#[ZfP!3AlDf]K%Bl%@/Oq*X205,9?A7fOlAM5]MDers*FE2)5B8?PD.[!Jg1G Bl%?6@:j4iAM8'SA nc'm06\pYBl%?6@4Pr(Ch58@FC]*'06;5GDfp.TF*(r(EcNgNF_kl8Eapb?F_kl9B65e:DfBu6 Bl%?6Ao)U2BPoJ8Cisf4FD,];04fBMAnc('ATBG;Derr;BQ%]tAnc'm05,9?A92j5Bl7Q:Anc( 'ATC.SDf]JVF_<@>Bl%m&E^jkfF(f0"Ch5qUB71n6G]7SAF>%NCF=q!>@<6O)B5M(!Bm;7/FE1 r$D+RNd4tf`QDdu^WF % net.anastigmatix.Packager 0.1 12 %%EndData %%EndResource %%BeginResource: procset net.anastigmatix.BinaryIO 0.1 10 4068 2639 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 3068 % file *read{be,le}_{int32,int16,uint16}* int % file *read_{int,uint}8* int % file *read{be,le}_IEEE32* real % file int *write{be,le}_int{32,16}* - % file int *write_int8* - % file real *write{be,le}_IEEE32* - % file n *readn{be,le}_{int32,int16,uint16,IEEE32}* array % file string *readn* string (no short read-fills string or throws syntaxerror) % int *intbitstoreal* real real *realtointbits* int % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 50 ASCII Lines currentfile /ASCII85Decode filter cvx exec 05b?C/n&X+F*),/D..O#GV2P ') 2 "0/ "r! G \*%& I? ITY Oq*X2061 W4A7'%gF?"V#0 6 1W4 A7'I nD KIk $5 DT; q!K pQ> !.^ 48 P, XUbI?G)' 1G5 \#Ou P*JEb/Z i?Z g(#F ?#F JL^ 9. SP!1NPEb /Zi?Zg(#F?#F J P&bu6 %[& V$ Eb/Z iCh6 srB l8#I 2L CTH 0/ %?W@:W_f Bl8#PP!>*n0/ % ?W@:W _f Bl 8#PP != a .Oq 3^rI? G )'1 G0/ %?W@: W _fBl 8#P P!>+MI ?G)'1G0/%?W@:Wh Y?Z g(#F>5\:5 E^&8Oq*X2061W4 A8GgaBl8#K14,0D0/ %?W@:X1c?Zg(#F>5\:5E\2`061W4A8GgaF_P`8 0fG1ZL_,^[P&bu6%[&V$Eb/ZiDL7OqP&P b$Eb/ZiDD*XqF*M8Z5CJ\oI?G)'1G:@iE\r-!" d5^F3/@Qj"Gm)@LQZnF5)96&=GR!6"HlG 3061W4A8[PpP'(8WEcP`/FDkW'ARfgoDfT]'FG Kp[4aVtdF(KH3@VTIaFCoH3D..OLX,$asA TVj"C1UmsAoD^,@AR]4X Bl8#I2LC5]Or9 )NOq3 _g P.Z4+%[&V$GB.D>ASbpbBl8 #I2LC5]Or 9FqM "m,DP.Z 4+%[&V$GB. D>AR] 4XBl 8#K14+fYOr9)FOq03!GB.D> AR]4 XB l8#I 2Ng9X06_G NFCeom?YOD"0f G1ZI? G)'1 GG\!L]W _W0 / %N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,!ZZ@:X7lARB.hF>G[*Eb/ZiDIR0aBl8#I2D9)^@:X7lARB.hF>5[,Eb/ZiDIR0a8 OZ':1GUV(ART+eCh6sF77BX$1,!ZZ@;L%(Bl8$%BlnDLBl8$%BlnE5\%+D#e:DfTqQDImoB@;]LpFD5B)@ % net.anastigmatix.Packager 0.1 6 %%EndData %%EndResource %%BeginResource: procset net.anastigmatix.Markup 0.1 29 50351 28 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 3728 % Use \markup to turn PostScript inside out: instead of writing PostScript % code with (embedded strings of text), write text that reads naturally and % can contain \{embedded PostScript}. % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 49 ASCII Lines currentfile /ASCII85Decode filter cvx exec 0 5b?C/n &X+F*),/D..O#GV2 ^!Ebff:02Q\-@oHr\+ED%7Dfp)1ATMs%FEMYOP')Q^P% K '(+-K- BP#Qjm<%i-#F=q!> @<6O)B5M(!Bm;7)ATV?WEb-n#Ec5GdATX*hOptoDEcP` / FDtYuC M@[!N<+*3FDtYuCM @[!L^TA'Ops&s@ZCIoEb/ZiDf0B:Ou"aD8Wmb-ART+fD J XT]1 GB!0V,1CjBu5F(fK9OslJfI ? G )'1G :@ uA U ?' `F *VhK A Sksl@rs@LATDg0Efs'KDIn$ ' E cQ)= I ? G)' 1G :@t D N4s ,D.. I #F`< KrOu"aE/o>KQOuRf802le3E a r ZM B l%@D++8 Jh 78H< =Dfo r>L] D jM01 AZ);fm%oDJ+t1>^_$IP!=a ) Or 9F *P $iX "F cplq H]i W:3. 6 riI? I0bFcm2\/US[FOrdmOHn@! M Df p) 1A O ^BM AW f]L3 - 01M FEMY O OuRl :NW=Kj<@rS@>EU%5+FGao7 8 H< =D f or>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anastigmatix.filter DSCDataEncode 0.1 4 3000 2368 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 2100 % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 31 ASCII Lines currentfile /ASCII85Decode filter cvx exec 0 18`+6t (1G7;c URA7[ E3ATTP5DIIU.BkM9kFD5tPAnc('ATAo6ATMd4E a r[% FC B96F *j 'mL] W`OH]fJ67t $P"I?IP_DImoB@;]LpFD5B)@< ? 4./ko o!@ 8LuU 02 Q\-@o Hr\ P1l'. 05b?C/n&X+ F*),/D..O#GV2p:Eb/Zr8P_!9 E c5GdA TX *hOq!3WO u8C3@ s)g 4ASuU /@ : O( eDJ+q/F(KH4@:O(eD J ,-aN< ,4 "02+i q!=EjY@:X: oCjD1 "0 1/W t! =a' \@: X:oCjD1"01&&mMsART+fDJXT ] 1G;'d :6#NFBl 7 @"H#dJ)A8c @%H'0 s:8 4? X@"% [!JEb/ZiDf0B:Ou"a W ;aZQK 5 uU-B8 T JBNA8c @%H '0s:6 < R9 J" [[ KV ATMm'@:X:oCjD1"02 + r4NWi *j DImm0 AR T+fDJ XT] 1G:@m Bm =u\$ Bh 6K 0o,m o=GR!@99M8t3%lpR6 p Xe8 ^QM *M 3+ cl@A T2 R/ Bl n' -D MS=V=GR*C=GQs?98E _ 6=H[-VW H2WmAn c'mE, Tf3FD5 Z 2 L] N Z@L]`fBP.u'LFCo6 'AT2R/Bln'-DN]-jOq*X20.q'QBl5M=Bl7L'H]g@E!Kp*=E-mBAP$!M@P"RG]9Lb2[OuS7#L]W _WP"UT3Oo^_jOuS7"L]W_WP"UT3Oo^_jI?IQm3/@["9.qqNAncLQ5E^/;Oq*X20.q'QBl5M3H$ !V=H]g@E"HlD20.pjNG`k:SFa]D_Ou"aDCj0o6FCff^5*@mc!0V2GL]W`AOuS6uP"UT4P$!m^L ]W`4O uS7#L]W_WP"UT3Oo^_jL]NZ@0/$!g P!+/T3/@Tp!Kq\j3/@Wl!g4Fa99O7@L ]NZ@L ]`G7Or9EUL]NY>P'DD<OL]NJ9P'E-LL]`G7O r9EUL ]NY>P'E-LL]WP:P'DD%OuS7!N<#,dOuS6uN <#,dI?ITYP#[ZfI?IQmFcp]jOuS7!P" UT3P$ !MBP"Us& OuS7 $P"U .b3/ @Tu 94MdVF(JrtCh8$X<.0p/L]il6 I?G)' 1QpXT!HV go E+* 6l Bl 7Q :/n AU AP !5$ MP!4['Or9EjH]h$b5*C&:H]i N7Fcn t; P#Z pn %[& V $6r Q H@@ < >pH DI[TqAUBRL0/"qoGB.D>AWf 6?3%l pO6pXe8^ PE5 DO uS7?P. Z4+K 9 A3W8 ! 5iDBl%@"Df]W7Bl@mK!K@)8 !/LW7 !Ku>r"d0 1T$ ]" hH=HYY "+Hj C #3%n 6 VE+L[U6:jp*0.pdJP!>*h0/#X`:6I br!Kp P<01\N6P !+t KL ]NZ @ 0/# U i6] s TqE ftBg05b?C/n&X+F*),/D..O #GV2R *G %#3 $A4 C9 LF Cf Jh@ <, dn 0/ $mWEc5u>FDl,]5CJ\oP.ueqP .WG8D fo r>0 /#Xp <%fm WA7q& iOu P*J6@E0*iL^'"KOp`p3DI[TqAUT^OOu\[cOuY15ATTP5DIIU.BkM9 kFD5tPAnc('ATAo(AS,XoATD@'Dfp)1AWh1WATVm"@r#drB)~> % net.anastigmatix.Packager 0.1 5 %%EndData %%EndResource %%BeginResource: net.anastigmatix.filter DSCDecode 0.1 12 7310 28 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 5313 % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARR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c4?ATCRaCj@Ze/nAR,P!:UBGArNAL_#YN03)n 6Ea`o?0.pdIB9GJ4E+3F8&r?RNLG*+ZAqg % net.anastigmatix.Packager 0.1 12 %%EndData %%EndResource %%BeginResource: net.anastigmatix.filter WSMarkEncode 0.1 6 1876 1392 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 1168 % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 30 ASCII Lines currentfile /ASCII85Decode filter cvx exec 0 3;(H @<-- PDI [TqAM 7q4F=q !>@<6O)B5M(!Bm; 7BBl%m&EZfC6F)Q2A@qB_'@M39EQ5*C bc /;O @j) 2J9UA s,? 6! 0 Ur W E\B 'uE ,]E9 L] rrDL]il6L]W`AP$p!s/oY cA H\_i g=GR 'B9 8EV 3=H [) G 0. q3_ Ap]= ;P$ !MKP"RG]/n/O:P!=a*P$! MIP "Us%P "UZs! !!"^ 8pu k&I ?I T YP #Zpn %[& V$/o5`PBlmp5P!5$g0/" qe@;]_@Ap]\`I=$bOP$!MAP"UT3P$!l,0/"qs@s!ksH\_ff=GR!@99M8j!Kp*3!0V2GP')2"L] N;4P'Dc`P$!M_P.Z4+OuS7#P$!MDP"Us1H ]iN-!KmJ>!/L`?=GR$A98Eq<]R>rB0/"qsG\iO-H\_ce=GR$A98F^R]R>-i5^eeqI?J/t"-QcB !Kp*= $^,X\P#QjmXD0qF*P-6N[FE2)5B68E< AWf3' P1Pj\OuR)aBOt[hP2D&rOpR9ZOtr1aP2C\N De*FBfmT#_= (u2eB SZnV!Jh# E ;FkA 5B4u CM$'I 9(! /LYHASGdjFGKs\WKK8gL]`fB P,3s< P$!M@P$! lr P' )q 1P 'E -LI ?I -a Fc nqOFcnpuCi=B+Anc'mI?G)'1 G:@kB 7# e*O r fcM L ]W_ W P$i X "99 MK%Fa\V"Fcpm15CJ\pI?G)' 1G:@n @<-^N!Kp Pt@ q ]F`CQ `Y"f 9 -8`L ] ET%P"_#?P%'R\Opc\bP')29 L 87c L JBQ TD102-(tAP?ZQB67gC8hVhM A7q&i 01 0Po F( J % net.anastigmatix.Packager 0.1 5 %%EndData %%EndResource %%BeginResource: net.anastigmatix.filter InUPathDecode 0.1 5 1688 1420 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 1324 % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 16 ASCII Lines currentfile /ASCII85Decode filter cvx exec 01g%]:gnH Z6tKkHA7[E3 ATTP5DII U.BkM9kFD5tPAnc('ATAo6ATMd4Ear[%FCB96F *j'mL]W` OH]fJ67t$ P"I?IP_D ImoB@;]LpFD5B)@Y. M23JDYF `MM6DKKi +@r#drB8ln4ATVm"@r#drB9Ll+!Ku=n/nnjZBQ@ZmA 8c@% H '0s :/n/s?E0W *W#![V< zz!'bu6!'^G`!'^G`!-2XZA8c@%H'0s:/o5Q>@:X_J 3/@ T u99K @>Fbg*^= GR*C98E Y4=H[*>P')q1P')cbI=%,:L^9.EL]`fBL]`f5P %K &s !Jgc >=GR3F!J gi@=GR' B=G R6G!I]=GR!@!Jg`( P #[ ;B P$!M @P"UrGP') q$Osc%hP$!MD P"Ut.L]rrDL]W`4L^'#EL^'#8L]E/0J;=JerK ; q _L ^'# EL]ilCP,s HCP$!lQH]gRK !KpQJEfrV7P#R8;Oq2u(8@:YNbN< ,4">DN98!*taOOuR)aBOt[ hP2DED03;juFD-h1Orc8IASGdjFHT9M:gnHZ9jr- aBm;9a/nniL0.pdJP!>*hB4GUd@r%6HP1Pj"H\_ZX#*MZC!g7#U$'G[EP#O)+D..'g9jr-aBm; 9a/nniL0.pdJP!>+CP$Tdp/n/s?E0@<6O)B5M(!Bm;7BBl%m&EZen(Anc-oEb0<1F`Lu'P'(hWFDtYuCM@[!~> % net.anastigmatix.Packager 0.1 5 %%EndData %%EndResource %%BeginResource: procset net.anastigmatix.Packager 0.1 12 123660 0 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 17178 % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 185 ASCII Lines currentfile /ASCII85Decode filter cvx exec 05b?C/n&X+F*),/D..O#GV2g$@r#LcATBG#Ec5GdATT&8ATMd4Ear[%FCB96F*j'mL]W`OH]fJ 67t$P"I? IP_DImoB@;]LpFD5B)@:=GEd:5P 02Q\- @oHr\P1l' .05b?C/n&X+F*),/D..O#GV2 ^! Ebff:02Q\-@oHr\P1l'. @s)g4 ASuU/@:O( eDJ+q 0F(KH4@:O(eDJ+c7Ou8C302 Q(eC LLjeE_0eQDKLma$ 7-g4A TTP5DIIU. BkM9 kFD5tP:gmjL@:s.l+>>E&+> GVYEb/Zi Df0B:Ou"ah6si VV:5 B+;1G;O%? Udgb;2>481G;O%?VXEq78\jAO u"ah6siSU=bm-B1G;Wo?UI+YL] `er02 b2F:/P"W9S`h71G;Wo?W0g%5tm(( FCfK6/g* _t+E)CEE - 67 FBlbD2DI[U%E,9*-ALnsGBOQ!* @rHL+A0>>m+EV:.+Cei &F(Hs2+< VdL+%TOF*)J5Eb TK702lt 5ARTF I:G-=&D/ :G/B l%m &E^OY]F(I[\B*rZj@:X:oCjD1" 06M/V@<-6sA 1oTJBl%m &E^O Y]F(I[\B7 #X>!I]N0ARpr`L]ET2L]E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atix.Packager 0.1 12 %%EndData %%EndResource % ------------------>8------------------------>8-------------------------- /net.anastigmatix.Packager /ProcSet findresource begin userdict begin % % Set up the vital stats that are used by the markup macros % to generate boilerplate. % /Category Category cvn def /Key Key cvn def NeededResources () ne { mark NeededResources { % loop ( ) search { (/) search pop exch pop cvn exch cvn Qualifier 5 3 roll pop } { (/) search pop exch pop cvn exch cvn Qualifier exit } ifelse } loop counttomark array astore /NeededResources exch def pop } { /NeededResources [] def } ifelse % % Open an output file. % /OutputFile OutputFilename (w) file def % % Generate the header of the file. % OutputFile text \markup \PSResource %%Title: BWIPP: \{Key dup length string cvs} \DocumentNeededResources \DocumentSuppliedResources %%Version: \{Qualifier} %%Copyright: Copyright (c) 2004-2014 Terry Burton %%Creator: BWIPP \{Version} packaged by \{PackagerIdent dup length 4 sub 3 exch getinterval} %%CreationDate: \{ (%Calendar%) currentdevparams {Second Minute Hour Day Month Year} {1 index exch get exch} forall pop 4 string cvs}-\{##}-\{##} \{##}:\{##}:\{##} %%LanguageLevel: 2 %%VMlocation: global %%VMusage: \{VMusage} %%EndComments %%BeginProlog \IncludeResource \BeginResource % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % http://www.terryburton.co.uk/barcodewriter/license \stop % % Generate a watermark. % /Helvetica 18 selectfont newpath 72 0 moveto % right-align at 72 18 cpath dup begin RagLeft \markup BWIPP \stop end 0 0 0 0 setbbox % force computed bbox to include 0,0 so RagLeft looks right pathprep wmdict dup /YStep 150 put /Watermark exch def % % Prepare the filter stack for encoding the code. % OutputFile [ << /Type (ASCII) /Count (Lines) >> /DSCDataEncode () (%%EndResource\n%%EndProlog\n%%EOF\n) Watermark /WSMarkEncode (currentfile /ASCII85Decode filter cvx exec\n) { dup (\n% ) writestring //PostWatermark writestring } << >> /ASCII85Encode () () % << >> /FlateEncode (currentfile /FlateDecode filter cvx exec) () % level3 only ] true fstack tokenwriter % % Declare the names that should have //-references resolved at load time % { raiseerror renlinear renmatrix renmaximatrix ean2 ean5 ean13 ean8 upca upce code39 code93 code128 interleaved2of5 pdf417 micropdf417 qrcode datamatrix codablockf databaromni databarlimited databarexpanded databarstacked databarstackedomni databarexpandedstacked databartruncated gs1-cc gs1-128 } atload % % ... and away we go. % InputFilename (r) file { copytokens exec } exec % Finally, create file used to measure VMusage /VMusageFilename where { pop VMusageFilename (w) file Key Category 2 index VMquery closefile } if postscriptbarcode-2014-03-12/build/make_resource000077500000000000000000000045061231007474100215110ustar00rootroot00000000000000#!/usr/bin/perl -w # $Id$ use strict; use File::Temp; use File::Basename; my $abspath=`pwd`; chomp $abspath; my $infile=$ARGV[0]; my $outfile=$ARGV[1]; (my $resdir)=$outfile=~m#^(build/[^/]+)/#; my $packager=$resdir eq 'build/packaged_resource' ? 'make_packaged_resource.ps' : 'make_resource.ps'; open(VER,'src/VERSION') || die 'Unable to open VERSION'; my $version=join('',); close VER; chomp $version; open(PS,$infile) || die "File not found: $infile"; my $template=join('',); close(PS); $template=~/ ^%\ --BEGIN\ (ENCODER|RENDERER|RESOURCE)\ ([\w-]+?)--$ (.*?) (^[^%].*?) ^%\ --END\ \1\ \2--$ /msgx; my $resource=$2; my $meta=$3; my $body=$4; (my $reqs)=$meta=~/^% --REQUIRES (.*)--$/mg; $reqs='' unless defined $reqs; my $neededresources=''; foreach (split /\s+/, $reqs) { if ($_ eq 'preamble') { $neededresources.="Category/uk.co.terryburton.bwipp "; } else { $neededresources.="uk.co.terryburton.bwipp/$_ "; } } $neededresources=~s/\s+$//; open(PS,">$outfile.tmp") || die "Failed to write $outfile"; print PS $body; close(PS); my $category='uk.co.terryburton.bwipp'; my $key=$resource; if ($resource eq 'preamble') { $category='Category'; $key='uk.co.terryburton.bwipp'; } my $vmusage='0 0'; my $vmusagefile=mktemp('/tmp/vmusage.XXXXXX'); (my $yyyy, my $mm, my $dd, $_, my $rr)=$version=~/^(\d{4})-(\d{2})-(\d{2})(-(\d{1,2}))?$/ or die 'Malformed version'; my $qualifier="0.0 $yyyy$mm$dd".sprintf("%02d",$rr||0); print `cd $resdir/Resource && gs -P -dQUIET -dNOPAUSE -dBATCH -sDEVICE=nullpage -sInputFilename='$abspath/$outfile.tmp' -sOutputFilename='$abspath/$outfile' -sVMusageFilename='$vmusagefile' -sCategory='$category' -sKey='$key' -sVMusage='$vmusage' -sQualifier='$qualifier' -sVersion='$version' -sNeededResources='$neededresources' -sPostWatermark='$category/$key $qualifier' -- ../../$packager`; die 'GS create resource error' if $?; unlink("$outfile.tmp"); my $vmout=`gs -dQUIET -dNOPAUSE -dBATCH -sDEVICE=nullpage -- $vmusagefile`; die 'GS measure VMusage error' if $?; ($vmusage)=$vmout=~/VMusage \((\d+ \d+)\) def/ or die 'Failed to determine VMusage'; unlink($vmusagefile); # Stamp VMusage into the resource { $^I=''; @ARGV=($outfile); while (<>) { s/%%VMusage: \d+ \d+/%%VMusage: $vmusage/g; s/%%BeginResource: (.*) \d+ \d+/%%BeginResource: $1 $vmusage/g; print; } } postscriptbarcode-2014-03-12/build/make_resource.ps000066400000000000000000001503541231007474100221320ustar00rootroot00000000000000%!PS % ------------------8<------------------------8<-------------------------- % % The initial definitions in the file are from net.anastigmatix.Packager % and its supporting resources, by Chapman Flack. % % Information here: http://www.anastigmatix.net/postscript/Packager.html % %%BeginResource: procset net.anastigmatix.MetaPre 0.1 21 7700 28 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 5096 % Why MetaPre? Because it was inspired by other metaprogramming systems % like MetaML, it works as a kind of preprocessor, and the name MetaPost % was taken. % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 75 ASCII Lines currentfile /ASCII85Decode filter cvx exec 05b? C/n&X+F*),/D..O#GV2^%FC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[&P#sAUF ``cf05PfJ+Dc4;L]NY>OuY0K/no3;A8,OqP!>*cOu"aE/o>0A@;p6uG_cDS05,'1AWf9@!g7\^ !g6ZKD..OLEdNs5@<dB9GH7!KpQJWKKq.0.p[C@s)XO5;+ZB A9Da.P!=AX%[)("hfE@NE+*6lBl7R104f0EDfTo@Df@@@G]7SAF>%3CEA(j6EA(p % net.anastigmatix.Packager 0.1 12 %%EndData %%EndResource %%BeginResource: Category net.anastigmatix.filter 0.1 7 4931 3498 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 3149 % User-definable filters for use with net.anastigmatix.StreamIO's extfilter. % Predefined in this category: % SourceArrayDecode SourceQueueDecode TapDecode StringQueueEncode TeeEncode % % See http://www.anastigmatix.net/postscript/StreamIO.html on how to % define new filters. Please use inverted-domain naming (com.example...) % for non-Anastigmatix filters to be distributed in this category. % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 49 ASCII Lines currentfile /ASCII85Decode filter cvx exec 05b?C/n&X+F*),/D..O#GV3TBCij6/010/iAS5q%Gp%-=F)Q2A@qB_'@@:X_J3/@Tu99M8j!0U!<5CJ\)Ou"aDDK Tc3GA (E,D In'7H ]i N7F cpm1 Fbg ']=G Qs( P')q1NW=KjG _cEa=HYY" !g 7PdG_c KcEK YQpOq*X 20.q -b Ci!` qF DbZ7 F>#: " DKTc3GA(E,DI n'7OuSV6 L]im ?L]il )P"_ #p0 .pgTAT3 !Z5* C& O5*C &:Oq* X20.ps[B4ZFG! KpQ@!g63 >5CJ\ )Ou" aDGA_LF 4? P9 *hN W>5Z 0/ "qhE +O !8P ')pIL] ET2P!=AXAH\ _]c =GR$ A9. qqNB ldouP !>*oOuSI%P&2 j*/nK!5E-mBA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 1.12 2006/10/11 03:22:00 chap Exp $ %%EndData %%EndResource %%BeginResource: procset net.anastigmatix.StreamIO 0.1 15 9066 92 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 2294 % src tgt *copyfile* - % src|tgt dict name|proc *extfilter* file % src nbytes *flushn* - % src string *flushthru* - % proc bufsize *hold* queue nbytes % proc bs *holdfile* file nbytes % proc bs *holdstring* string % - *nullsrc* file % - *nulltgt* file % - *std{in,out,err}* file (these are procs, not file objects) % string *{r,w,a,r+,w+,a+}file* file % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. % test for the bug with flushfile on proc-based filters in HP's PS knockoff. % for some reason the test has to be here; if moved inside the packed part % it fails to detect the bug. { () } 0 () /SubFileDecode filter { flushfile } stopped dup { exch pop $error /newerror false put } if %%BeginData: 41 ASCII Lines currentfile /ASCII85Decode filter cvx exec 05b? C/n&X+F*),/D..O#GV2p:Eb/Zr8P_!9Ec5GdATT&8ATMd4Ear[%FCB9 6F*j'mL]W`O H] iN7+-K-BP#Qjm<%i-#F=q!>@<6O)B5M(!Bm;7)ATV?WEb -n# Ec5GdATX * hOq! 3iO u8C304np7FCfJ^Cisf4Anc'm6?Qq(5*@^3F`MM6D KKi +@r# drB8lq5A T Vm"@r# drB 9Ll+!Ku>EN<*=3P&Pb"0mk*JL]NZ@>p+MHL]ED7P 'D D<<0DB a!?cf-A T V?iBl7H7 : 3 CA h7; cUR A7^ qW @r-()AS, XmAV^>L 9 .smkCij 6/6 Yp[ ^AO :NP P!5 $bN Ws MS G:R ) PEb/ZiDf 0B:OuR fE" Gd,8 !f- o6!/ L]4" Gd)7!f- l5! /LZ( H]h' c5* @ mRL]V:.B 6%p5E- !.HAoD ]uC i#8 WP' )+)E \DV i@4u XO06 \p" @ 4QbQP!5$ bI?I/T Eb9$%A U? '`E fr_ :O q *X2 06_# BCh7 rH0 6` RFI?G)'1 G<0KBl% @ -0/$as 6% +n+ Ou"b 3.qWL3A U?'` E\! ;=I? G)'1 G#De*E%/UT3)Anc( 'ATC 7V F`V5 .Bl%?IF_? &JP1bWkNW:_2F ^dgSC h6"G@rGmhI=6HhI=78YHnCN7P"0q ;AT V ?iBl 7IE1G:@mB l%m:E+L.S4>0* 6@rGm hH[?keHluXV5$]:Y/Wr)L!0 U !<5 C J=fN W:_2F^dgS Ch6"G@rGmh+>% so04n p7 FCfJ^Cisf4Anc'm6?QpfH]m ' EV0U+F Gbs!0U!<5C G1[F_kk_DI[TqAUP\XD(dOp G\2 :UDIm oB@ ;]LpF D5B)@0'?F`);W"Hlk?6?QmPATC^`H=_mG%bT#ALh2.P!De*E404fBMAnc('ATEquP!4[&P$!l2P,4=$NW> 5ZH]ii+H]gR@P#[ZfP!3AlDf]K%Bl%@/Oq*X205,9?A7fOlAM5]MDers*FE2)5B8?PD.[!Jg1G Bl%?6@:j4iAM8'SA nc'm06\pYBl%?6@4Pr(Ch58@FC]*'06;5GDfp.TF*(r(EcNgNF_kl8Eapb?F_kl9B65e:DfBu6 Bl%?6Ao)U2BPoJ8Cisf4FD,];04fBMAnc('ATBG;Derr;BQ%]tAnc'm05,9?A92j5Bl7Q:Anc( 'ATC.SDf]JVF_<@>Bl%m&E^jkfF(f0"Ch5qUB71n6G]7SAF>%NCF=q!>@<6O)B5M(!Bm;7/FE1 r$D+RNd4tf`QDdu^WF % net.anastigmatix.Packager 0.1 12 %%EndData %%EndResource %%BeginResource: procset net.anastigmatix.BinaryIO 0.1 10 4068 2639 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 3068 % file *read{be,le}_{int32,int16,uint16}* int % file *read_{int,uint}8* int % file *read{be,le}_IEEE32* real % file int *write{be,le}_int{32,16}* - % file int *write_int8* - % file real *write{be,le}_IEEE32* - % file n *readn{be,le}_{int32,int16,uint16,IEEE32}* array % file string *readn* string (no short read-fills string or throws syntaxerror) % int *intbitstoreal* real real *realtointbits* int % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 50 ASCII Lines currentfile /ASCII85Decode filter cvx exec 05b?C/n&X+F*),/D..O#GV2P ') 2 "0/ "r! G \*%& I? ITY Oq*X2061 W4A7'%gF?"V#0 6 1W4 A7'I nD KIk $5 DT; q!K pQ> !.^ 48 P, XUbI?G)' 1G5 \#Ou P*JEb/Z i?Z g(#F ?#F JL^ 9. SP!1NPEb /Zi?Zg(#F?#F J P&bu6 %[& V$ Eb/Z iCh6 srB l8#I 2L CTH 0/ %?W@:W_f Bl8#PP!>*n0/ % ?W@:W _f Bl 8#PP != a .Oq 3^rI? G )'1 G0/ %?W@: W _fBl 8#P P!>+MI ?G)'1G0/%?W@:Wh Y?Z g(#F>5\:5 E^&8Oq*X2061W4 A8GgaBl8#K14,0D0/ %?W@:X1c?Zg(#F>5\:5E\2`061W4A8GgaF_P`8 0fG1ZL_,^[P&bu6%[&V$Eb/ZiDL7OqP&P b$Eb/ZiDD*XqF*M8Z5CJ\oI?G)'1G:@iE\r-!" d5^F3/@Qj"Gm)@LQZnF5)96&=GR!6"HlG 3061W4A8[PpP'(8WEcP`/FDkW'ARfgoDfT]'FG Kp[4aVtdF(KH3@VTIaFCoH3D..OLX,$asA TVj"C1UmsAoD^,@AR]4X Bl8#I2LC5]Or9 )NOq3 _g P.Z4+%[&V$GB.D>ASbpbBl8 #I2LC5]Or 9FqM "m,DP.Z 4+%[&V$GB. D>AR] 4XBl 8#K14+fYOr9)FOq03!GB.D> AR]4 XB l8#I 2Ng9X06_G NFCeom?YOD"0f G1ZI? G)'1 GG\!L]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0aBl8#K1,!ZZ@:X7lARB.hF>G[*Eb/ZiDIR0aBl8#I2D9)^@:X7lARB.hF>5[,Eb/ZiDIR0a8 OZ':1GUV(ART+eCh6sF77BX$1,!ZZ@;L%(Bl8$%BlnDLBl8$%BlnE5\%+D#e:DfTqQDImoB@;]LpFD5B)@ % net.anastigmatix.Packager 0.1 6 %%EndData %%EndResource %%BeginResource: procset net.anastigmatix.Markup 0.1 29 50351 28 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 3728 % Use \markup to turn PostScript inside out: instead of writing PostScript % code with (embedded strings of text), write text that reads naturally and % can contain \{embedded PostScript}. % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 49 ASCII Lines currentfile /ASCII85Decode filter cvx exec 0 5b?C/n &X+F*),/D..O#GV2 ^!Ebff:02Q\-@oHr\+ED%7Dfp)1ATMs%FEMYOP')Q^P% K '(+-K- BP#Qjm<%i-#F=q!> @<6O)B5M(!Bm;7)ATV?WEb-n#Ec5GdATX*hOptoDEcP` / FDtYuC M@[!N<+*3FDtYuCM @[!L^TA'Ops&s@ZCIoEb/ZiDf0B:Ou"aD8Wmb-ART+fD J XT]1 GB!0V,1CjBu5F(fK9OslJfI ? G )'1G :@ uA U ?' `F *VhK A Sksl@rs@LATDg0Efs'KDIn$ ' E cQ)= I ? G)' 1G :@t D N4s ,D.. I #F`< KrOu"aE/o>KQOuRf802le3E a r ZM B l%@D++8 Jh 78H< =Dfo r>L] D jM01 AZ);fm%oDJ+t1>^_$IP!=a ) Or 9F *P $iX "F cplq H]i W:3. 6 riI? I0bFcm2\/US[FOrdmOHn@! M Df p) 1A O ^BM AW f]L3 - 01M FEMY O OuRl :NW=Kj<@rS@>EU%5+FGao7 8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BeginResource: net.anastigmatix.filter DSCDataEncode 0.1 4 3000 2368 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 2100 % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 31 ASCII Lines currentfile /ASCII85Decode filter cvx exec 0 18`+6t (1G7;c URA7[ E3ATTP5DIIU.BkM9kFD5tPAnc('ATAo6ATMd4E a r[% FC B96F *j 'mL] W`OH]fJ67t $P"I?IP_DImoB@;]LpFD5B)@< ? 4./ko o!@ 8LuU 02 Q\-@o Hr\ P1l'. 05b?C/n&X+ F*),/D..O#GV2p:Eb/Zr8P_!9 E c5GdA TX *hOq!3WO u8C3@ s)g 4ASuU /@ : O( eDJ+q/F(KH4@:O(eD J ,-aN< ,4 "02+i q!=EjY@:X: oCjD1 "0 1/W t! =a' \@: X:oCjD1"01&&mMsART+fDJXT ] 1G;'d :6#NFBl 7 @"H#dJ)A8c @%H'0 s:8 4? X@"% [!JEb/ZiDf0B:Ou"a W ;aZQK 5 uU-B8 T JBNA8c @%H '0s:6 < R9 J" [[ KV ATMm'@:X:oCjD1"02 + r4NWi *j DImm0 AR T+fDJ XT] 1G:@m Bm =u\$ Bh 6K 0o,m o=GR!@99M8t3%lpR6 p Xe8 ^QM *M 3+ cl@A T2 R/ Bl n' -D MS=V=GR*C=GQs?98E _ 6=H[-VW H2WmAn c'mE, Tf3FD5 Z 2 L] N Z@L]`fBP.u'LFCo6 'AT2R/Bln'-DN]-jOq*X20.q'QBl5M=Bl7L'H]g@E!Kp*=E-mBAP$!M@P"RG]9Lb2[OuS7#L]W _WP"UT3Oo^_jOuS7"L]W_WP"UT3Oo^_jI?IQm3/@["9.qqNAncLQ5E^/;Oq*X20.q'QBl5M3H$ !V=H]g@E"HlD20.pjNG`k:SFa]D_Ou"aDCj0o6FCff^5*@mc!0V2GL]W`AOuS6uP"UT4P$!m^L ]W`4O uS7#L]W_WP"UT3Oo^_jL]NZ@0/$!g P!+/T3/@Tp!Kq\j3/@Wl!g4Fa99O7@L ]NZ@L ]`G7Or9EUL]NY>P'DD<OL]NJ9P'E-LL]`G7O r9EUL ]NY>P'E-LL]WP:P'DD%OuS7!N<#,dOuS6uN <#,dI?ITYP#[ZfI?IQmFcp]jOuS7!P" UT3P$ !MBP"Us& OuS7 $P"U .b3/ @Tu 94MdVF(JrtCh8$X<.0p/L]il6 I?G)' 1QpXT!HV go E+* 6l Bl 7Q :/n AU AP !5$ MP!4['Or9EjH]h$b5*C&:H]i N7Fcn t; P#Z pn %[& V $6r Q H@@ < >pH DI[TqAUBRL0/"qoGB.D>AWf 6?3%l pO6pXe8^ PE5 DO uS7?P. Z4+K 9 A3W8 ! 5iDBl%@"Df]W7Bl@mK!K@)8 !/LW7 !Ku>r"d0 1T$ ]" hH=HYY "+Hj C #3%n 6 VE+L[U6:jp*0.pdJP!>*h0/#X`:6I br!Kp P<01\N6P !+t KL ]NZ @ 0/# U i6] s TqE ftBg05b?C/n&X+F*),/D..O #GV2R *G %#3 $A4 C9 LF Cf Jh@ <, dn 0/ $mWEc5u>FDl,]5CJ\oP.ueqP .WG8D fo r>0 /#Xp <%fm WA7q& iOu P*J6@E0*iL^'"KOp`p3DI[TqAUT^OOu\[cOuY15ATTP5DIIU.BkM9 kFD5tPAnc('ATAo(AS,XoATD@'Dfp)1AWh1WATVm"@r#drB)~> % net.anastigmatix.Packager 0.1 5 %%EndData %%EndResource %%BeginResource: net.anastigmatix.filter DSCDecode 0.1 12 7310 28 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 5313 % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR I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C'T%?agH87c4?ATCRaCj@Ze/nAR,P!:UBGArNAL_#YN03)n 6Ea`o?0.pdIB9GJ4E+3F8&r?RNLG*+ZAqg % net.anastigmatix.Packager 0.1 12 %%EndData %%EndResource %%BeginResource: net.anastigmatix.filter WSMarkEncode 0.1 6 1876 1392 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 1168 % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 30 ASCII Lines currentfile /ASCII85Decode filter cvx exec 0 3;(H @<-- PDI [TqAM 7q4F=q !>@<6O)B5M(!Bm; 7BBl%m&EZfC6F)Q2A@qB_'@M39EQ5*C bc /;O @j) 2J9UA s,? 6! 0 Ur W E\B 'uE ,]E9 L] rrDL]il6L]W`AP$p!s/oY cA H\_i g=GR 'B9 8EV 3=H [) G 0. q3_ Ap]= ;P$ !MKP"RG]/n/O:P!=a*P$! MIP "Us%P "UZs! !!"^ 8pu k&I ?I T YP #Zpn %[& V$/o5`PBlmp5P!5$g0/" qe@;]_@Ap]\`I=$bOP$!MAP"UT3P$!l,0/"qs@s!ksH\_ff=GR!@99M8j!Kp*3!0V2GP')2"L] N;4P'Dc`P$!M_P.Z4+OuS7#P$!MDP"Us1H ]iN-!KmJ>!/L`?=GR$A98Eq<]R>rB0/"qsG\iO-H\_ce=GR$A98F^R]R>-i5^eeqI?J/t"-QcB !Kp*= $^,X\P#QjmXD0qF*P-6N[FE2)5B68E< AWf3' P1Pj\OuR)aBOt[hP2D&rOpR9ZOtr1aP2C\N De*FBfmT#_= (u2eB SZnV!Jh# E ;FkA 5B4u CM$'I 9(! /LYHASGdjFGKs\WKK8gL]`fB P,3s< P$!M@P$! lr P' )q 1P 'E -LI ?I -a Fc nqOFcnpuCi=B+Anc'mI?G)'1 G:@kB 7# e*O r fcM L ]W_ W P$i X "99 MK%Fa\V"Fcpm15CJ\pI?G)' 1G:@n @<-^N!Kp Pt@ q ]F`CQ `Y"f 9 -8`L ] ET%P"_#?P%'R\Opc\bP')29 L 87c L JBQ TD102-(tAP?ZQB67gC8hVhM A7q&i 01 0Po F( J % net.anastigmatix.Packager 0.1 5 %%EndData %%EndResource %%BeginResource: net.anastigmatix.filter InUPathDecode 0.1 5 1688 1420 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 1324 % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 16 ASCII Lines currentfile /ASCII85Decode filter cvx exec 01g%]:gnH Z6tKkHA7[E3 ATTP5DII U.BkM9kFD5tPAnc('ATAo6ATMd4Ear[%FCB96F *j'mL]W` OH]fJ67t$ P"I?IP_D ImoB@;]LpFD5B)@Y. M23JDYF `MM6DKKi +@r#drB8ln4ATVm"@r#drB9Ll+!Ku=n/nnjZBQ@ZmA 8c@% H '0s :/n/s?E0W *W#![V< zz!'bu6!'^G`!'^G`!-2XZA8c@%H'0s:/o5Q>@:X_J 3/@ T u99K @>Fbg*^= GR*C98E Y4=H[*>P')q1P')cbI=%,:L^9.EL]`fBL]`f5P %K &s !Jgc >=GR3F!J gi@=GR' B=G R6G!I]=GR!@!Jg`( P #[ ;B P$!M @P"UrGP') q$Osc%hP$!MD P"Ut.L]rrDL]W`4L^'#EL^'#8L]E/0J;=JerK ; q _L ^'# EL]ilCP,s HCP$!lQH]gRK !KpQJEfrV7P#R8;Oq2u(8@:YNbN< ,4">DN98!*taOOuR)aBOt[ hP2DED03;juFD-h1Orc8IASGdjFHT9M:gnHZ9jr- aBm;9a/nniL0.pdJP!>*hB4GUd@r%6HP1Pj"H\_ZX#*MZC!g7#U$'G[EP#O)+D..'g9jr-aBm; 9a/nniL0.pdJP!>+CP$Tdp/n/s?E0@<6O)B5M(!Bm;7BBl%m&EZen(Anc-oEb0<1F`Lu'P'(hWFDtYuCM@[!~> % net.anastigmatix.Packager 0.1 5 %%EndData %%EndResource %%BeginResource: procset net.anastigmatix.Packager 0.1 12 123660 0 % VMusage measured in Adobe PostScript(r) 3010.108 on a Phaser 750 (PowerPC) % Usage after vmreclaim: 17178 % Copyright Chapman Flack, www.anastigmatix.net. May be freely used and % distributed without modification provided this notice remains intact. % Provided in the hope that it will be useful but AS-IS WITHOUT ANY EXPRESS % OR IMPLIED WARRANTY AND WITHOUT REPRESENTATION AS TO ITS SUITABILITY FOR % ANY PURPOSE. %%BeginData: 185 ASCII Lines currentfile /ASCII85Decode filter cvx exec 05b?C/n&X+F*),/D..O#GV2g$@r#LcATBG#Ec5GdATT&8ATMd4Ear[%FCB96F*j'mL]W`OH]fJ 67t$P"I? IP_DImoB@;]LpFD5B)@:=GEd:5P 02Q\- @oHr\P1l' .05b?C/n&X+F*),/D..O#GV2 ^! Ebff:02Q\-@oHr\P1l'. @s)g4 ASuU/@:O( eDJ+q 0F(KH4@:O(eDJ+c7Ou8C302 Q(eC LLjeE_0eQDKLma$ 7-g4A TTP5DIIU. BkM9 kFD5tP:gmjL@:s.l+>>E&+> GVYEb/Zi Df0B:Ou"ah6si VV:5 B+;1G;O%? Udgb;2>481G;O%?VXEq78\jAO u"ah6siSU=bm-B1G;Wo?UI+YL] `er02 b2F:/P"W9S`h71G;Wo?W0g%5tm(( FCfK6/g* _t+E)CEE - 67 FBlbD2DI[U%E,9*-ALnsGBOQ!* @rHL+A0>>m+EV:.+Cei &F(Hs2+< VdL+%TOF*)J5Eb TK702lt 5ARTF I:G-=&D/ :G/B l%m &E^OY]F(I[\B*rZj@:X:oCjD1" 06M/V@<-6sA 1oTJBl%m &E^O Y]F(I[\B7 #X>!I]N0ARpr`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> % net.anastigmatix.Packager 0.1 12 %%EndData %%EndResource % ------------------>8------------------------>8-------------------------- /net.anastigmatix.Packager /ProcSet findresource begin userdict begin % % Set up the vital stats that are used by the markup macros % to generate boilerplate. % /Category Category cvn def /Key Key cvn def NeededResources () ne { mark NeededResources { % loop ( ) search { (/) search pop exch pop cvn exch cvn Qualifier 5 3 roll pop } { (/) search pop exch pop cvn exch cvn Qualifier exit } ifelse } loop counttomark array astore /NeededResources exch def pop } { /NeededResources [] def } ifelse % % Open an output file. % /OutputFile OutputFilename (w) file def % % Generate the header of the file. % OutputFile text \markup \PSResource %%Title: BWIPP: \{Key dup length string cvs} \DocumentNeededResources \DocumentSuppliedResources %%Version: \{Qualifier} %%Copyright: Copyright (c) 2004-2014 Terry Burton %%Creator: BWIPP \{Version} packaged by \{PackagerIdent dup length 4 sub 3 exch getinterval} %%CreationDate: \{ (%Calendar%) currentdevparams {Second Minute Hour Day Month Year} {1 index exch get exch} forall pop 4 string cvs}-\{##}-\{##} \{##}:\{##}:\{##} %%LanguageLevel: 2 %%VMlocation: global %%VMusage: \{VMusage} %%EndComments %%BeginProlog \IncludeResource \BeginResource % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % http://www.terryburton.co.uk/barcodewriter/license \stop OutputFile [ << /Type (ASCII) /Count (Lines) >> /DSCDataEncode () () ] true fstack /OutputFilter exch def /InputFile InputFilename (r) file def /buf 4096 string def { InputFile buf readstring exch OutputFilter exch writestring not {exit} if } loop OutputFilter closefile OutputFile text \markup %%EndResource %%EndProlog %%EOF \stop OutputFile closefile % Finally, create file used to measure VMusage /VMusageFilename where { pop VMusageFilename (w) file Key Category 2 index VMquery closefile } if postscriptbarcode-2014-03-12/contrib/000077500000000000000000000000001231007474100172735ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/000077500000000000000000000000001231007474100210515ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/PostScript/000077500000000000000000000000001231007474100231635ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/PostScript/asset_labels_using_forms/000077500000000000000000000000001231007474100302375ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/PostScript/asset_labels_using_forms/AssetLabels.ps000066400000000000000000000541721231007474100330160ustar00rootroot00000000000000%!PS-Adobe-2.0 %%Title: This script prints consecutive pages of auto-incrementing asset labels %%Creator: Adrian Head - adrianhead1977 [at] { gogglemail.com, yahoo.co.uk} % This script prints consecutive pages of auto-incrementing asset labels % Features of this script are: % * Completely self contained script - nothing else needed % * Prints aset label including text, logo and barcode % * Can toggle label outline (may be used for proofing/debugging) % * Prints Labels in 4x10 grid suitable for Avery sheets listed below % * Prints multi-pages at once and includes page numbering % * Asset numbers are auto-incrementing - across pages % * Barcode is made up of 4 char prefix + 10 digit auto-inc number % * The barcode is Code 128 B allowing alpha-numeric values or hybrid % * Can toggle hybrid Code 128 B & C to improve barcode resiliency & scan dist % * When barcode num part is Code 128 B can print assetnum as dec or hex % * Script version stamped on labels and page for version control % Howto Use: % Modify assetnum and numpage below to suit requirments. % Note: make sure the assetnum is one greater than last label number from % previous printjob or doesn't overlap with previous numbers! % Then pipe the modified script to the printer: % On Unix-like system you can use % lpr -S computer_name -P queuename AssetLabelPageScript.ps % On Windows can send the file to a printer as: % copy /b AssetLabelPageScript.ps lpr1 % Currently this script is written to support the following labels only: % Avery L7654 White Mini Labels 40/sheet 45.7x21.2mm % Avery L6140 Triple Bond 40/sheet 45.7x21.2mm % Avery L6145 No Peel-Tamper Proof 40/sheet 45.7x21.2mm % If label size needs to change - then exchange LabelOutlineForm to suit as % well as look for "Specific to label size/type" comments and change the % preceding command values. Trial and error will be required. % Barcode types supported: % Code 128 B - encodes alpha-numeric values; therefore, supports dec & hex % Code 128 C - only encodes numeric values; therefore, supports only dec % assetnum supports 10 digits - should be enough for most things % Dec max num = 9,999,999,999; Hex max num = 1,099,511,627,775 % Code 128 C - encodes numeric digits in less symbols; when barcode is fit % to the same size as Code 128 B - bar widths are wider improving scan % distance and barcode resiliency to damage, age and wear-n-tear. % This asset label script: AssetLabelPageScript.ps: % % Copyright (C) 2008 Adrian Head % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program. If not, see . % This asset label script includes: % Barcode Writer in Pure PostScript - Version 2008-03-08 % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2008 Terry Burton - tez@terryburton.co.uk % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. %%Pages: %%DocumentPaperSizes: a4 %%BoundingBox: 0 0 595 842 %%HiResBoundingBox: 0 0 595.276 841.89 %%LanguageLevel: 2 %%EndComments %%BeginProlog %%EndProlog %%BeginSetup %%EndSetup % ===== To edit initial asset num, total pages or label text edit here ===== /assetnum 0000000101 def % starting asset num - for initial label /numpage 5 def % total consecutive pages to print /numprefix (abcd) def % barcode value prefix printed before assetnum /scriptver (0.3e) def % label and/or script ver printed on label /labeloutline true def % true for proof; change to false to print /hybridcode true def % true for Code 128 B & C; false for B only /LabelTextForm << /FormType 1 /BBox [0 0 612 792] % No idea - seems to work /Matrix [1 0 0 1 0 0] /PaintProc { pop % Draw Text on Label gsave /Helvetica findfont 15 scalefont setfont 78.5 771 moveto (Asset Label) show % Specific to label size /Helvetica findfont 9.6 scalefont setfont 79 759.5 moveto (Company. Co. Ltd.) show %Specific to label size /Helvetica findfont 4.5 scalefont setfont 152.5 719.5 moveto scriptver show % Specific to label size grestore } bind >> def % ======= No need to edit below this line (except if page changes) ========= % ================= Code 128 Barcode Generation Code Begin ================= % Routines from http://postscriptbarcode.googlecode.com/svn/trunk/barcode.ps % --BEGIN ENCODER code128-- % --DESC: Code 128 % --EXAM: ^104^102Count^0990123456789^101! % --EXOP: includetext % --RNDR: renlinear /code128 { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Create an array containing the character mappings /encs [ (212222) (222122) (222221) (121223) (121322) (131222) (122213) (122312) (132212) (221213) (221312) (231212) (112232) (122132) (122231) (113222) (123122) (123221) (223211) (221132) (221231) (213212) (223112) (312131) (311222) (321122) (321221) (312212) (322112) (322211) (212123) (212321) (232121) (111323) (131123) (131321) (112313) (132113) (132311) (211313) (231113) (231311) (112133) (112331) (132131) (113123) (113321) (133121) (313121) (211331) (231131) (213113) (213311) (213131) (311123) (311321) (331121) (312113) (312311) (332111) (314111) (221411) (431111) (111224) (111422) (121124) (121421) (141122) (141221) (112214) (112412) (122114) (122411) (142112) (142211) (241211) (221114) (413111) (241112) (134111) (111242) (121142) (121241) (114212) (124112) (124211) (411212) (421112) (421211) (212141) (214121) (412121) (111143) (111341) (131141) (114113) (114311) (411113) (411311) (113141) (114131) (311141) (411131) (211412) (211214) (211232) (2331112) ] def % Create a string of the available characters for alphabets A and B /barchars ( !"#$%&'\(\)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~) def /barlen barcode length def % Length of the code /sbs barlen 6 mul string def % sbs is 6 times length of barcode /txt barlen array def /mode -1 def % A=0, B=1, C=2 /checksum barcode 1 3 getinterval cvi def % Initialise the checksum /i 0 def /j 0 def { % loop i barlen eq {exit} if barcode i 1 getinterval (^) eq { % indx is given by the next three characters /indx barcode i 1 add 3 getinterval cvi def txt j [( ) j 11 mul textyoffset textfont textsize] put /i i 4 add def } { % indx depends on the mode mode 2 eq { /indx barcode i 2 getinterval cvi def txt j [barcode i 2 getinterval j 11 mul textyoffset textfont textsize] put /i i 2 add def } { barchars barcode i 1 getinterval search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post txt j [barchars indx 1 getinterval j 11 mul textyoffset textfont textsize] put /i i 1 add def } ifelse } ifelse /enc encs indx get def % Get the indxth encoding sbs j 6 mul enc putinterval % Put encoded digit into sbs % Update the mode indx 101 eq indx 103 eq or {/mode 0 def} if indx 100 eq indx 104 eq or {/mode 1 def} if indx 99 eq indx 105 eq or {/mode 2 def} if /checksum indx j mul checksum add def % checksum+=indx*j /j j 1 add def } loop % Put the checksum character /checksum checksum 103 mod def sbs j 6 mul encs checksum get putinterval % Put the end character sbs j 6 mul 6 add encs 106 get putinterval % Shrink sbs and txt to fit exactly /sbs sbs 0 j 6 mul 13 add getinterval def /txt txt 0 j getinterval def % Return the arguments /retval 8 dict def retval (ren) (renlinear) put retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /code128 load 0 1 dict put % --END ENCODER code128-- % --BEGIN RENDERER renlinear-- /renlinear { 0 begin % Confine variables to local scope /args exch def % We are given some arguments % Default options /sbs [] def /bhs [] def /bbs [] def /txt [] def /barcolor (unset) def /includetext false def /textcolor (unset) def /textxalign (unset) def /textyalign (unset) def /textfont (Courier) def /textsize 10 def /textxoffset 0 def /textyoffset 0 def /bordercolor (unset) def /backgroundcolor (unset) def /inkspread 0.15 def /width 0 def /barratio 1 def /spaceratio 1 def /showborder false def /borderleft 10 def /borderright 10 def /bordertop 1 def /borderbottom 1 def /borderwidth 0.5 def /guardwhitespace false def /guardleftpos 0 def /guardleftypos 0 def /guardrightpos 0 def /guardrightypos 0 def /guardwidth 6 def /guardheight 7 def % Apply the renderer options args {exch cvlit exch def} forall % Parse the user options opt { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /barcolor barcolor cvlit def /textcolor textcolor cvlit def /textxalign textxalign cvlit def /textyalign textyalign cvlit def /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /bordercolor bordercolor cvlit def /backgroundcolor backgroundcolor cvlit def /inkspread inkspread cvr def /width width cvr def /barratio barratio cvr def /spaceratio spaceratio cvr def /borderleft borderleft cvr def /borderright borderright cvr def /bordertop bordertop cvr def /borderbottom borderbottom cvr def /borderwidth borderwidth cvr def /guardleftpos guardleftpos cvr def /guardleftypos guardleftypos cvr def /guardrightpos guardrightpos cvr def /guardrightypos guardrightypos cvr def /guardwidth guardwidth cvr def /guardheight guardheight cvr def % Create bar elements and put them into the bars array /bars sbs length 1 add 2 idiv array def /x 0.00 def /maxh 0 def 0 1 sbs length 1 add 2 idiv 2 mul 2 sub { /i exch def i 2 mod 0 eq { % i is even /d sbs i get barratio mul barratio sub 1 add def % d=digit*r-r+1 /h bhs i 2 idiv get 72 mul def % Height from bhs /c d 2 div x add def % Centre of the bar = x + d/2 /y bbs i 2 idiv get 72 mul def % Baseline from bbs /w d inkspread sub def % bar width = digit - inkspread bars i 2 idiv [h c y w] put % Add the bar entry h maxh gt {/maxh h def} if } { /d sbs i get spaceratio mul spaceratio sub 1 add def % d=digit*r-r+1 } ifelse /x x d add def % x+=d } for gsave currentpoint translate % Force symbol to given width width 0 ne { width 72 mul x div 1 scale } if % Set RGB or CMYK color depending on length of given hex string /setanycolor { /anycolor exch def anycolor length 6 eq { (< >) 8 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setrgbcolor } if anycolor length 8 eq { (< >) 10 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setcmykcolor } if } bind def % Display the border and background newpath borderleft neg borderbottom neg moveto x borderleft add borderright add 0 rlineto 0 maxh borderbottom add bordertop add rlineto x borderleft add borderright add neg 0 rlineto 0 maxh borderbottom add bordertop add neg rlineto closepath backgroundcolor (unset) ne { gsave backgroundcolor setanycolor fill grestore } if showborder { gsave bordercolor (unset) ne { bordercolor setanycolor } if borderwidth setlinewidth stroke grestore } if % Display the bars for elements in the bars array gsave barcolor (unset) ne { barcolor setanycolor } if bars { {} forall newpath setlinewidth moveto 0 exch rlineto stroke } forall grestore % Display the text for elements in the text array textcolor (unset) ne { textcolor setanycolor } if includetext { textxalign (unset) eq textyalign (unset) eq and { /s 0 def /f () def txt { {} forall 2 copy s ne exch f ne or { 2 copy /s exch def /f exch def exch findfont exch scalefont setfont } { pop pop } ifelse moveto show } forall } { textfont findfont textsize scalefont setfont /txt [ txt { 0 get {} forall } forall ] def /tstr txt length string def 0 1 txt length 1 sub { dup txt exch get tstr 3 1 roll put } for /textxpos textxoffset x tstr stringwidth pop sub 2 div add def textxalign (left) eq { /textxpos textxoffset def } if textxalign (right) eq { /textxpos x textxoffset sub tstr stringwidth pop sub def } if textxalign (offleft) eq { /textxpos tstr stringwidth pop textxoffset add neg def } if textxalign (offright) eq { /textxpos x textxoffset add def } if /textypos textyoffset textsize add 3 sub neg def textyalign (above) eq { /textypos textyoffset maxh add 1 add def } if textyalign (center) eq { /textypos textyoffset maxh textsize 4 sub sub 2 div add def } if textxpos textypos moveto tstr show } ifelse } if % Display the guard elements guardwhitespace { 0.75 setlinewidth guardleftpos 0 ne { newpath guardleftpos neg guardwidth add guardleftypos guardwidth 2 div add moveto guardwidth neg guardheight -2 div rlineto guardwidth guardheight -2 div rlineto stroke } if guardrightpos 0 ne { newpath guardrightpos x add guardwidth sub guardrightypos guardheight 2 div add moveto guardwidth guardheight -2 div rlineto guardwidth neg guardheight -2 div rlineto stroke } if } if grestore end } bind def /renlinear load 0 1 dict put % --END RENDERER renlinear-- % --BEGIN DISPATCHER-- /barcode { 0 begin dup (ren) get cvx exec end } bind def /barcode load 0 1 dict put % --END DISPATCHER-- % ================== Code 128 Barcode Generation Code End ================== /LabelOutlineForm << /FormType 1 /BBox [0 0 612 792] % No idea - seems to work /Matrix [1 0 0 1 0 0] /PaintProc { pop % Draw label outline for proofing and debugging - toggled by labeloutline % Drawn in Scribus -> export EPS -> manual edit % Label specific to label size and type: Avery L7654, L6140, L6145 gsave 0.1 setlinewidth 0 setlinecap 0 setlinejoin [] 0 setdash 40 788.673 translate % Specific to label size 5.66929 0 moveto 5.66929 0 122.331 0 122.331 0 curveto 125.462 0 128 -3.13106 128 -5.66929 curveto 128 -5.66929 128 -65.8307 128 -65.8307 curveto 128 -68.9618 125.462 -71.5 122.331 -71.5 curveto 122.331 -71.5 5.66929 -71.5 5.66929 -71.5 curveto 3.13106 -71.5 0 -68.9618 0 -65.8307 curveto 0 -65.8307 0 -5.66929 0 -5.66929 curveto 0 -3.13106 3.13106 0 5.66929 0 curveto closepath stroke grestore } bind >> def /LabelLogoForm << /FormType 1 /BBox [0 0 612 792] % No idea - seems to work /Matrix [1 0 0 1 0 0] /PaintProc { pop % Draw the Logo - might be very messy but it works % Possible conversion path : PDF -> PS -> EPSI -> EPS -> manual edit gsave 1 setlinewidth 0 setlinecap 0 setlinejoin [2] 0 setdash 50 782 translate 0.85 0.85 scale 26.5 -14 moveto 26.5 -21.7323 20.568 -28 13.25 -28 curveto 5.93223 -28 0 -21.7323 0 -14 curveto 0 -6.26801 5.93223 0 13.25 0 curveto 20.568 0 26.5 -6.26801 26.5 -14 curveto closepath fill grestore } bind >> def % Routine from http://www.tinaja.com/glib/strconv.pdf % Concatinate two strings: (xx) (yy) mergestr -> (xxyy) /mergestr { 2 copy length exch length add string dup dup 4 3 roll 4 index length exch putinterval 3 1 roll exch 0 exch putinterval } def % Routine from http://groups.google.com/group/postscriptbarcode/ % Convert num to str and pad leading zeros: num num2padstr -> (0000num) % Note: must change (00..00) & 10 for different str length /num2padstr { /numbase 10 def % numbase: 10 for dec; 16 for hex (0000000000) 10 string copy dup 3 2 roll numbase 10 string cvrs dup length 10 exch sub exch putinterval } def /LabelPageForm << /FormType 1 /BBox [0 0 612 792] % No idea - seems to work /Matrix [1 0 0 1 0 0] /PaintProc { pop % Draw the matrix of labels on the canvas - auto-incrementing assetnum gsave 10 { % 10 rows - Specific to label size/type 4 { % 4 columns - Specific to lavel size/type 1 1 scale labeloutline { LabelOutlineForm execform } if % Print outline if true LabelTextForm execform % Print Label Text LabelLogoForm execform % Print Label Logo gsave 47 732 translate % Position barcode - Specific to label size hybridcode { 0.785 0.785 scale % Scale barcode - Specific to label size % Convert assetnum into string - pad zeros and concatinate with prefix % ^104 required to set Code 128 B; ^099 to set Code 128 C /barcodetxt (^104) numprefix (^099) assetnum num2padstr mergestr mergestr mergestr def 0 0 moveto barcodetxt (includetext height=0.382 textsize=12.2 textxalign=center textfont=Helvetica textxoffset=-2.5 textyoffset=2.28) code128 barcode }{ 0.6 0.6 scale % Scale barcode - Specific to label size % Convert assetnum into string - pad zeros and concatinate with prefix /barcodetxt (^104) numprefix assetnum num2padstr mergestr mergestr def 0 0 moveto barcodetxt (includetext height=0.5 textsize=16 textxalign=center textfont=Helvetica textxoffset=-1 textyoffset=2) code128 barcode % Barcode text positioning parameters - Specific to label size % textxalign={left,right,center,offleft,offright} % textyalign={above,below,center} % textxoffset - horiz offset of text from default position, in points. % textyoffset - vert offset of text from default position, in points. } ifelse grestore /assetnum assetnum 1 add def 129 0 translate % Move to next label - Specific to label size } repeat -516 -72.5 translate % Move to next row - Specific to label size } repeat grestore } bind >> def % main() save /page 1 def numpage { % Iterate through pages LabelPageForm execform % Print script name and verison at the bottom of the canvas - Specific to page size /Helvetica findfont 10 scalefont setfont 40 20 moveto (Printed by AssetLabelPageScript.ps : version ) scriptver mergestr show % Print "page x of y" at the bottom of the canvas - Specific to page size /Helvetica findfont 10 scalefont setfont 490 20 moveto (Page ) page 3 string cvs ( of ) numpage 3 string cvs mergestr mergestr mergestr show showpage /page page 1 add def } repeat restore %%PageTrailer %%Trailer %%EOF postscriptbarcode-2014-03-12/contrib/Examples/PostScript/binary_symbology/000077500000000000000000000000001231007474100265535ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/PostScript/binary_symbology/README.html000066400000000000000000000014661231007474100304050ustar00rootroot00000000000000
Special case binary symbology for encoding a 32 bit input, with 
optional triangular delimiters at each end.

PostScript integers are 32 signed values so this code contains logic
to avoid numeric overflows when converting the input to a binary 
string.

Available options:

symtype - EMS (default) / BOBST / anything else for custom type
xwidth - width for wide bar for custom symbol type
ywidth - width for spacing for custom symbol type
zwidth - width for narrow bar for custom symbol type
height - set symbol height in mm
width - force symbol to given width in mm
laterallsb, lateralmsb - triangular delimiters
lsbgap, msbgap - width of the space between bar and diemark
inkspread, includetext, textpos, textxpost, textfont, textsize,
showborder, borderwidth, borderleft/right/top/bottom - usual meanings

postscriptbarcode-2014-03-12/contrib/Examples/PostScript/binary_symbology/binary.ps000066400000000000000000000201601231007474100304020ustar00rootroot00000000000000%!PS-Adobe-2.0 %%Creator: Terry Burton %%DocumentPaperSizes: a4 %%EndComments %%EndProlog % Binary symbols adapted from Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter % (c) November 2005 - Terry Burton % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. /binary { 0 begin /options exch def /renderopts options def /barcode exch def /includetext false def /textfont /Courier def /textsize 8 def /textpos -6 def /textxpos 0 def % Default to the spec for EMS type symbol /symtype (EMS) def /height 5 def /xwidth 3 def /ywidth 2 def /zwidth 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /textxpos textxpos cvr def % Allow custom spec if given /height height cvr def /xwidth xwidth cvr def /ywidth ywidth cvr def /zwidth zwidth cvr def % Override with BOBST spec if required symtype (BOBST) eq { /xwidth 2.4 def /ywidth 1.6 def /zwidth 0.8 def } if % Populate the human readable text /txt [ [barcode textxpos textpos textfont textsize] ] def % We need to convert the 32 bit unsigned input data into a binary string. % Since PostScript integers are 32 bit signed, and we need to make full % use of these 32 bits, we need to subtact 2^32 from the input to align % the ranges and fix this in the binary string by flipping the first % bit then truncating any leading zeros. % Subtract 2^32 from given barcode preventing over/underflow /pad (0000000000) def pad 10 barcode length sub barcode putinterval /x1 pad 0 5 getinterval cvi def /x2 pad 5 5 getinterval cvi def x1 21474 eq x2 83648 ge and x1 21474 gt or { /z2 x2 83648 sub def /carry 0 def z2 0 lt { /z2 z2 100000 add def /carry 1 def } if /barcode x1 21474 sub carry sub 100000 mul z2 add def } { /barcode barcode cvi 2147483647 sub 1 sub def } ifelse % Flip the first bit and truncate any leading zeros /barcode barcode 2 32 string cvrs def barcode 0 1 getinterval (0) eq { barcode 0 (1) putinterval } { barcode 0 (0) putinterval barcode (1) search { pop pop /barcode exch def /pad barcode length 1 add string def pad 0 (1) putinterval pad 1 barcode putinterval /barcode pad def } { /barcode (0) def } ifelse } ifelse /barlen barcode length def /sbs barlen 2 mul array def % Lookup the width for each bit 0 1 barlen 1 sub { /i exch def /enc barcode i 1 getinterval def enc (0) eq { sbs i 2 mul zwidth put } if enc (1) eq { sbs i 2 mul xwidth put } if sbs i 2 mul 1 add ywidth put } for % Return the arguments /retval 4 dict def retval (sbs) sbs put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) renderopts put retval end } bind def /binary load 0 1 dict put /barcode { 0 begin % Confine variables to local scope /args exch def % We are given some arguments /sbs args (sbs) get def /bhs args (bhs) get def /bbs args (bbs) get def /renderopts args (opt) get def % Get the text if known, otherwise it is empty args (txt) known { /txt args (txt) get def } { /txt [] def } ifelse % Default options /inkspread 0.15 def /height 5 def /width 0 def /showborder false def /borderleft 10 def /borderright 10 def /bordertop 1 def /borderbottom 1 def /borderwidth 0.5 def /laterallsb false def /lateralmsb false def /symtype (EMS) def /lsbgap 2 def /msbgap 2 def % Parse the render options renderopts { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /inkspread inkspread cvr def /height height cvr def /width width cvr def /borderleft borderleft cvr def /borderright borderright cvr def /bordertop bordertop cvr def /borderbottom borderbottom cvr def /borderwidth borderwidth cvr def /lsbgap lsbgap cvr def /msbgap msbgap cvr def symtype (BOBST) eq { /lsbgap 1.6 def /msbgap 1.6 def } if % Create bar elements and put them into the bars array /bars sbs length 1 add 2 idiv array def lateralmsb { /x height msbgap add def } { /x 0.00 def } ifelse 0 1 sbs length 1 add 2 idiv 2 mul 2 sub { /i exch def i 2 mod 0 eq { % i is even /d sbs i get def % d=digit*r-r+1 /h bhs i 2 idiv get def % Height from bh /c d 2 div x add def % Centre of the bar = x + d/2 /y bbs i 2 idiv get def % Baseline from bbs /w d inkspread sub def % bar width = digit - inkspread bars i 2 idiv [h c y w] put % Add the bar entry } { /d sbs i get def % d=digit*r-r+1 } ifelse /x x d add def % x+=d } for laterallsb { /x x lsbgap add height add def } if gsave % Convert scale from PostScript points to mm 2.8346 dup scale % Force symbol to given width width 0 ne { width x div 1 scale } if % Display the msb diecut mark lateralmsb { newpath 0 0 moveto height 0 rlineto 0 height rlineto closepath fill } if % Display the bars for elements in the bars array bars { {} forall setlinewidth moveto 0 exch rlineto stroke } forall % Display the msb diecut mark laterallsb { newpath x 0 moveto height neg 0 rlineto 0 height rlineto closepath fill } if % Display the border showborder { borderwidth setlinewidth borderleft neg borderbottom neg moveto x borderleft add borderright add 0 rlineto 0 h borderbottom add bordertop add rlineto x borderleft add borderright add neg 0 rlineto 0 h borderbottom add bordertop add neg rlineto closepath stroke } if % Display the text for elements in the text array /s 0 def /f () def txt { {} forall 2 copy s ne exch f ne or { 2 copy /s exch def /f exch def exch findfont exch scalefont setfont } { pop pop } ifelse moveto show } forall grestore end } bind def /barcode load 0 1 dict put gsave 250 550 translate (20) (includetext laterallsb) binary barcode grestore showpage postscriptbarcode-2014-03-12/contrib/Examples/PostScript/dimensions/000077500000000000000000000000001231007474100253335ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/PostScript/dimensions/dimensions.ps000066400000000000000000000037421231007474100300550ustar00rootroot00000000000000%!PS % Code contributed by Tim Brunson, 2008-03-15. % It allows you to get the dimensions of the barcode produced, % similar to the stringwidth operator. It uses the dontdraw option to % return the rendering dictionary, totals up the bar widths and heights, % and returns the values (in points) on the stack. This can be used in % calculating a location for the barcode when it needs to be centered or % right justified. /barcodewidth { exch dup length 9 add string dup 3 -1 roll 0 exch putinterval dup dup length 9 sub ( dontdraw) putinterval exch exec /renlinear /uk.co.terryburton.bwipp resourcestatus { pop pop dup /ren get /renlinear /uk.co.terryburton.bwipp findresource eq { dup begin sbs aload length 1 sub { add } repeat 0 0 1 bhs length 1 sub { dup bhs exch get exch bbs exch get add 2 copy gt { pop } { exch pop } ifelse } for 72 mul currentdict /txt known { txt length 0 gt { txt 0 get 2 get dup 0 lt { abs } { pop 0 } ifelse add } if } if end 3 -1 roll } if } if /renmatrix /uk.co.terryburton.bwipp resourcestatus { pop pop dup /ren get /renmatrix /uk.co.terryburton.bwipp findresource eq { dup begin width 72 mul height 72 mul end 3 -1 roll } if } if /renmaximatrix /uk.co.terryburton.bwipp resourcestatus { pop pop dup /ren get /renmaximatrix /uk.co.terryburton.bwipp findresource eq { % Undefined -1 -1 3 -1 roll } if } if pop } bind def % Example: % (123456789012345ABC) (includetext) /code39 /uk.co.terryburton.bwipp findresource barcodewidth postscriptbarcode-2014-03-12/contrib/Examples/PostScript/form_filler/000077500000000000000000000000001231007474100254635ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/PostScript/form_filler/README.html000066400000000000000000000013321231007474100273050ustar00rootroot00000000000000
Hi Tez,

that time I had continued my trials and I made a simple sample solution
based on asciiprint.ps. It is 67 lines in the sample.
This small program can be used to print, for example palatte labels on a
postscript printer (as we are production company :) ).

(See attached file: form.ps ) (See attached file: table.csv )
The way to use it on windows simply:

copy barcode.ps + form.ps + table.csv \\printserver\print /b

Parseline can be extended to read more columns easily.
Printform does all the drawing with the variables coming from the current
row.
It seems to be the cheapest bulletproof solution to print simple forms with
barcode from csv.

I feel it fully customizable.


Yours sincerely,

Janos Juhasz
postscriptbarcode-2014-03-12/contrib/Examples/PostScript/form_filler/form.ps000066400000000000000000000031771231007474100270020ustar00rootroot00000000000000% this code could be appended to the barcode.ps /line 512 string def % for input line buffering /getfield { % cut the line with separator /separator exch def /original exch def original separator search { exch pop } { () original } ifelse % give back the field before separator and the part after it } bind def /printform { % printing page with the sent variables /qty exch def /stockcode exch def /palette exch def % you can customize this as you need 20 350 500 350 rectstroke /Helvetica findfont 10 scalefont setfont gsave 50 550 translate palette code39 barcode grestore gsave 50 540 moveto (Palette: ) show palette show 50 520 moveto (StockCode: ) show stockcode show 50 500 moveto (Qty: ) show qty show grestore showpage } bind def /parseline { % bind string in line to variables %palette;stockcode;qty line (;) getfield /palette exch def (;) getfield /stockcode exch def (;) getfield /qty exch def pop % remove the tempstring palette stockcode qty printform % print the form with values from line } bind def % read the lines /parsefile { line readline % read a line from the file { % 'while' procedure body parseline % parse the line currentfile cvlit % use as operand line readline % and read the next line not {exit} if % exit if no more input to be had } loop % end of while-proc } bind def % /printfile currentfile cvlit % uses rest of this file as input % everything following 'parseFile' is treated as data, through EOF %palette;stockcode;qty parsefile postscriptbarcode-2014-03-12/contrib/Examples/PostScript/form_filler/table.csv000066400000000000000000000001121231007474100272610ustar00rootroot00000000000000*147145*;HARP;100 *147146*;Flute;120 *147147*;Car;130 *147148*;PC;110 postscriptbarcode-2014-03-12/contrib/Examples/PostScript/lto_tape_labels/000077500000000000000000000000001231007474100263145ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/PostScript/lto_tape_labels/ltotapelabel.ps000066400000000000000000000373321231007474100313400ustar00rootroot00000000000000%!PS-Adobe-3.0 %%Creator: Matthew Newton %%EndComments %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Edit the following settings to define the TLA and the % number to start the sheet at (there are 33 labels per % sheet). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /prefix (MCN) def /suffix (L4) def /number 1 def /bordercolour [ 0.0 0.8 1 ] def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % There should be no need to edit the code below... %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -------8<--------- START OF BWIPP RESOURCE DEFINITIONS ---------8<------- % These PS named resource definitions are from Barcode Writer in Pure % PostScript. http://www.terryburton.co.uk/barcodewriter/ % % If BWIPP is already available to the named resource machinery of the PS % VM then these definitons can be omitted. %%BeginResource: Category uk.co.terryburton.bwipp 0.0 0 0 0 % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2009 Terry Burton % % http://www.terryburton.co.uk/barcodewriter/license %%BeginData: 6 ASCII Lines currentfile /ASCII85Decode filter cvx exec P1OerF_-`n01TSk ATDKp 010/i AS5q% H' 6mE 30Ia,! KmJH23J i?3%mj@F*(i.@qA VbE +L\A@ :O(aA 79 M!@ % Category/uk.co.terryburton.bwipp 0.0 0 %%EndData %%EndResource %%BeginResource: uk.co.terryburton.bwipp renlinear 0.0 0 0 0 % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2009 Terry Burton % % http://www.terryburton.co.uk/barcodewriter/license %%BeginData: 70 ASCII Lines currentfile /ASCII85Decode filter cvx exec 06:]HE+*6lBl7RH \pKT_ @s)g4 ASuU/ @: O(e DJ()6E ckq9F(K H4@:O(eDJ+B\ 9I4 71G<3 HF! +[0?' 6usF EhmM>9I471G<3GE as$(D fUj AF` )83F HS F5B l7EsF_ #' *AU&;> Amo LsAWei&FCf]=@rH 1%EfL 4 u04Jj?A7]dkDes? 4NWjQC F(K H V1G <3 G@r# ^tD for.@rH1%E fL:FCf]=@rH1%Ef r#;1GFEh51BkM=H/WqnCFCf]=H!tN'B5Si6AU&FE;/BAWe^01G@;L%-AU&<[/WqnC@W-9tATD:!Ci=>:@W-9tATD:!Ci=?W/WqnC@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VDG]\.DA9;LJWJCV=2 Ne*(1N[2QFEh51BkM=D"DhX]FHSe606CcMFEhbCF!,R9G]\1KAnH*qFHSG.P#QO7G]\1=Ch[O" NWjH;B4uCM4aSi(AU&G]\1KAnH*qFHWVFAU&<@Bk2=!P,XU#I?IQOAU&FEh_9AohO*Oo^_`Ou%NL<-2\rFEh 51BkM=D#]FOo^_` Ou%2kG]\4>Ch[O"NWij#Dg#]T4aSi(AU&Oo^_%I?IQ OAU&^Eb'3)B4uC+Df^^7P&5Q/DeF3 $Eb'3)B4uC+Df[%GOo]3<@<,n&Bk2=!P,W):@<,n!BkM+$H#R\C+D5h*Eb&ipBkM+$L]W_tOo^ _]B6@X'A9V`uFD)e0F^]<$BOtmjBQT(0OuAJWB6@X'A9V`uFD-hTB6@X'A8#OgB4uCCrfT1&Kp &?^P#Qjm<0Bt=3IR&#Ou"b3ASu % uk.co.terryburton.bwipp/renlinear 0.0 0 %%EndData %%EndResource %%BeginResource: uk.co.terryburton.bwipp code39 0.0 0 0 0 % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2009 Terry Burton % % http://www.terryburton.co.uk/barcodewriter/license %%BeginData: 47 ASCII Lines currentfile /ASCII85Decode filter cvx exec 06:]HE+*6lBl7RH \pKT_ @s)g4 ASuU/ @: O(e DJ()6E ckq9F(K H4@:O(eDJ+B\D_?-CEcQG7F`M SBDD# CB BlJ$S g6-] D% 524 0A7[P WH\ `B!23 JD%D fBf4Df0WZ5*@]T@ UX:eD e*F B5* @]TA 8c @-A 9)+&+D ,% uF(LLj 055 <6Cis9"@q]F`CER 4tCia 0N1 GX4aVtcOu8C 3DfBf4 Df0 W CP, i2 'Cia 0N4 aW>WI?IQm3 0Ia6V33Qn!B lU*FE2M8P!+/T/W r;\Fcn qO1 O XV5/ Tc#U AWe itP#ZpnAWe *t3A5;iFD5Z 2F-8_M1OYEcDfBf 4Df0WC Ou%N L8M> 0sG] [P9 DKI"CAU&F E;/BA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%ARfLsF_r78DIe!T!Ko6eP"9;)@r-9uARfCb@r$EE@q]F`CNFW8+Cf(r@r$..D2 9^*C6CAo@WNZ$@<-0qDMSX_CkrF]!G-.YF!+t+ARfLsF`!:7P'LbZ@r-9uARfCb@r#drFCf]=H Q[ETF>9IB`EarckEcW@5BOt[hF*2>U!Kp,c@<-0qDMS=V!Jh;MCij65FEqe: AohO*+EV1>FCoH/F&<^j OAU&FCf]=F(or3+C1.TI?ITO@WNZ$@<-0qDMSX_Ckrdg!G-.YF,2 ?099OR6Bk1drFCB32P&PbiG]Y';@<-0qDMS@W!F(Qb.Ulh,Ch7L?!g3S?&<^jOAU&FCf]=F(or3+C1.TI=$'\FE/\m@<-0qDMS@W!Jh;MCij65F Eqe:AohO*+EV1>FCoH/F&<^jOAU&FCf]=F(or3+C1.TI=$'\F>E/\m@<-0qDMS=V!Jh;MCij65FEq e:AohO*+EV1>FCoH/FL]W`;HY?u)B4uC8P(R$n@UaC$>9IurF-:!g!KmJ>! g6H.L]DjdK3]U6DI[L*A7]joG]\9cFEhmMFEhnUP#O)QE-*4@E-,f4DK?pa4s4BSDKKE0@<[lR 0/%?WDJX$)ARTVB<0B7iOq*X204Sp2AMZ?030If*F_`U>D_?-CEcQG7F`MSBDD#CBBlJ#6A7]@ eDImj"F)Q2A@qCgGOuY1:ATVm"@r#drB9KiQP'(hWFDtYuCM@[!I?IP~> % uk.co.terryburton.bwipp/code39 0.0 0 %%EndData %%EndResource % -------8<---------- END OF BWIPP RESOURCE DEFINITIONS ----------8<------- /LTOlabel { 20 dict begin dup type /arraytype eq { /bordercolour exch def exch } if /code exch def /mm { 25.4 div } def /in { } def /topwid 67 mm def % width of top bc /botwid 37 mm def % width of bottom bc /vgap 1 mm def % horiz gap between codes /tophi 7 mm def % height of bottom code /bothi 7 mm def % height of bottom code /bottom 3 mm def % bottom gap /left 6 mm def /width 78 mm def /height 16.5 mm def /message (This edge of label toward hub of tape) def /messageypos 2.5 def /messageptsize 5 def /textsize 9 def /letterwidth 10 def /rectadjust 2 def /colours << /0 [ 1 0 0 ] /1 [ 1 1 0 ] /2 [ 0.5 1 0 ] /3 [ 0.4 0.7 0.7 ] /4 [ 0.5 0.5 0.5 ] /5 [ 1 0.5 0 ] /6 [ 1 0.5 1 ] /7 [ 0 0.5 0 ] /8 [ 1 0.75 0 ] /9 [ 0.5 0 0.7 ] >> def /c39 code (includecheck dontdraw) /code39 /uk.co.terryburton.bwipp findresource exec def /barwid c39 (sbs) get 0 exch {add} forall 72 div def % set clipping to outside of label 0 0 width 72 mul height 72 mul rectclip % draw the box around the label gsave 0.2 setlinewidth 0.6 setgray newpath 0 0 moveto 0 height 72 mul lineto width 72 mul height 72 mul lineto width 72 mul 0 lineto 0 0 lineto stroke grestore % draw the top barcode gsave left 72 mul bottom 72 mul bothi 72 mul add vgap 72 mul add moveto topwid barwid div tophi scale c39 dup (ren) get exec grestore % draw the bottom barcode gsave left 72 mul botwid 72 mul add bottom 72 mul moveto botwid barwid div neg bothi scale c39 dup (ren) get exec grestore % draw the info text gsave /Helvetica findfont messageptsize scalefont setfont newpath width 72 mul 2 div message stringwidth pop 2 div sub messageypos moveto message show grestore % create the text % % set starting X position: first get the right X pos of the top % barcode: left 72 mul topwid 72 mul add % and then subtract the length of our bit of text: code length 2 sub letterwidth mul sub % and adust slightly for the border. hack alert. 3 sub % now get the y position (half way up the bottom barcode): bothi 72 mul 2 div bottom 72 mul add % background colour 2 copy userdict /bordercolour known { gsave bordercolour aload pop setrgbcolor 2 copy % set x position of outer (semi-) border exch letterwidth sub rectadjust add exch % and y position bothi 72 mul 2 div sub code length 2 sub letterwidth mul bothi 72 mul rectfill grestore } if newpath moveto /Helvetica-Bold findfont textsize scalefont setfont % now draw each letter in turn, except the last two letters 0 1 code length 3 sub { % get the letter code exch 1 getinterval % do we need to draw a coloured box behind this character? dup cvn colours exch known { gsave dup cvn colours exch get aload pop setrgbcolor % get bottom left hand position for bg rectangle currentpoint bothi 72 mul 2 div sub % adjust x-value for position of letter exch letterwidth sub rectadjust add exch % set rectangle width/height and draw letterwidth bothi 72 mul rectfill grestore } if % find its width / 2 dup stringwidth pop 2 div % move to the right place, rotate and draw gsave 90 rotate neg 0 rmoveto show grestore % shift to the next letter letterwidth 0 rmoveto } for % draw the last two letters code dup length 2 sub 2 getinterval dup stringwidth pop 2 div gsave 90 rotate neg 0 rmoveto show grestore % and the border stroke gsave userdict /bordercolour known { bordercolour aload pop setrgbcolor } if % set x position of outer (semi-) border exch letterwidth sub rectadjust add exch % and y position bothi 72 mul 2 div sub newpath 1 setlinewidth code length 1 sub letterwidth mul bothi 72 mul rectstroke grestore end } bind def << /PageSize [ 595 841 ] /ImagingBBox null >> setpagedevice /gridx 3 def /gridy 11 def /xstep 78 72 mul 25.4 div def /ystep 16.5 72 mul 25.4 div def /leftborder 36 def % 0.5 in /bottomborder 36 def % 0.5 in % we want landscape pages 0 841 translate -90 rotate 0 1 gridx 1 sub { /x exch def 0 1 gridy 1 sub { /y exch def % roll number around after 999, back to 0 number 999 gt { /number 0 def } if x xstep mul leftborder add %gridy y sub 1 sub ystep mul bottomborder add y ystep mul bottomborder add gsave translate % create new string to hold the code /s suffix length prefix length 3 add add string def % set all characters to "0" to start with 0 1 s length 1 sub { s exch (0) 0 get put } for % copy prefix in to it s 0 prefix putinterval % copy suffix in to it s s length suffix length sub suffix putinterval % put the number in /numstring number 3 string cvs def s prefix length 3 numstring length sub add numstring putinterval s LTOlabel /number number 1 add def grestore } for } for showpage postscriptbarcode-2014-03-12/contrib/Examples/PostScript/spot_color/000077500000000000000000000000001231007474100253465ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/PostScript/spot_color/datamatrix-spot-color.eps000066400000000000000000000354631231007474100323270ustar00rootroot00000000000000%!PS-Adobe-2.0 EPSF-1.2 %%Title: DataMatrix 2D bar code Spot Color %%Creator: Ray Johnson (EPS Code) %%CreationDate: 12-5-08 %%BoundingBox: 0 0 85.5 37 %%DocumentProcessColors: Cyan Magenta Yellow Black %%DocumentCustomColors: (2D-Spot) %%CMYKCustomColor: 1.00 0.50 0.00 0.00 (2D-Spot) %%EndComments %%BeginProcSet: RJ_Header 1 0 /RJ_ColorDict 30 dict def RJ_ColorDict begin /bdef { dup xcheck { bind } if def } bind def /xdef { exch def } bdef /ndef { 1 index where { pop pop pop }{ dup xcheck { bind } if def }ifelse } bdef /prevtint 1.0 def /setcustomcolor { dup /prevtint xdef exch aload pop pop 4 { 4 index mul 4 1 roll } repeat setcmykcolor pop } ndef /setseparationgray { setgray } ndef /findcmykcustomcolor { 5 /packedarray where { pop packedarray }{ array astore readonly }ifelse } ndef /DC { 6 /packedarray where { pop packedarray }{ array astore readonly }ifelse } bdef /C % [c m y k | tint custom | separationgray] C - { dup length 4 eq { aload pop setcmykcolor } { dup length 2 eq { aload 1 get colormap exch get 5 get pop colormap exch get aload pop pop findcmykcustomcolor exch setcustomcolor } { aload pop 1 exch sub setseparationgray }ifelse }ifelse } bdef /colormap[ 1.00 0.00 0.00 0.00 (Process Cyan) false DC 0.00 1.00 0.00 0.00 (Process Magenta) false DC 0.00 0.00 1.00 0.00 (Process Yellow) false DC 0.00 0.00 0.00 1.00 (Process Black) true DC 1.00 0.50 0.00 0.00 (2D-Spot) true DC ] def end %RJ_ColorDict %%EndProcSet %%EndProlog /datamatrix { 0 begin /options exch def /useropts options def /barcode exch def /columns 0 def /rows 0 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /columns columns cvi def /rows rows cvi def % Split the input barcode into an array of codewords /cws barcode length array def /i 0 def /j 0 def { % loop i barcode length eq {exit} if /cw barcode i 1 add 3 getinterval cvi def cws j cw put /i i 4 add def /j j 1 add def } loop /cws cws 0 j getinterval def % Basic metrics for the each symbol % rows cols regh regv rscw rsbl /metrics [ % Standard square symbols [ 10 10 1 1 5 1 ] [ 12 12 1 1 7 1 ] [ 14 14 1 1 10 1 ] [ 16 16 1 1 12 1 ] [ 18 18 1 1 14 1 ] [ 20 20 1 1 18 1 ] [ 22 22 1 1 20 1 ] [ 24 24 1 1 24 1 ] [ 26 26 1 1 28 1 ] [ 32 32 2 2 36 1 ] [ 36 36 2 2 42 1 ] [ 40 40 2 2 48 1 ] [ 44 44 2 2 56 1 ] [ 48 48 2 2 68 1 ] [ 52 52 2 2 84 2 ] [ 64 64 4 4 112 2 ] [ 72 72 4 4 144 4 ] [ 80 80 4 4 192 4 ] [ 88 88 4 4 224 4 ] [ 96 96 4 4 272 4 ] [ 104 104 4 4 336 6 ] [ 120 120 6 6 408 6 ] [ 132 132 6 6 496 8 ] [ 144 144 6 6 620 10 ] % Optional rectangular symbols [ 8 18 1 1 7 1 ] [ 8 32 1 2 11 1 ] [ 12 26 1 1 14 1 ] [ 12 36 1 2 18 1 ] [ 16 36 1 2 24 1 ] [ 16 48 1 2 28 1 ] ] def % Select metrics of an appropriate symbol /urows rows def /ucols columns def /i 0 def { % loop /m metrics i get def /rows m 0 get def % Rows in symbol /cols m 1 get def % Columns in symbol /regh m 2 get def % Horizontal regions /regv m 3 get def % Vertical regions /rscw m 4 get def % Error correction codewords /rsbl m 5 get def % Error correction blocks /mrows rows 2 regh mul sub def % Rows in the mapping matrix /mcols cols 2 regv mul sub def % Columns in the mapping matrix /rrows mrows regh idiv def % Rows per region /rcols mcols regv idiv def % Columns per region /ncws mrows mcols mul 8 idiv rscw sub def % Data codewords /okay true def cws length ncws gt {/okay false def} if urows 0 ne urows rows ne and {/okay false def} if ucols 0 ne ucols cols ne and {/okay false def} if okay {exit} if /i i 1 add def } loop % Extend cws to ncws codewords by addition of pseudo-randomised pad characters cws length ncws lt { /datlen cws length def /cws [ cws {} forall ncws datlen sub {129} repeat ] def datlen 1 add 1 ncws 1 sub { /i exch def i 1 add 149 mul 253 mod 1 add 129 add dup 254 gt {254 sub} if cws exch i exch put } for } if % De-interleave the codewords into blocks /cwbs rsbl array def % Array of data codeword blocks /ecbs rsbl array def % Array of error correction blocks 0 1 rsbl 1 sub { /i exch def cws length 1558 ne { /cwbsize cws length rsbl idiv def } { i 7 le {/cwbsize 156 def} {/cwbsize 155 def} ifelse } ifelse /cwb cwbsize array def 0 1 cwbsize 1 sub { /j exch def cwb j cws j rsbl mul i add get put } for cwbs i cwb put ecbs i [ rscw rsbl idiv {0} repeat ] put } for % Calculate the log and anti-log tables /rslog [ -255 255 {0} repeat ] def /rsalog [ 1 255 {0} repeat ] def 1 1 255 { /i exch def rsalog i rsalog i 1 sub get 2 mul put rsalog i get 256 ge { rsalog i rsalog i get 301 xor put } if rslog rsalog i get i put } for % Function to calculate the product in the field /rsprod { /y exch def /x exch def x y mul 0 ne { rsalog rslog x get rslog y get add 255 mod get } { 0 } ifelse } bind def % Generate the coefficients /coeffs [ 1 rscw rsbl idiv {0} repeat ] def 1 1 rscw rsbl idiv { /i exch def coeffs i coeffs i 1 sub get put i 1 sub -1 1 { /j exch def coeffs j coeffs j 1 sub get coeffs j get rsalog i get rsprod xor put } for coeffs 0 coeffs 0 get rsalog i get rsprod put } for /coeffs coeffs 0 coeffs length 1 sub getinterval def % Calculate the error correction codewords for each block 0 1 cwbs length 1 sub { /i exch def /cwb cwbs i get def /ecb ecbs i get def 0 1 cwb length 1 sub { /t exch cwb exch get ecb 0 get xor def ecb length 1 sub -1 0 { /j exch def /p ecb length j sub 1 sub def t 0 eq { ecb p 0 put } { ecb p rsalog rslog t get rslog coeffs j get get add 255 mod get put } ifelse j 0 gt { ecb p ecb p 1 add get ecb p get xor put } if } for } for ecbs i ecb put } for % Extend codewords with the interleaved error correction codes /cws [ cws {} forall rscw {0} repeat ] def 0 1 rscw 1 sub { /i exch def cws ncws i add ecbs i rsbl mod get i rsbl idiv get put } for % Create the module placement matrix /module { /tmpc exch def /tmpr exch def tmpr 0 lt { /tmpr tmpr mrows add def /tmpc tmpc 4 mrows 4 add 8 mod sub add def } if tmpc 0 lt { /tmpc tmpc mcols add def /tmpr tmpr 4 mcols 4 add 8 mod sub add def } if mmat tmpr mcols mul tmpc add bit put /bit bit 1 add def } bind def /mmat [ mrows mcols mul {-1} repeat ] def /bit 0 def /row 4 def /col 0 def { % loop row mrows eq col 0 eq and { [ [mrows 1 sub 0] [mrows 1 sub 1] [mrows 1 sub 2] [0 mcols 2 sub] [0 mcols 1 sub] [1 mcols 1 sub] [2 mcols 1 sub] [3 mcols 1 sub] ] {{} forall module} forall } if row mrows 2 sub eq col 0 eq and mcols 4 mod 0 ne and { [ [mrows 3 sub 0] [mrows 2 sub 0] [mrows 1 sub 0] [0 mcols 4 sub] [0 mcols 3 sub] [0 mcols 2 sub] [0 mcols 1 sub] [1 mcols 1 sub] ] {{} forall module} forall } if row mrows 2 sub eq col 0 eq and mcols 8 mod 4 eq and { [ [mrows 3 sub 0] [mrows 2 sub 0] [mrows 1 sub 0] [0 mcols 2 sub] [0 mcols 1 sub] [1 mcols 1 sub] [2 mcols 1 sub] [3 mcols 1 sub] ] {{} forall module} forall } if row mrows 4 add eq col 2 eq and mcols 8 mod 0 eq and { [ [mrows 1 sub 0] [mrows 1 sub mcols 1 sub] [0 mcols 3 sub] [0 mcols 2 sub] [0 mcols 1 sub] [1 mcols 3 sub] [1 mcols 2 sub] [1 mcols 1 sub] ] {{} forall module} forall } if { % loop for sweeping upwards row mrows lt col 0 ge and { mmat row mcols mul col add get -1 eq { [ [row 2 sub col 2 sub] [row 2 sub col 1 sub] [row 1 sub col 2 sub] [row 1 sub col 1 sub] [row 1 sub col] [row col 2 sub] [row col 1 sub] [row col] ] {{} forall module} forall } if } if /row row 2 sub def /col col 2 add def row 0 ge col mcols lt and not {exit} if } loop /row row 1 add def /col col 3 add def { % loop for sweeping downwards row 0 ge col mcols lt and { mmat row mcols mul col add get -1 eq { [ [row 2 sub col 2 sub] [row 2 sub col 1 sub] [row 1 sub col 2 sub] [row 1 sub col 1 sub] [row 1 sub col] [row col 2 sub] [row col 1 sub] [row col] ] {{} forall module} forall } if } if /row row 2 add def /col col 2 sub def row mrows lt col 0 ge and not {exit} if } loop /row row 3 add def /col col 1 add def row mrows lt col mcols lt or not {exit} if } loop % Set checker pattern if required mmat mrows mcols mul 1 sub get -1 eq { mmat mrows mcols 1 sub mul 2 sub [-1 -2] putinterval mmat mrows mcols mul 2 sub [-2 -1] putinterval } if % Invert the map to form the mapping matrix correcting the checker case /modmap mrows mcols mul 8 idiv 8 mul array def 0 1 mmat length 1 sub { /i exch def mmat i get 0 ge { modmap mmat i get i put } { mmat i mmat i get 2 add put } ifelse } for % Place the codewords in the matrix according to the mapping matrix 0 1 cws length 1 sub { /i exch def [ 8 {0} repeat cws i get 2 8 string cvrs {48 sub} forall ] dup length 8 sub 8 getinterval /bits exch def 0 1 7 { /j exch def mmat modmap i 8 mul j add get bits j get put } for } for % Place the modules onto a pixel map between alignment patterns /pixs rows cols mul array def /cwpos 0 def 0 1 rows 1 sub { /i exch def i rrows 2 add mod 0 eq { pixs i cols mul [ cols 2 idiv {1 0} repeat ] putinterval } if i rrows 2 add mod rrows 1 add eq { pixs i cols mul [ cols {1} repeat ] putinterval } if i rrows 2 add mod 0 ne i rrows 2 add mod rrows 1 add ne and { 0 1 cols 1 sub { /j exch def j rcols 2 add mod 0 eq { pixs i cols mul j add 1 put } if j rcols 2 add mod rcols 1 add eq { pixs i cols mul j add i 2 mod put } if j rcols 2 add mod 0 ne j rcols 2 add mod rcols 1 add ne and { pixs i cols mul j add mmat cwpos get put /cwpos cwpos 1 add def } if } for } if } for /retval 7 dict def retval (ren) (renmatrix) put retval (pixs) pixs put retval (pixx) cols put retval (pixy) rows put retval (height) rows 72 div 1.5 mul put retval (width) cols 72 div 1.5 mul put retval (opt) useropts put retval end } bind def /datamatrix load 0 1 dict put /renmatrix { 0 begin /args exch def % Default options /width 1 def /height 1 def /color (unset) def /backgroundcolor (unset) def % Apply the renderer options args {exch cvlit exch def} forall % Parse the user options opt { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /width width cvr def /height height cvr def /color color cvlit def /backgroundcolor backgroundcolor cvlit def % Extend bitmap horizontally to an 8-bit boundary /pixx8 pixx 8 div ceiling cvi 8 mul def /pixs8 [ pixx8 pixy mul {0} repeat ] def 0 1 pixy 1 sub { /i exch def pixs8 pixx8 i mul pixs pixx i mul pixx getinterval putinterval } for /pixs pixs8 def % Convert bitmap into 8-bit sample string /imgstr pixs length 8 idiv string def 0 1 pixs length 1 sub { /i exch def imgstr i 8 idiv 2 copy get 2 7 i 8 mod sub exp cvi pixs i get mul add put } for % Set RGB or CMYK color depending on length of given hex string /setanycolor { /anycolor exch def anycolor length 6 eq { (< >) 8 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setrgbcolor } if anycolor length 8 eq { (< >) 10 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setcmykcolor } if } bind def % Draw the image gsave currentpoint translate 72 width mul 72 height mul scale .0001 .0001 moveto .9999 .0001 lineto .9999 .9999 lineto .0001 .9999 lineto closepath backgroundcolor (unset) ne { gsave backgroundcolor setanycolor fill grestore } if color (unset) ne { color setanycolor } if pixx pixy true [ pixx 0 0 pixy neg 0 pixy ] {imgstr} imagemask grestore end } bind def /renmatrix load 0 1 dict put /barcode { 0 begin dup (ren) get cvx exec end } bind def /barcode load 0 1 dict put RJ_ColorDict begin % set color [1 4]C 1.5 0 moveto (^142^164^186) (rows=24 columns=24) datamatrix barcode /Helvetica findfont 8 scalefont setfont 40 20 moveto (123456) show 40 10 moveto (Data Matrix) show %%Trailer end %RJ_ColorDict postscriptbarcode-2014-03-12/contrib/Examples/bash/000077500000000000000000000000001231007474100217665ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/bash/splitter.sh000066400000000000000000000054611231007474100241760ustar00rootroot00000000000000#!/bin/bash # Copyright (c) 2008, Michael Landers # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # * The names of its contributors may not be used to endorse or promote # products derived from this software without specific prior written # permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. FILE=barcode.ps OUTFILE=- LIST=0 ES="" BE="% --BEGIN ENCODER" EE="% --END ENCODER" BR="% --BEGIN RENDERER" ER="% --END RENDERER" ES="" RS="" elementInList() { e="$1" shift for i in $* do [ "$e" = "$i" ] && return 0 done return 1 } while getopts "f:o:le:" flag do case ${flag} in f) FILE="${OPTARG}" ;; l) LIST=1 ;; o) OUTFILE="${OPTARG}" ;; e) ! elementInList "${OPTARG}" "${ES}" && ES="${ES} ${OPTARG}" ;; *) exit; esac done ELIST=$(sed -n "s/^${BE} \(.*\)--/\1/p" ${FILE} | sort) [ "$LIST" -eq 1 ] && echo "Available Encoders: ${ELIST}" && exit [ "$ES" = "" ] && echo "No encoders specified. Nothing to do" && exit for encoder in ${ES} do ! elementInList $encoder ${ELIST} && echo "${encoder}: Invalid encoder" && exit renderer=$(sed -n "/^${BE} ${encoder}--/,/^${EE} ${encoder}/s/^% --RNDR: \(.*\)/\1/p" ${FILE}) ! elementInList $renderer $RS && RS="$RS $renderer" done [ "x$OUTFILE" != "x-" ] && exec > $OUTFILE sed -n '1,/^% --BEGIN TEMPLATE--/p' ${FILE} for e in ${ES} do echo sed -n "/^${BE} ${e}--/,/${EE} ${e}--/p" ${FILE} done for r in ${RS} do echo sed -n "/^${BR} ${r}--/,/${ER} ${r}--/p" ${FILE} done echo sed -n '/^% --BEGIN DISPATCHER--/,$p' ${FILE} postscriptbarcode-2014-03-12/contrib/Examples/java/000077500000000000000000000000001231007474100217725ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/java/UPCA_print/000077500000000000000000000000001231007474100237365ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/java/UPCA_print/README.html000066400000000000000000000003021231007474100255540ustar00rootroot00000000000000
This example will print a page of UPC-As, ranging between two given values, to 
the first available PostScript printer. The code may be called like this: 

$ java UPCAs 74271 74292
postscriptbarcode-2014-03-12/contrib/Examples/java/UPCA_print/UPCAs.java000066400000000000000000000041311231007474100255130ustar00rootroot00000000000000import java.io.*; import java.util.regex.*; import javax.print.*; import javax.print.attribute.*; public class UPCAs { public static void main(String[] args) throws Exception { if (args.length!=2) throw new Exception("Requires two arguments"); String template=""; try { BufferedReader in=new BufferedReader(new FileReader("barcode.ps")); String line; while ((line=in.readLine())!=null) template+=line+"\n"; in.close(); } catch (IOException e) { throw new Exception("File not found"); } Matcher m=Pattern.compile( "(?s).*% --BEGIN TEMPLATE--(.*)"+ "% --END TEMPLATE--.*").matcher(template); if (!m.matches()) throw new Exception("Unable to parse out template"); String contents="%!PS-Adobe-2.0\n"+m.group(1); for (int i=Integer.parseInt(args[0]), j=0; i Hi, The following is a quickie Common Lisp script that generates a 8.5x11 page of code39 labels suitable for sticking onto AIT tape so they can be numbered for changers that have barcode scanners. To run it, you'll need a Common Lisp implementation installed. I developed it using CLISP but CMUCL or most any other one should work. It should work fine on any OS that hosts a usable Lisp implementation and can pipe to a file and submit it to a PS printer. Run as; clisp -q ait-label.lisp | lp Since it generates data to stdio, it can be piped to less for debugging. To change the tape numbers, edit the parameters in the lisp file. It wouldn't be hard to take parameters on the commandline or prompt for them, but whaddya want for free... I just tested its codes in our tape changer and they work fine. Thanks! Greg ---- Hi Terry, Here is a final update. The previous version, while interesting, just prints a couple columns of barcodes, but would not print to match common adhesive label paper formats. I modified the script to accept the definition of a page of labels, then print barcodes to fill each "pane" which can then be sheared out. So the new version has a definition for Avery 6873 labels and can be modified for additional label page layouts also. All thats required is a sample of the label page and a ruler to measure the various parameters. The "bcode" invocation at the end of the script is what executes the program, so the parameters can be changed according to local preferences. This makes the script a whole lot more useful. Greg postscriptbarcode-2014-03-12/contrib/Examples/lisp/ait_label_gen/ait-label.lisp000066400000000000000000000133601231007474100273130ustar00rootroot00000000000000;;; ;;; Barcode generator for AIT tapes ;;; ;;; ;;; Copyright (C) 2005 by Greg Menke, gregm-news@toadmail.com ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License ;;; as published by the Free Software Foundation; either version 2 ;;; of the License, or (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program; if not, write to the Free Software ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; ;;; http://www.gnu.org/licenses/gpl.html ;;; ;;; ;;; ;;; Uses the Pure Postscript Barcode Generator: ;;; http://www.terryburton.co.uk/barcodewriter/ ;;; ;;; ;;; ;;; This script can be run by most any Common Lisp implementation. ;;; Unless you have one installed already, CLISP is generally the ;;; most broadly available and quickest to install. CLISP is available ;;; an binary and source forms at ;;; ;;; http://clisp.cons.org/ ;;; ;;; ;;; To run the script using CLISP, invoke the following in the same ;;; directory where the Pure Postscript files were extracted. ;;; ;;; clisp -q ait-tape.lisp | lp ;;; ;;; This assumes 'lp' has a default printer that accepts postscript, ;;; modify as required to direct the output properly. ;;; (defstruct pagedef (pane-rows) (pane-cols) (pane-width) (pane-height) (pane-inside-horizontal) (pane-inside-vertical) (left-pane-offset) (top-pane-offset) (pane-divider-width) (pane-divider-height)) ;;; ;;; postscript points are 1/72" ;;; (defparameter %DPI% 72) (defun make-barcode-coordinates (pdef) (let* ((bc-coords nil) (bc-width (* %WIDTH-PER-CODE% %DPI%)) (bc-height (* %HEIGHT-PER-CODE% %DPI%)) (pane-width (* (pagedef-pane-width pdef) %DPI%)) (pane-height (* (pagedef-pane-height pdef) %DPI%)) (pane-inside-hor (* (pagedef-pane-inside-horizontal pdef) %DPI%)) (pane-inside-vert (* (pagedef-pane-inside-vertical pdef) %DPI%)) (pane-offset-x (* (pagedef-left-pane-offset pdef) %DPI%)) (pane-offset-y (* (pagedef-top-pane-offset pdef) %DPI%)) (pane-divider-width (* (pagedef-pane-divider-width pdef) %DPI%)) (pane-divider-height (* (pagedef-pane-divider-height pdef) %DPI%)) ) (let ((bcodes-per-pane-horiz (floor (/ pane-width (+ bc-width (* pane-inside-hor 2)))) ) (bcodes-per-pane-vert (floor (/ pane-height (+ bc-height (* pane-inside-vert 2)))) ) ) (loop for pcol from 0 below (pagedef-pane-cols pdef) for basex = (+ pane-offset-x (* pcol pane-width) (* pcol pane-divider-width)) do (loop for prow from 0 below (pagedef-pane-rows pdef) for basey = (+ pane-offset-y (* prow pane-height) (* prow pane-divider-height)) do (loop for bcol from 0 below bcodes-per-pane-horiz for barcodex = (+ basex (* bcol bc-width) pane-inside-hor) do (loop for brow from 0 below bcodes-per-pane-vert for barcodey = (+ basey (* brow bc-height) pane-inside-vert bc-height) do (push (list (floor barcodex) (floor barcodey)) bc-coords) )))) ) (coerce (reverse bc-coords) 'vector) )) (defun print-strings ( slist ) "Print each postscript string to standard-output, terminating with newlines" (loop for e in slist do (cond ((typep e 'cons) (print-strings e)) (t (format *standard-output* "~A~%" e)) ) )) (defun bcode (bcode pagedef startval endval &optional (opts "")) "Create the barcode postscript strings, then print them" (let* ((prolog-strings '("%!PS-Adobe-2.0")) (template-strings (with-open-file (str "barcode.ps" :direction :input :if-does-not-exist :error) ;; skip file text till we hit BEGIN TEMPLATE (loop for l = (read-line str nil nil) while (and l (not (search "% --BEGIN TEMPLATE--" l))) ) ;; now inside template (loop for l = (read-line str nil nil) while (and l (not (search "% --END TEMPLATE--" l))) collect l)) ) (content-opts (concatenate 'string opts (format nil " height=~D " %BOPT-HEIGHT%)) ) (content-strings (loop with bc-coords = (make-barcode-coordinates pagedef) for i from startval upto endval for j from 0 below (length bc-coords) collect (list "gsave" (destructuring-bind (x y) (svref bc-coords j) (format nil "~D ~D translate" x y)) (format nil "0 0 moveto (~A) (~A) ~A barcode" (format nil "~6,'0D" i) content-opts bcode) "grestore")) ) (epilog-strings '("showpage")) ) ;; ;; now accumulate the strings and print them in order ;; (print-strings (append prolog-strings template-strings content-strings epilog-strings)) )) ;;; ;;; Parameters in inches ;;; (defparameter %WIDTH-PER-CODE% 2.250 ) (defparameter %HEIGHT-PER-CODE% 0.375 ) (defparameter %BOPT-HEIGHT% 0.24 ) ;;; ;;; Page definitions, in inches ;;; (defparameter %avery-6873% (make-pagedef :pane-rows 4 :pane-cols 2 :pane-width 3.75 :pane-height 2.00 :pane-inside-horizontal 0.062 :pane-inside-vertical 0.062 :left-pane-offset 0.375 :top-pane-offset 1.125 :pane-divider-width 0.250 :pane-divider-height 0.250)) ;;; ;;; Adjust parameters of this call to select the barcode format, ;;; text numbers and text options ;;; (bcode "code39" %avery-6873% 10 40 "includetext includecheck") ;;; eof postscriptbarcode-2014-03-12/contrib/Examples/perl/000077500000000000000000000000001231007474100220135ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/perl/ean13_print/000077500000000000000000000000001231007474100241365ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/perl/ean13_print/README.html000066400000000000000000000002551231007474100257630ustar00rootroot00000000000000
This example will print a page of EAN-13s ranging between two given values 
when called from a shell like this: 

$ ./ean13s.pl 978186074271 978186074292 | lpr
postscriptbarcode-2014-03-12/contrib/Examples/perl/ean13_print/ean13s.pl000066400000000000000000000011321231007474100255620ustar00rootroot00000000000000#!/usr/bin/perl -w use strict; die 'Requires two arguments' if (@ARGV!=2); open(PS,'barcode.ps') || die 'File not found'; $_=join('',); close(PS); print "%!PS-Adobe-2.0\n"; m/ %\ --BEGIN\ TEMPLATE-- (.*) %\ --END\ TEMPLATE-- /sx || die 'Unable to parse out the template'; print $1; for (my $i=$ARGV[0], my $j=0; $i<$ARGV[1]; $i++, $j++) { my $x=100+150*(int($j/7)); my $y=100+100*($j%7); print "gsave\n"; print "$x $y moveto\n"; print "($i) (includetext) /ean13 /uk.co.terryburton.bwipp findresource exec\n"; print "grestore\n"; } print "showpage\n"; postscriptbarcode-2014-03-12/contrib/Examples/perl/eps_gen/000077500000000000000000000000001231007474100234335ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/Examples/perl/eps_gen/README.html000066400000000000000000000002221231007474100252520ustar00rootroot00000000000000
This example will generate several EPS files using the data from a supplied 
text file when run like this: 

$ ./genfigs.pl figs.txt
postscriptbarcode-2014-03-12/contrib/Examples/perl/eps_gen/figs.txt000066400000000000000000000026741231007474100251350ustar00rootroot00000000000000isbn.eps:110:95:(978-1-58880-149) (includetext) /isbn /uk.co.terryburton.bwipp findresource exec ean13.eps:110:85:(978186074271) (includetext) /ean13 /uk.co.terryburton.bwipp findresource exec ean8.eps:75:85:(12345678) (includetext) /ean8 /uk.co.terryburton.bwipp findresource exec upca.eps:110:85:(78858101497) (includetext) /upca /uk.co.terryburton.bwipp findresource exec upce.eps:70:85:(0123456) (includetext) /upce /uk.co.terryburton.bwipp findresource exec ean5.eps:70:85:(90200) (includetext) /ean5 /uk.co.terryburton.bwipp findresource exec ean2.eps:30:85:(38) (includetext) /ean2 /uk.co.terryburton.bwipp findresource exec code128.eps:170:85:(Count1234!) (includetext) /code128 /uk.co.terryburton.bwipp findresource exec code39.eps:175:85:(CODE-39) (includecheck includetext) /code39 /uk.co.terryburton.bwipp findresource exec codabar.eps:160:85:(A0123456789B) (includetext) /rationalizedCodabar /uk.co.terryburton.bwipp findresource exec code25.eps:175:85:(0123456789) (includetext) /code2of5 /uk.co.terryburton.bwipp findresource exec itf.eps:130:85:(0123456789) (includecheck) /interleaved2of5 /uk.co.terryburton.bwipp findresource exec postnet.eps:190:43:3 2 div dup scale (0123456789) (includetext) /postnet /uk.co.terryburton.bwipp findresource exec msi.eps:200:85:(0123456789) (includecheck includetext) /msi /uk.co.terryburton.bwipp findresource exec plessey.eps:275:85:(012345ABCDEF) (includetext) /plessey /uk.co.terryburton.bwipp findresource exec postscriptbarcode-2014-03-12/contrib/Examples/perl/eps_gen/genfigs.pl000077500000000000000000000015751231007474100254250ustar00rootroot00000000000000#!/usr/bin/perl -w use strict; open(PS,'barcode.ps') || die 'File not found'; $_=join('',); close(PS); m/ %\ --BEGIN\ TEMPLATE-- (.*) %\ --END\ TEMPLATE-- /sx || die 'Unable to parse out the template'; my $template=''; $template.="%!PS-Adobe-2.0 EPSF-2.0\n"; $template.="%%BoundingBox: 0 0 [% width %] [% height %]\n"; $template.="%%EndComments"; $template.=$1; $template.="10 7 moveto\n"; $template.="[% call %]\n"; $template.="showpage\n"; open(IN,'figs.txt'); my @figs=; close(IN); foreach $_ (@figs) { m/^(.*):(.*):(.*):(.*)$/ || die "Bad line: $_"; my $filename=$1; my $width=$2; my $height=$3; my $contents=$4; my $barcode=$template; $barcode=~s/\[% call %\]/$contents/; $barcode=~s/\[% width %\]/$width/; $barcode=~s/\[% height %\]/$height/; open(OUT,"> $filename"); print OUT $barcode; close(OUT); } postscriptbarcode-2014-03-12/contrib/citations/000077500000000000000000000000001231007474100212705ustar00rootroot00000000000000postscriptbarcode-2014-03-12/contrib/citations/citations.txt000066400000000000000000000071311231007474100240300ustar00rootroot00000000000000The following is a list of known references to Barcode Writer in Pure PostScript project and its derivatives. If you are aware of any noteworthy additions to this list then please inform the BWIPP mailing list. ---- Barcode Writer in Pure PostScript (http://www.terryburton.co.uk/barcodewriter/) Flack, Chapman. (2006) "Direct Use of the PostScript Language," http://www.anastigmatix.net/postscript/direct.html Janssen, Mark. (2008) "Creating LTO barcodes," http://blog.maniac.nl/2008/05/28/creating-lto-barcodes/ Janssen, Mark. (2009) "Webbased (PDF) LTO Barcode Generator," http://blog.maniac.nl/webbased-pdf-lto-barcode-generator/ Russell, Robert. (2010) "Barcodes in SAP with the Barcode Writer in Pure Postscript," http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/21446 Seichter, Dominik. (2010) "KBarcode4 Light Released," http://domseichter.blogspot.com/2010/08/kbarcode4-light-released.html Willis, Nathan. (2010) "Barcode Writer in Pure PostScript," http://blog.worldlabel.com/2010/barcode-writer-in-pure-postscript.html Russell, Robert. (2011) "More Barcodes with Barcode Writer in Pure Postscript," http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/22827 ---- Barcode Writer in Pure PostScript Online Generator (http://www.terryburton.co.uk/barcodewriter/generator/) Misbach, Matt (2008). "How to self publish the easy and FREE way," http://www.uvpafug.org/presentations/Howtoselfpublish_2008_Syllabus.pdf "Designing Books (with InDesign)," papergeko: Handbuilt Websites & Artists' Books, http://papergecko.co.uk/new/wp-content/uploads/2008/12/bookdesigncourse_day4.pdf Tyree, Alan L. (2007) "Self-publishing with LyX," Sage Tutorial Systems Pty Ltd, p. 57. ISBN 9780980332421. Link embedded in the PrintDreams XDR PC-link application for programming the Xyron Design Runner label printer, http://www.printdreams.co.uk/XDR_PC-link_User_Guide.pdf "Finding the Start of Another Tether," Rupture, Random Artists, January 2007. http://www.randomartists.org/rupture/rupture-jan07-screen.pdf Koamtac (2013) "Creating Special Bar Codes To Configure Your KDC," Revision 1.0. http://www.koamtac.com/documents/manuals/How_To_Create_KOAMTAC_Special_BarCodes.pdf ---- pst-barcode (http://www.ctan.org/tex-archive/graphics/pstricks/contrib/pst-barcode/) Goossens, M., Mittelbach F., Rahtz, S., Roegel, D. (2007) "The LaTeX Graphics Companion," Addison Wesley. ISBN 9780321508928. Thompson, Paul A. (2008) "Clinical trials management on the internet - II. Using LATEX, PostScript, and SAS to produce barcode label sheets," The PracTeX Journal, Number 3. Robbers, Yuri & Skjold, Annemarie. (2007) "Creating Book Covers using PSTricks," The PracTex Journal, Number 1. Secondo, Stefano. (2009) "Cover Letter With Style - Part Six," http://stefano.italians.nl/archives/65 Voß, Herbert. (2010) "The current state of the PSTricks project," The TUGboat Journal, Volume 31i, Number 1. p. 36. Brampton, Andrew. (2010) "LaTeX QR Based Business Card," http://bramp.net/blog/latex-qr-based-business-card Pascal. (2011) "QR Code with Latex," http://xaphire.de/recipes/?p=344 Voß, Herbert. (2011) "Ch 26: pst-barcode - Bar codes" in "PSTricks. Graphics and PostScript for TeX and LaTeX," Cambridge: UIT Cambridge. pp. 497-508. ---- Scribus Barcode Generator Plugin (http://docs.scribus.net/devel/barcode_8cpp.html) "Libre Graphics: Scribus. Open Source Desktop Publishing Turns Pro," Linux Format, Issue 80 (June 2006). Future Publishing. p. 54. ---- KBarcode (http://www.kbarcode.net/) Willis, Nathan. (2010) "Generating Barcodes with KBarcode," Worldlabel.com Incorporated, http://blog.worldlabel.com/2010/generating-barcodes-with-kbarcode.html postscriptbarcode-2014-03-12/debian/000077500000000000000000000000001231007474100170555ustar00rootroot00000000000000postscriptbarcode-2014-03-12/debian/changelog000066400000000000000000000016171231007474100207340ustar00rootroot00000000000000libpostscriptbarcode (20131111-1) unstable; urgency=low * New upstream release * Added debian/watch * Added debian/libpostscriptbarcode.doc-base * debian/control: Remove Suggests: postscript-viewer * debian/control: Add Build-Depends: ghostscript * debian/control: Add Homepage, Vcs-Git and Vcs-Browser * debian/control: Use latest Standards-Version -- Terry Burton Mon, 11 Nov 2013 07:39:03 +0000 libpostscriptbarcode (20080710-1) unstable; urgency=low * New upstream release -- Terry Burton Mon, 18 Aug 2008 23:32:40 +0100 libpostscriptbarcode (20080406-1) unstable; urgency=low * New upstream release -- Terry Burton Sat, 14 Jun 2008 14:39:52 +0100 libpostscriptbarcode (20050908-1) unstable; urgency=low * Initial Release. -- Terry Burton Mon, 8 Sep 2005 00:56:06 +0100 postscriptbarcode-2014-03-12/debian/compat000066400000000000000000000000021231007474100202530ustar00rootroot000000000000008 postscriptbarcode-2014-03-12/debian/control000066400000000000000000000015751231007474100204700ustar00rootroot00000000000000Source: libpostscriptbarcode Section: devel Priority: optional Maintainer: Terry Burton Uploaders: Alexander List Build-Depends: debhelper (>= 8.0.0), ghostscript Standards-Version: 3.9.4 Homepage: http://www.terryburton.co.uk/barcodewriter/ Vcs-Git: git://github.com/terryburton/postscriptbarcode.git Vcs-Browser: http://github.com/terryburton/postscriptbarcode Package: libpostscriptbarcode Architecture: all Depends: ${misc:Depends} Description: Barcode Writer in Pure PostScript Barcode Writer in Pure Postscript generates all barcode formats entirely within PostScript so that the process of converting the input data into the printed output can be performed by the printer or RIP itself. This is ideal for variable data printing (VDP) and avoids the need to re-implement the barcode generation process whenever your language needs change. postscriptbarcode-2014-03-12/debian/copyright000066400000000000000000000024611231007474100210130ustar00rootroot00000000000000This package was debianized by Terry Burton on Mon, 9 Sep 2005 10:46:06 +0100. It was downloaded from http://www.terryburton.co.uk/barcodewriter/ Copyright Holder: Terry Burton Copyright (C) 2004-2014 Terry Burton License: MIT/X-Consortium License. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. postscriptbarcode-2014-03-12/debian/docs000066400000000000000000000000231231007474100177230ustar00rootroot00000000000000README TODO docs/* postscriptbarcode-2014-03-12/debian/install000066400000000000000000000002041231007474100204420ustar00rootroot00000000000000build/monolithic_package/barcode.ps usr/share/libpostscriptbarcode/ build/monolithic_package/README usr/share/libpostscriptbarcode/ postscriptbarcode-2014-03-12/debian/libpostscriptbarcode.doc-base000066400000000000000000000005651231007474100247030ustar00rootroot00000000000000Document: libpostscriptbarcode Title: Barcode Writer in Pure PostScript Manual Author: Terry Burton Abstract: This manual describes how to use the Barcode Writer in Pure PostScript library. Section: Programming Format: PDF Files: /usr/share/doc/libpostscriptbarcode/barcodewriter.pdf.gz Format: PostScript Files: /usr/share/doc/libpostscriptbarcode/barcodewriter.ps.gz postscriptbarcode-2014-03-12/debian/rules000077500000000000000000000003261231007474100201360ustar00rootroot00000000000000#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 %: dh $@ --parallel override_dh_install: dh_install --exclude=LICENSE --exclude=CHANGES --exclude=.dirstamp postscriptbarcode-2014-03-12/debian/source/000077500000000000000000000000001231007474100203555ustar00rootroot00000000000000postscriptbarcode-2014-03-12/debian/source/format000066400000000000000000000000141231007474100215630ustar00rootroot000000000000003.0 (quilt) postscriptbarcode-2014-03-12/debian/watch000066400000000000000000000003601231007474100201050ustar00rootroot00000000000000version=3 opts="uversionmangle=s/^(....)-(..)-(.+)/$1$2$3/;s/-/./,filenamemangle=s!.*/(.*)!postscriptbarcode-$1!" https://github.com/terryburton/postscriptbarcode/releases /terryburton/postscriptbarcode/archive/(.+)\.tar\.gz debian uupdate postscriptbarcode-2014-03-12/docs/000077500000000000000000000000001231007474100165635ustar00rootroot00000000000000postscriptbarcode-2014-03-12/docs/barcodewriter.pdf000066400000000000000000003706221231007474100221240ustar00rootroot00000000000000%PDF-1.3 %쏢 6 0 obj <> stream x}Vn#7+Vo. k$׼ `ϣؚ]IgF8_)Y6>!ͪj>7A_,>c s:)) Swۥ zιTm鰗pNt\J$/ ɰM;<-3;cBqKO~(U\{ܖ[Tꑯz6kV@|JF ڈra?vqW TDw█86a\(U];;Z2RFz:Na'VZ_7[_h=5Ѓ$!GOD͸6tot*("r[UPCPtrD.ooֿsp| 㡺IJ4'Q(T!wU4ĚoMdQpc]eu)D,%"M,p&c UA*VD,>Wݮ"\C[)jOiG&ϧDFZpOX.^)<6$(AYj>+=֒W:@O;1H8ҷ͞ԇ.x:j ߆a%ᰛӧrʨ>v}&o +zE(Q{<ί'j+]]=MVQaÊ񂄖q.\畺krQd8T,Q:6ێY } 8#RzH^߉&ݹ)ul',͚W;A"ɎzXc*/qk/oT%Qq*mQN%`׮s~T6hZJKQb  -nh5V!ϮRn^Ŀ0Sendstream endobj 7 0 obj 1277 endobj 32 0 obj <> stream x[SFgOo~yJZfD[Y~ݒ- TR`ߞ>%ߋ~r k d>y7#B'{% @4'GeQgEy;<ǜ'#D{G輨+ b&\nu^ pG4%D&E2ծc\fƊ)`h]ui`) װfS 'S1c OϿdKDOj 0쿦uj] @zUW÷_(qIJ`lMAƿz jF Ț@YLC 14@|V|*tt]1*_z)q*T;ёg&YVhN~pE@'a)iKzEYgV`晃eh۴ZŭͪჴfvnL+'&tВqoxߗ8/鷶b ϳ 86M= bZ&biF#BUt} 깚P..YHk%+?6Q %DWw"ea֢Fqy|yyE뫯vRyR5SULg2rhv@g,Oy:!& S T@E[VdUV һ:_]$Lޑui_(4%@񗕾5OЉ_D xxSS^teL' 6Hi~L_"$Fk0XQ`A7fQ9;t_'O\ٻ)+/  d+;F*"$R,U *ԫui!cF}U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jOkflvA,)y~nዂƦI^YrP!1b6c1M0 VXZt)/BP!q_nqrGpoǐJE~N Ae=Ss s>n`.ߦ0?bSуI9+ƻO }i J>hs5rk tM,#'7Oj7zj 3Oz*u(+o.Jm32W FH!O.Ca=/sLcdlffG4&8~>d+-rSuS'킵mx؍5I,A[4 D;g~֡+ꅇbK:{ 턪kJR` pJ o"1'"I{ŽQaLe졸If i}\yob~cD)禞Suջ?ǟAV[O闐en8'~n%H2C@PwxZ M49~(Hn+^BwQ_>H,sk(T{m Ї -eJY85|!\rʡDb{i f59@iyC5;P 0?yAcqW"98\qr)נϊWSf@$#JI.=)BA9g8#8X%<%?mgDH"gDə myJh-6p9t4|@! jP@bp1g3fS݄e.vU`di'/&=1(%Q 00C?&]۵T0J)03%Za:J,64j#0s$/]7)|C|_Q-j?}4L X{^< ɱ$1W tO Eg)Z  8!#ryE썟 /[q(C][&L)%奔/17кCEթzDXBׁ_ISFMz/տ*C&bӱfIe1 T&#8b^G8ܕmQ_uP@Ԗ]~jG!ۨ;0d$@x8߼(yq'J 5`o0)0 !QrʫvϵF/Q3 ɂқ`3( r s߈Q`Ʌwˑe`((7߶V?!Aendstream endobj 148 0 obj 1687 endobj 5 0 obj <> /Contents 6 0 R >> endobj 31 0 obj <> /Contents 32 0 R >> endobj 38 0 obj <> /Contents 39 0 R >> endobj 42 0 obj <> /Contents 43 0 R >> endobj 46 0 obj <> /Contents 47 0 R >> endobj 65 0 obj <> /Contents 66 0 R >> endobj 69 0 obj <> /Contents 70 0 R >> endobj 73 0 obj <> /Contents 74 0 R >> endobj 77 0 obj <> /Contents 78 0 R >> endobj 81 0 obj <> /Contents 82 0 R >> endobj 85 0 obj <> /Contents 86 0 R >> endobj 89 0 obj <> /Contents 90 0 R >> endobj 93 0 obj <> /Contents 94 0 R >> endobj 97 0 obj <> /Contents 98 0 R >> endobj 104 0 obj <> /Contents 105 0 R >> endobj 108 0 obj <> /Contents 109 0 R >> endobj 115 0 obj <> /Contents 116 0 R >> endobj 119 0 obj <> /Contents 120 0 R >> endobj 123 0 obj <> /Contents 124 0 R >> endobj 130 0 obj <> /Contents 131 0 R >> endobj 134 0 obj <> /Contents 135 0 R >> endobj 138 0 obj <> /Contents 139 0 R >> endobj 142 0 obj <> /Contents 143 0 R >> endobj 146 0 obj <> /Contents 147 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 5 0 R 31 0 R 38 0 R 42 0 R 46 0 R 65 0 R 69 0 R 73 0 R 77 0 R 81 0 R 85 0 R 89 0 R 93 0 R 97 0 R 104 0 R 108 0 R 115 0 R 119 0 R 123 0 R 130 0 R 134 0 R 138 0 R 142 0 R 146 0 R ] /Count 24 >> endobj 1 0 obj <> endobj 4 0 obj <> endobj 26 0 obj <> endobj 27 0 obj <> endobj 37 0 obj <> endobj 41 0 obj <> endobj 45 0 obj <> endobj 64 0 obj <> endobj 68 0 obj <> endobj 72 0 obj <> endobj 76 0 obj <> endobj 80 0 obj <> endobj 84 0 obj <> endobj 88 0 obj <> endobj 92 0 obj <> endobj 96 0 obj <> endobj 103 0 obj <> endobj 107 0 obj <> endobj 114 0 obj <> endobj 118 0 obj <> endobj 122 0 obj <> endobj 129 0 obj <> endobj 133 0 obj <> endobj 137 0 obj <> endobj 141 0 obj <> endobj 145 0 obj <> endobj 152 0 obj <> endobj 9 0 obj <> endobj 8 0 obj <>stream xeTkPW>Crt1ՠKmm"VX*t,,R. IHBB nB.n B /(Zn֮Zح[O?lpfw3yg}yH"hA$7>񓸘Ibds\+[(M&5,f{;k ,Ǐ3K2Eów mH)|/917-""BϏ0ZT". jDdʝ¨@D"JanA`a,%W":*+ Z^°m;*XI(J0WV <  hXYn;/JW#qDQJ[?A,$/PKbUn*A w"Kl#ID21B|DtATW~8kKPiuZCqNuI|NޘNzX`UA1 %j9AZށn0~WK_h*pJX ~ξyH'LZ!L'oep(/3$o1 m1U[B1wdQ}hd޺Ύv , ~hF(vhz?}JbӀyÀ""+*pUo{k=. d@U8>jw<.92fHA 3+.DžduA6z?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ZUBK}VB]UXc|< D $RxE.-MUUYBIJc(u锩> ٌfy!W @ E J;UVn[ǩza 3LƜ\)_:OUr@3}FT8*XՅںƉͨTve2 dн+;L\{0EЈ~.6r/r1w5O> o6v?@{"p`ոM" x>́N`n$$6"j w\(HEi8 13h@~?~`LxW_S苾wDd+UedϤ3iɷʫy3E>d*t7yq0Tk93h/կR4,z:f5ɇFۼQ=Ec]h*Pc%ȌmK\X&&fT_a,7?A pnx_:oÙxO{4&/{ϾUQ׮+ag0z:7X%,t㻷>~G O_vEWaIEʤc,fGk:)cj (6C٥zflo] e"TXF}߹"th03Baٞ%޹*5xC^d$xy'nIP9!]pI.1󖃌aX ߣa{PWULfMr}sZgթ={ţ|*R&;XäZ$qxƜBQo˷j JI{;|B;;t\10ad[?("J=8eV"3sw\xݷ6ӧ_)=;x$LS+~In?q%%M;1[^w8'H> endobj 111 0 obj <>stream xULSWP٠>A@ދf,RcV ` J~ĸ9?`F. S"?6u%]Dřd{eܜ{9K!ODQn6K\nk,UӔ3\ PqIZyk.J;>)hm/æWy ^[iVq JeURRW\ as CYʫ^ҤhpV^Lf S $i,z0œ%lM0=q70a1peA޻xȺ '- ,-`c3_`,|$ktNRs nN,q-swYz>>=t~Q^I K2pVB}U$&42D  tfNǴsHaᢈq0(;YL* ;ɝgy+yBmLB7:x.%J d&g|Šc'v\2ZrcN_gΪ|PI30=cHYF[HGjMn|J| A`O,J]iVt<* xau'\:&mC'K; C;oߒ~Bhr[KmwZۛ -|#̼u|NOSAQ' d$ §#{|g"7:. endstream endobj 169 0 obj 1157 endobj 30 0 obj <> endobj 25 0 obj <> endobj 102 0 obj <> endobj 22 0 obj <> endobj 63 0 obj <> endobj 19 0 obj <> endobj 60 0 obj <> endobj 16 0 obj <> endobj 13 0 obj <> endobj 113 0 obj <> endobj 10 0 obj <> endobj 57 0 obj <> endobj 128 0 obj <> endobj 151 0 obj <> endobj 54 0 obj <> endobj 51 0 obj <> endobj 36 0 obj <> endobj 2 0 obj <>endobj xref 0 170 0000000000 65535 f 0000049441 00000 n 0000123846 00000 n 0000049210 00000 n 0000049489 00000 n 0000045635 00000 n 0000000015 00000 n 0000001362 00000 n 0000051435 00000 n 0000051183 00000 n 0000116436 00000 n 0000055834 00000 n 0000055547 00000 n 0000114149 00000 n 0000055079 00000 n 0000054856 00000 n 0000114003 00000 n 0000053763 00000 n 0000053526 00000 n 0000111622 00000 n 0000070589 00000 n 0000070288 00000 n 0000109242 00000 n 0000062771 00000 n 0000062293 00000 n 0000106863 00000 n 0000049558 00000 n 0000049588 00000 n 0000058625 00000 n 0000058321 00000 n 0000105669 00000 n 0000045795 00000 n 0000001382 00000 n 0000002905 00000 n 0000082938 00000 n 0000082612 00000 n 0000122653 00000 n 0000049675 00000 n 0000045939 00000 n 0000002926 00000 n 0000003260 00000 n 0000049729 00000 n 0000046083 00000 n 0000003280 00000 n 0000005888 00000 n 0000049772 00000 n 0000046227 00000 n 0000005909 00000 n 0000009072 00000 n 0000081940 00000 n 0000081703 00000 n 0000121463 00000 n 0000074731 00000 n 0000074140 00000 n 0000120308 00000 n 0000087530 00000 n 0000087140 00000 n 0000117622 00000 n 0000099593 00000 n 0000099358 00000 n 0000112813 00000 n 0000095562 00000 n 0000095245 00000 n 0000110432 00000 n 0000049815 00000 n 0000046379 00000 n 0000009093 00000 n 0000011403 00000 n 0000049924 00000 n 0000046523 00000 n 0000011424 00000 n 0000013749 00000 n 0000049978 00000 n 0000046667 00000 n 0000013770 00000 n 0000015972 00000 n 0000050021 00000 n 0000046811 00000 n 0000015993 00000 n 0000017873 00000 n 0000050075 00000 n 0000046955 00000 n 0000017894 00000 n 0000020134 00000 n 0000050118 00000 n 0000047099 00000 n 0000020155 00000 n 0000021459 00000 n 0000050161 00000 n 0000047243 00000 n 0000021480 00000 n 0000023219 00000 n 0000050204 00000 n 0000047387 00000 n 0000023240 00000 n 0000024787 00000 n 0000050280 00000 n 0000047531 00000 n 0000024808 00000 n 0000026523 00000 n 0000093207 00000 n 0000092949 00000 n 0000108053 00000 n 0000050334 00000 n 0000047676 00000 n 0000026544 00000 n 0000027814 00000 n 0000050402 00000 n 0000047823 00000 n 0000027836 00000 n 0000029952 00000 n 0000104402 00000 n 0000104109 00000 n 0000115338 00000 n 0000050457 00000 n 0000047978 00000 n 0000029974 00000 n 0000031444 00000 n 0000050547 00000 n 0000048133 00000 n 0000031466 00000 n 0000032503 00000 n 0000050626 00000 n 0000048288 00000 n 0000032524 00000 n 0000034654 00000 n 0000101150 00000 n 0000100776 00000 n 0000118816 00000 n 0000050705 00000 n 0000048443 00000 n 0000034676 00000 n 0000037394 00000 n 0000050797 00000 n 0000048598 00000 n 0000037416 00000 n 0000039719 00000 n 0000050876 00000 n 0000048753 00000 n 0000039741 00000 n 0000041555 00000 n 0000050955 00000 n 0000048908 00000 n 0000041577 00000 n 0000043830 00000 n 0000051047 00000 n 0000049063 00000 n 0000043852 00000 n 0000045613 00000 n 0000100363 00000 n 0000100155 00000 n 0000119838 00000 n 0000051126 00000 n 0000053504 00000 n 0000054835 00000 n 0000055526 00000 n 0000058299 00000 n 0000062271 00000 n 0000070266 00000 n 0000074118 00000 n 0000081681 00000 n 0000082591 00000 n 0000087118 00000 n 0000092927 00000 n 0000095223 00000 n 0000099336 00000 n 0000100134 00000 n 0000100755 00000 n 0000104087 00000 n 0000105647 00000 n trailer << /Size 170 /Root 1 0 R /Info 2 0 R >> startxref 123896 %%EOF postscriptbarcode-2014-03-12/docs/barcodewriter.ps000066400000000000000000006251601231007474100217750ustar00rootroot00000000000000%!PS-Adobe-2.0 %%Creator: dvips(k) 5.92b Copyright 2002 Radical Eye Software %%Title: barcodewriter.dvi %%Pages: 24 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%DocumentFonts: Times-Roman Symbol CMMI10 Times-Bold Courier %%+ Times-Italic CMSY10 %%EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -q barcodewriter.dvi -o %+ postscriptbarcode/docs/barcodewriter.ps %DVIPSParameters: dpi=600, compressed %DVIPSSource: TeX output 2006.10.21:1451 %%BeginProcSet: texc.pro %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72 mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{ landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin /FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array /BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get }B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub} B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr 1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3 1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx 0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{ rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B /chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{ /cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{ A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse} ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17 {2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{ 1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop} forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put }if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{ bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X 1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N /p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ /Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) (LaserWriter 16/600)]{A length product length le{A length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot} imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M} B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{ p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end %%EndProcSet %%BeginProcSet: pstricks.pro %! % PostScript prologue for pstricks.tex. % Version 97 patch 3, 98/06/01 % For distribution, see pstricks.tex. % /tx@Dict 200 dict def tx@Dict begin /ADict 25 dict def /CM { matrix currentmatrix } bind def /SLW /setlinewidth load def /CLW /currentlinewidth load def /CP /currentpoint load def /ED { exch def } bind def /L /lineto load def /T /translate load def /TMatrix { } def /RAngle { 0 } def /Atan { /atan load stopped { pop pop 0 } if } def /Div { dup 0 eq { pop } { div } ifelse } def /NET { neg exch neg exch T } def /Pyth { dup mul exch dup mul add sqrt } def /PtoC { 2 copy cos mul 3 1 roll sin mul } def /PathLength@ { /z z y y1 sub x x1 sub Pyth add def /y1 y def /x1 x def } def /PathLength { flattenpath /z 0 def { /y1 ED /x1 ED /y2 y1 def /x2 x1 def } { /y ED /x ED PathLength@ } {} { /y y2 def /x x2 def PathLength@ } /pathforall load stopped { pop pop pop pop } if z } def /STP { .996264 dup scale } def /STV { SDict begin normalscale end STP } def /DashLine { dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def PathLength } ifelse /b ED /x ED /y ED /z y x add def b a .5 sub 2 mul y mul sub z Div round z mul a .5 sub 2 mul y mul add b exch Div dup y mul /y ED x mul /x ED x 0 gt y 0 gt and { [ y x ] 1 a sub y mul } { [ 1 0 ] 0 } ifelse setdash stroke } def /DotLine { /b PathLength def /a ED /z ED /y CLW def /z y z add def a 0 gt { /b b a div def } { a 0 eq { /b b y sub def } { a -3 eq { /b b y add def } if } ifelse } ifelse [ 0 b b z Div round Div dup 0 le { pop 1 } if ] a 0 gt { 0 } { y 2 div a -2 gt { neg } if } ifelse setdash 1 setlinecap stroke } def /LineFill { gsave abs CLW add /a ED a 0 dtransform round exch round exch 2 copy idtransform exch Atan rotate idtransform pop /a ED .25 .25 % DG/SR modification begin - Dec. 12, 1997 - Patch 2 %itransform translate pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a itransform pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a % DG/SR modification end Div cvi /x1 ED /y2 y2 y1 sub def clip newpath 2 setlinecap systemdict /setstrokeadjust known { true setstrokeadjust } if x2 x1 sub 1 add { x1 % DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis) % a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore } % def a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore pop pop } def % DG/SR modification end /BeginArrow { ADict begin /@mtrx CM def gsave 2 copy T 2 index sub neg exch 3 index sub exch Atan rotate newpath } def /EndArrow { @mtrx setmatrix CP grestore end } def /Arrow { CLW mul add dup 2 div /w ED mul dup /h ED mul /a ED { 0 h T 1 -1 scale } if w neg h moveto 0 0 L w h L w neg a neg rlineto gsave fill grestore } def /Tbar { CLW mul add /z ED z -2 div CLW 2 div moveto z 0 rlineto stroke 0 CLW moveto } def /Bracket { CLW mul add dup CLW sub 2 div /x ED mul CLW add /y ED /z CLW 2 div def x neg y moveto x neg CLW 2 div L x CLW 2 div L x y L stroke 0 CLW moveto } def /RoundBracket { CLW mul add dup 2 div /x ED mul /y ED /mtrx CM def 0 CLW 2 div T x y mul 0 ne { x y scale } if 1 1 moveto .85 .5 .35 0 0 0 curveto -.35 0 -.85 .5 -1 1 curveto mtrx setmatrix stroke 0 CLW moveto } def /SD { 0 360 arc fill } def /EndDot { { /z DS def } { /z 0 def } ifelse /b ED 0 z DS SD b { 0 z DS CLW sub SD } if 0 DS z add CLW 4 div sub moveto } def /Shadow { [ { /moveto load } { /lineto load } { /curveto load } { /closepath load } /pathforall load stopped { pop pop pop pop CP /moveto load } if ] cvx newpath 3 1 roll T exec } def /NArray { aload length 2 div dup dup cvi eq not { exch pop } if /n exch cvi def } def /NArray { /f ED counttomark 2 div dup cvi /n ED n eq not { exch pop } if f { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def /Line { NArray n 0 eq not { n 1 eq { 0 0 /n 2 def } if ArrowA /n n 2 sub def n { Lineto } repeat CP 4 2 roll ArrowB L pop pop } if } def /Arcto { /a [ 6 -2 roll ] cvx def a r /arcto load stopped { 5 } { 4 } ifelse { pop } repeat a } def /CheckClosed { dup n 2 mul 1 sub index eq 2 index n 2 mul 1 add index eq and { pop pop /n n 1 sub def } if } def /Polygon { NArray n 2 eq { 0 0 /n 3 def } if n 3 lt { n { pop pop } repeat } { n 3 gt { CheckClosed } if n 2 mul -2 roll /y0 ED /x0 ED /y1 ED /x1 ED x1 y1 /x1 x0 x1 add 2 div def /y1 y0 y1 add 2 div def x1 y1 moveto /n n 2 sub def n { Lineto } repeat x1 y1 x0 y0 6 4 roll Lineto Lineto pop pop closepath } ifelse } def /Diamond { /mtrx CM def T rotate /h ED /w ED dup 0 eq { pop } { CLW mul neg /d ED /a w h Atan def /h d a sin Div h add def /w d a cos Div w add def } ifelse mark w 2 div h 2 div w 0 0 h neg w neg 0 0 h w 2 div h 2 div /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx setmatrix } def % DG modification begin - Jan. 15, 1997 %/Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup 0 eq { %pop } { CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2 %div dup cos exch sin Div mul sub def } ifelse mark 0 d w neg d 0 h w d 0 %d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx %setmatrix } def /Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2 div dup cos exch sin Div mul sub def mark 0 d w neg d 0 h w d 0 d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx % DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis) % setmatrix } def setmatrix pop } def % DG/SR modification end /CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth def } def /CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth def } def /CC { /l0 l1 def /x1 x dx sub def /y1 y dy sub def /dx0 dx1 def /dy0 dy1 def CCA /dx dx0 l1 c exp mul dx1 l0 c exp mul add def /dy dy0 l1 c exp mul dy1 l0 c exp mul add def /m dx0 dy0 Atan dx1 dy1 Atan sub 2 div cos abs b exp a mul dx dy Pyth Div 2 div def /x2 x l0 dx mul m mul sub def /y2 y l0 dy mul m mul sub def /dx l1 dx mul m mul neg def /dy l1 dy mul m mul neg def } def /IC { /c c 1 add def c 0 lt { /c 0 def } { c 3 gt { /c 3 def } if } ifelse /a a 2 mul 3 div 45 cos b exp div def CCA /dx 0 def /dy 0 def } def /BOC { IC CC x2 y2 x1 y1 ArrowA CP 4 2 roll x y curveto } def /NC { CC x1 y1 x2 y2 x y curveto } def /EOC { x dx sub y dy sub 4 2 roll ArrowB 2 copy curveto } def /BAC { IC CC x y moveto CC x1 y1 CP ArrowA } def /NAC { x2 y2 x y curveto CC x1 y1 } def /EAC { x2 y2 x y ArrowB curveto pop pop } def /OpenCurve { NArray n 3 lt { n { pop pop } repeat } { BOC /n n 3 sub def n { NC } repeat EOC } ifelse } def /AltCurve { { false NArray n 2 mul 2 roll [ n 2 mul 3 sub 1 roll ] aload /Points ED n 2 mul -2 roll } { false NArray } ifelse n 4 lt { n { pop pop } repeat } { BAC /n n 4 sub def n { NAC } repeat EAC } ifelse } def /ClosedCurve { NArray n 3 lt { n { pop pop } repeat } { n 3 gt { CheckClosed } if 6 copy n 2 mul 6 add 6 roll IC CC x y moveto n { NC } repeat closepath pop pop } ifelse } def /SQ { /r ED r r moveto r r neg L r neg r neg L r neg r L fill } def /ST { /y ED /x ED x y moveto x neg y L 0 x L fill } def /SP { /r ED gsave 0 r moveto 4 { 72 rotate 0 r L } repeat fill grestore } def /FontDot { DS 2 mul dup matrix scale matrix concatmatrix exch matrix rotate matrix concatmatrix exch findfont exch makefont setfont } def /Rect { x1 y1 y2 add 2 div moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto x1 y1 lineto closepath } def /OvalFrame { x1 x2 eq y1 y2 eq or { pop pop x1 y1 moveto x2 y2 L } { y1 y2 sub abs x1 x2 sub abs 2 copy gt { exch pop } { pop } ifelse 2 div exch { dup 3 1 roll mul exch } if 2 copy lt { pop } { exch pop } ifelse /b ED x1 y1 y2 add 2 div moveto x1 y2 x2 y2 b arcto x2 y2 x2 y1 b arcto x2 y1 x1 y1 b arcto x1 y1 x1 y2 b arcto 16 { pop } repeat closepath } ifelse } def /Frame { CLW mul /a ED 3 -1 roll 2 copy gt { exch } if a sub /y2 ED a add /y1 ED 2 copy gt { exch } if a sub /x2 ED a add /x1 ED 1 index 0 eq { pop pop Rect } { OvalFrame } ifelse } def /BezierNArray { /f ED counttomark 2 div dup cvi /n ED n eq not { exch pop } if n 1 sub neg 3 mod 3 add 3 mod { 0 0 /n n 1 add def } repeat f { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def /OpenBezier { BezierNArray n 1 eq { pop pop } { ArrowA n 4 sub 3 idiv { 6 2 roll 4 2 roll curveto } repeat 6 2 roll 4 2 roll ArrowB curveto } ifelse } def /ClosedBezier { BezierNArray n 1 eq { pop pop } { moveto n 1 sub 3 idiv { 6 2 roll 4 2 roll curveto } repeat closepath } ifelse } def /BezierShowPoints { gsave Points aload length 2 div cvi /n ED moveto n 1 sub { lineto } repeat CLW 2 div SLW [ 4 4 ] 0 setdash stroke grestore } def /Parab { /y0 exch def /x0 exch def /y1 exch def /x1 exch def /dx x0 x1 sub 3 div def /dy y0 y1 sub 3 div def x0 dx sub y0 dy add x1 y1 ArrowA x0 dx add y0 dy add x0 2 mul x1 sub y1 ArrowB curveto /Points [ x1 y1 x0 y0 x0 2 mul x1 sub y1 ] def } def /Grid { newpath /a 4 string def /b ED /c ED /n ED cvi dup 1 lt { pop 1 } if /s ED s div dup 0 eq { pop 1 } if /dy ED s div dup 0 eq { pop 1 } if /dx ED dy div round dy mul /y0 ED dx div round dx mul /x0 ED dy div round cvi /y2 ED dx div round cvi /x2 ED dy div round cvi /y1 ED dx div round cvi /x1 ED /h y2 y1 sub 0 gt { 1 } { -1 } ifelse def /w x2 x1 sub 0 gt { 1 } { -1 } ifelse def b 0 gt { /z1 b 4 div CLW 2 div add def /Helvetica findfont b scalefont setfont /b b .95 mul CLW 2 div add def } if systemdict /setstrokeadjust known { true setstrokeadjust /t { } def } { /t { transform 0.25 sub round 0.25 add exch 0.25 sub round 0.25 add exch itransform } bind def } ifelse gsave n 0 gt { 1 setlinecap [ 0 dy n div ] dy n div 2 div setdash } { 2 setlinecap } ifelse /i x1 def /f y1 dy mul n 0 gt { dy n div 2 div h mul sub } if def /g y2 dy mul n 0 gt { dy n div 2 div h mul add } if def x2 x1 sub w mul 1 add dup 1000 gt { pop 1000 } if { i dx mul dup y0 moveto b 0 gt { gsave c i a cvs dup stringwidth pop /z2 ED w 0 gt {z1} {z1 z2 add neg} ifelse h 0 gt {b neg} {z1} ifelse rmoveto show grestore } if dup t f moveto g t L stroke /i i w add def } repeat grestore gsave n 0 gt % DG/SR modification begin - Nov. 7, 1997 - Patch 1 %{ 1 setlinecap [ 0 dx n div ] dy n div 2 div setdash } { 1 setlinecap [ 0 dx n div ] dx n div 2 div setdash } % DG/SR modification end { 2 setlinecap } ifelse /i y1 def /f x1 dx mul n 0 gt { dx n div 2 div w mul sub } if def /g x2 dx mul n 0 gt { dx n div 2 div w mul add } if def y2 y1 sub h mul 1 add dup 1000 gt { pop 1000 } if { newpath i dy mul dup x0 exch moveto b 0 gt { gsave c i a cvs dup stringwidth pop /z2 ED w 0 gt {z1 z2 add neg} {z1} ifelse h 0 gt {z1} {b neg} ifelse rmoveto show grestore } if dup f exch t moveto g exch t L stroke /i i h add def } repeat grestore } def /ArcArrow { /d ED /b ED /a ED gsave newpath 0 -1000 moveto clip newpath 0 1 0 0 b grestore c mul /e ED pop pop pop r a e d PtoC y add exch x add exch r a PtoC y add exch x add exch b pop pop pop pop a e d CLW 8 div c mul neg d } def /Ellipse { /mtrx CM def T scale 0 0 1 5 3 roll arc mtrx setmatrix } def /Rot { CP CP translate 3 -1 roll neg rotate NET } def /RotBegin { tx@Dict /TMatrix known not { /TMatrix { } def /RAngle { 0 } def } if /TMatrix [ TMatrix CM ] cvx def /a ED a Rot /RAngle [ RAngle dup a add ] cvx def } def /RotEnd { /TMatrix [ TMatrix setmatrix ] cvx def /RAngle [ RAngle pop ] cvx def } def /PutCoor { gsave CP T CM STV exch exec moveto setmatrix CP grestore } def /PutBegin { /TMatrix [ TMatrix CM ] cvx def CP 4 2 roll T moveto } def /PutEnd { CP /TMatrix [ TMatrix setmatrix ] cvx def moveto } def /Uput { /a ED add 2 div /h ED 2 div /w ED /s a sin def /c a cos def /b s abs c abs 2 copy gt dup /q ED { pop } { exch pop } ifelse def /w1 c b div w mul def /h1 s b div h mul def q { w1 abs w sub dup c mul abs } { h1 abs h sub dup s mul abs } ifelse } def /UUput { /z ED abs /y ED /x ED q { x s div c mul abs y gt } { x c div s mul abs y gt } ifelse { x x mul y y mul sub z z mul add sqrt z add } { q { x s div } { x c div } ifelse abs } ifelse a PtoC h1 add exch w1 add exch } def /BeginOL { dup (all) eq exch TheOL eq or { IfVisible not { Visible /IfVisible true def } if } { IfVisible { Invisible /IfVisible false def } if } ifelse } def /InitOL { /OLUnit [ 3000 3000 matrix defaultmatrix dtransform ] cvx def /Visible { CP OLUnit idtransform T moveto } def /Invisible { CP OLUnit neg exch neg exch idtransform T moveto } def /BOL { BeginOL } def /IfVisible true def } def end % END pstricks.pro %%EndProcSet %%BeginProcSet: pst-dots.pro %!PS-Adobe-2.0 %%Title: Dot Font for PSTricks %%Creator: Timothy Van Zandt %%Creation Date: May 7, 1993 %% Version 97 patch 1, 99/12/16 %% Modified by Etienne Riga - Dec. 16, 1999 %% to add /Diamond, /SolidDiamond and /BoldDiamond 10 dict dup begin /FontType 3 def /FontMatrix [ .001 0 0 .001 0 0 ] def /FontBBox [ 0 0 0 0 ] def /Encoding 256 array def 0 1 255 { Encoding exch /.notdef put } for Encoding dup (b) 0 get /Bullet put dup (c) 0 get /Circle put dup (C) 0 get /BoldCircle put dup (u) 0 get /SolidTriangle put dup (t) 0 get /Triangle put dup (T) 0 get /BoldTriangle put dup (r) 0 get /SolidSquare put dup (s) 0 get /Square put dup (S) 0 get /BoldSquare put dup (q) 0 get /SolidPentagon put dup (p) 0 get /Pentagon put dup (P) 0 get /BoldPentagon put % DG/SR modification begin - Dec. 16, 1999 - From Etienne Riga dup (l) 0 get /SolidDiamond put dup (d) 0 get /Diamond put (D) 0 get /BoldDiamond put % DG/SR modification end /Metrics 13 dict def Metrics begin /Bullet 1000 def /Circle 1000 def /BoldCircle 1000 def /SolidTriangle 1344 def /Triangle 1344 def /BoldTriangle 1344 def /SolidSquare 886 def /Square 886 def /BoldSquare 886 def /SolidPentagon 1093.2 def /Pentagon 1093.2 def /BoldPentagon 1093.2 def % DG/SR modification begin - Dec. 16, 1999 - From Etienne Riga /SolidDiamond 1008 def /Diamond 1008 def /BoldDiamond 1008 def % DG/SR modification end /.notdef 0 def end /BBoxes 13 dict def BBoxes begin /Circle { -550 -550 550 550 } def /BoldCircle /Circle load def /Bullet /Circle load def /Triangle { -571.5 -330 571.5 660 } def /BoldTriangle /Triangle load def /SolidTriangle /Triangle load def /Square { -450 -450 450 450 } def /BoldSquare /Square load def /SolidSquare /Square load def /Pentagon { -546.6 -465 546.6 574.7 } def /BoldPentagon /Pentagon load def /SolidPentagon /Pentagon load def % DG/SR modification begin - Dec. 16, 1999 - From Etienne Riga /Diamond { -428.5 -742.5 428.5 742.5 } def /BoldDiamond /Diamond load def /SolidDiamond /Diamond load def % DG/SR modification end /.notdef { 0 0 0 0 } def end /CharProcs 20 dict def CharProcs begin /Adjust { 2 copy dtransform floor .5 add exch floor .5 add exch idtransform 3 -1 roll div 3 1 roll exch div exch scale } def /CirclePath { 0 0 500 0 360 arc closepath } def /Bullet { 500 500 Adjust CirclePath fill } def /Circle { 500 500 Adjust CirclePath .9 .9 scale CirclePath eofill } def /BoldCircle { 500 500 Adjust CirclePath .8 .8 scale CirclePath eofill } def /BoldCircle { CirclePath .8 .8 scale CirclePath eofill } def /TrianglePath { 0 660 moveto -571.5 -330 lineto 571.5 -330 lineto closepath } def /SolidTriangle { TrianglePath fill } def /Triangle { TrianglePath .85 .85 scale TrianglePath eofill } def /BoldTriangle { TrianglePath .7 .7 scale TrianglePath eofill } def /SquarePath { -450 450 moveto 450 450 lineto 450 -450 lineto -450 -450 lineto closepath } def /SolidSquare { SquarePath fill } def /Square { SquarePath .89 .89 scale SquarePath eofill } def /BoldSquare { SquarePath .78 .78 scale SquarePath eofill } def /PentagonPath { -337.8 -465 moveto 337.8 -465 lineto 546.6 177.6 lineto 0 574.7 lineto -546.6 177.6 lineto closepath } def /SolidPentagon { PentagonPath fill } def /Pentagon { PentagonPath .89 .89 scale PentagonPath eofill } def /BoldPentagon { PentagonPath .78 .78 scale PentagonPath eofill } def % DG/SR modification begin - Dec. 16, 1999 - From Etienne Riga /DiamondPath { 0 742.5 moveto -428.5 0 lineto 0 -742.5 lineto 428.5 0 lineto closepath } def /SolidDiamond { DiamondPath fill } def /Diamond { DiamondPath .85 .85 scale DiamondPath eofill } def /BoldDiamond { DiamondPath .7 .7 scale DiamondPath eofill } def % DG/SR modification end /.notdef { } def end /BuildGlyph { exch begin Metrics 1 index get exec 0 BBoxes 3 index get exec setcachedevice CharProcs begin load exec end end } def /BuildChar { 1 index /Encoding get exch get 1 index /BuildGlyph get exec } bind def end /PSTricksDotFont exch definefont pop %END pst-dots.pro %%EndProcSet %%BeginProcSet: pst-barcode.pro %!PS-Adobe-2.0 %%Creator: Terry Burton %%DocumentPaperSizes: a4 %%EndComments %%EndProlog % Barcode Writer in Pure PostScript - Version 2006-09-26 % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2006 Terry Burton - tez@terryburton.co.uk % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % Uncomment this next line to allow these procedure definitions to % remain resident within a printer's PostScript virtual machine % so that the barcode generation capability persists between jobs. % serverdict begin 0 exitserver % --BEGIN TEMPLATE-- % --BEGIN ENCODER ean13-- % --DESC: EAN-13 % --EXAM: 977147396801 /ean13 { 0 begin /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textpos -4 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def /barlen barcode length def % Length of the code % Add checksum digit to barcode if length is even barlen 2 mod 0 eq { /pad barlen 1 add string def % Create pad one bigger than barcode /checksum 0 def 0 1 barlen 1 sub { /i exch def /barchar barcode i get 48 sub def i 2 mod 0 eq { /checksum barchar checksum add def } { /checksum barchar 3 mul checksum add def } ifelse } for /checksum 10 checksum 10 mod sub 10 mod def pad 0 barcode putinterval % Add barcode to the start of the pad pad barlen checksum 48 add put % Put ascii for checksum at end of pad /barcode pad def % barcode=pad /barlen barlen 1 add def % barlen++ } if % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (111) (11111) (111) ] def % Create a string of the available characters /barchars (0123456789) def % Digits to mirror on left side /mirrormaps [ (000000) (001011) (001101) (001110) (010011) (011001) (011100) (010101) (010110) (011010) ] def /sbs barlen 1 sub 4 mul 11 add string def /txt barlen array def % Put the start character sbs 0 encs 10 get putinterval % First digit - determine mirrormap by this and show before guard bars /mirrormap mirrormaps barcode 0 get 48 sub get def txt 0 [barcode 0 1 getinterval -10 textpos textfont textsize] put % Left side - performs mirroring 1 1 6 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding mirrormap i 1 sub get 49 eq { % Reverse enc if 1 in this position in mirrormap /enclen enc length def /revenc enclen string def 0 1 enclen 1 sub { /j exch def /char enc j get def revenc enclen j sub 1 sub char put } for /enc revenc def } if sbs i 1 sub 4 mul 3 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 1 sub 7 mul 4 add textpos textfont textsize] put } for % Put the middle character sbs 7 1 sub 4 mul 3 add encs 11 get putinterval % Right side 7 1 12 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 1 sub 4 mul 8 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 1 sub 7 mul 8 add textpos textfont textsize] put } for % Put the end character sbs barlen 1 sub 4 mul 8 add encs 12 get putinterval % Return the arguments /retval 4 dict def retval (sbs) [sbs {48 sub} forall] put includetext { retval (bhs) [height height 12{height .075 sub}repeat height height 12{height .075 sub}repeat height height] put retval (bbs) [0 0 12{.075}repeat 0 0 12{.075}repeat 0 0] put retval (txt) txt put } { retval (bhs) [30{height}repeat] put retval (bbs) [30{0}repeat] put } ifelse retval (opt) useropts put retval (guardrightpos) 10 put retval (borderbottom) 5 put retval end } bind def /ean13 load 0 1 dict put % --END ENCODER ean13-- % --BEGIN ENCODER ean8-- % --DESC: EAN-8 % --EXAM: 01335583 /ean8 { 0 begin /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textpos -4 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (111) (11111) (111) ] def % Create a string of the available characters /barchars (0123456789) def /barlen barcode length def % Length of the code /sbs barlen 4 mul 11 add string def /txt barlen array def % Put the start character sbs 0 encs 10 get putinterval % Left side 0 1 3 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 4 mul 3 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 7 mul 4 add textpos textfont textsize] put } for % Put the middle character sbs 4 4 mul 3 add encs 11 get putinterval % Right side 4 1 7 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 4 mul 8 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 7 mul 8 add textpos textfont textsize] put } for % Put the end character sbs barlen 4 mul 8 add encs 12 get putinterval % Return the arguments /retval 4 dict def retval (sbs) [sbs {48 sub} forall] put includetext { retval (bhs) [height height 8{height .075 sub}repeat height height 8{height .075 sub}repeat height height] put retval (bbs) [0 0 8{.075}repeat 0 0 8{.075}repeat 0 0] put retval (txt) txt put } { retval (bhs) [22{height}repeat] put retval (bbs) [22{0}repeat] put } ifelse retval (opt) useropts put retval (guardleftpos) 10 put retval (guardrightpos) 10 put retval (borderbottom) 5 put retval end } bind def /ean8 load 0 1 dict put % --END ENCODER ean8-- % --BEGIN ENCODER upca-- % --DESC: UPC-A % --EXAM: 78858101497 /upca { 0 begin /options exch def /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textpos -4 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def /barlen barcode length def % Length of the code % Add checksum digit to barcode if length is odd barlen 2 mod 0 ne { /pad barlen 1 add string def % Create pad one bigger than barcode /checksum 0 def 0 1 barlen 1 sub { /i exch def /barchar barcode i get 48 sub def i 2 mod 0 ne { /checksum checksum barchar add def } { /checksum checksum barchar 3 mul add def } ifelse } for /checksum 10 checksum 10 mod sub 10 mod def pad 0 barcode putinterval % Add barcode to the start of the pad pad barlen checksum 48 add put % Put ascii for checksum at end of pad /barcode pad def % barcode=pad /barlen barlen 1 add def % barlen++ } if % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (111) (11111) (111) ] def % Create a string of the available characters /barchars (0123456789) def /sbs barlen 4 mul 11 add string def /txt barlen array def % Put the start character sbs 0 encs 10 get putinterval % Left side 0 1 5 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 4 mul 3 add enc putinterval % Put encoded digit into sbs i 0 eq { % First digit is before the guard bars txt 0 [barcode 0 1 getinterval -7 textpos textfont textsize 2 sub] put } { txt i [barcode i 1 getinterval i 7 mul 4 add textpos textfont textsize] put } ifelse } for % Put the middle character sbs 6 4 mul 3 add encs 11 get putinterval % Right side 6 1 11 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 4 mul 8 add enc putinterval % Put encoded digit into sbs i 11 eq { % Last digit is after guard bars txt 11 [barcode 11 1 getinterval 96 textpos textfont textsize 2 sub] put } { txt i [barcode i 1 getinterval i 7 mul 8 add textpos textfont textsize] put } ifelse } for % Put the end character sbs barlen 4 mul 8 add encs 12 get putinterval % Return the arguments /retval 4 dict def retval (sbs) [sbs {48 sub} forall] put includetext { retval (bhs) [4{height}repeat 10{height .075 sub}repeat height height 10{height .075 sub}repeat 5{height}repeat] put retval (bbs) [0 0 0 0 10{.075}repeat 0 0 10{.075}repeat 0 0 0 0 0] put retval (txt) txt put } { retval (bhs) [31{height}repeat] put retval (bbs) [31{0}repeat] put } ifelse retval (opt) useropts put retval (borderbottom) 5 put retval end } bind def /upca load 0 1 dict put % --END ENCODER upca-- % --BEGIN ENCODER upce-- % --DESC: UPC-E % --EXAM: 0123456 /upce { 0 begin /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textpos -4 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def /barlen barcode length def % Length of the code % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (111) (1111111) ] def % Create a string of the available characters /barchars (0123456789) def /mirrormaps [ (000111) (001011) (001101) (001110) (010011) (011001) (011100) (010101) (010110) (011010) ] def % Add checksum digit to barcode if length is odd barlen 2 mod 0 ne { /pad barlen 1 add string def % Create pad one bigger than barcode /checksum 0 def 0 1 barlen 1 sub { /i exch def /barchar barcode i get 48 sub def i 2 mod 0 ne { /checksum barchar checksum add def } { /checksum barchar 3 mul checksum add def } ifelse } for /checksum 10 checksum 10 mod sub 10 mod def pad 0 barcode putinterval % Add barcode to the start of the pad pad barlen checksum 48 add put % Put ascii for checksum at end of pad /barcode pad def % barcode=pad /barlen barlen 1 add def % barlen++ } if /txt barlen array def txt 0 [barcode 0 1 getinterval -7 textpos textfont textsize 2 sub] put % Determine the mirror map based on checksum /mirrormap mirrormaps barcode barlen 1 sub get 48 sub get def % Invert the mirrormap if we are using a non-zero number system barcode 0 get 48 eq { /invt mirrormap length string def 0 1 mirrormap length 1 sub { /i exch def mirrormap i get 48 eq { invt i 49 put } { invt i 48 put } ifelse } for /mirrormap invt def } if /sbs barlen 2 sub 4 mul 10 add string def % Put the start character sbs 0 encs 10 get putinterval 1 1 6 { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding mirrormap i 1 sub get 49 eq { % Reverse enc if 1 in this position in mirrormap /enclen enc length def /revenc enclen string def 0 1 enclen 1 sub { /j exch def /char enc j get def revenc enclen j sub 1 sub char put } for /enc revenc def } if sbs i 1 sub 4 mul 3 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 1 sub 7 mul 4 add textpos textfont textsize] put } for txt 7 [barcode 7 1 getinterval 6 7 mul 11 add textpos textfont textsize 2 sub] put % Put the end character sbs barlen 2 sub 4 mul 3 add encs 11 get putinterval % Return the arguments /retval 4 dict def retval (sbs) [sbs {48 sub} forall] put includetext { retval (bhs) [height height 12{height .075 sub}repeat height height height] put retval (bbs) [0 0 12{.075}repeat 0 0 0] put retval (txt) txt put } { retval (bhs) [17{height}repeat] put retval (bbs) [17{0}repeat] put } ifelse retval (opt) useropts put retval (borderbottom) 5 put retval end } bind def /upce load 0 1 dict put % --END ENCODER upce-- % --BEGIN ENCODER ean5-- % --DESC: EAN-5 (5 digit addon) % --EXAM: 0123456 /ean5 { 0 begin /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textpos (unset) def /height 0.7 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /height height cvr def textpos (unset) eq { /textpos height 72 mul 1 add def } { /textpos textpos cvr def } ifelse /barlen barcode length def % Length of the code % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (112) (11) ] def % Create a string of the available characters /barchars (0123456789) def % Determine the mirror map based on mod 10 checksum /mirrormaps [ (11000) (10100) (10010) (10001) (01100) (00110) (00011) (01010) (01001) (00101) ] def /checksum 0 def 0 1 4 { /i exch def /barchar barcode i get 48 sub def i 2 mod 0 eq { /checksum barchar 3 mul checksum add def } { /checksum barchar 9 mul checksum add def } ifelse } for /checksum checksum 10 mod def /mirrormap mirrormaps checksum get def /sbs 31 string def /txt 5 array def 0 1 4 { /i exch def % Prefix with either a start character or separator character i 0 eq { sbs 0 encs 10 get putinterval } { sbs i 1 sub 6 mul 7 add encs 11 get putinterval } ifelse % Lookup the encoding for the barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding mirrormap i get 49 eq { % Reverse enc if 1 in this position in mirrormap /enclen enc length def /revenc enclen string def 0 1 enclen 1 sub { /j exch def /char enc j get def revenc enclen j sub 1 sub char put } for /enc revenc def } if sbs i 6 mul 3 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 1 sub 9 mul 13 add textpos textfont textsize] put } for % Return the arguments /retval 4 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [16{height}repeat] put retval (bbs) [16{0}repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval (guardrightpos) 10 put retval (guardrightypos) textpos 4 add put retval (bordertop) 10 put retval end } bind def /ean5 load 0 1 dict put % --END ENCODER ean5-- % --BEGIN ENCODER ean2-- % --DESC: EAN-2 (2 digit addon) % --EXAM: 05 /ean2 { 0 begin /options exch def % We are given an options string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textpos (unset) def /height 0.7 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /height height cvr def textpos (unset) eq { /textpos height 72 mul 1 add def } { /textpos textpos cvr def } ifelse /barlen barcode length def % Length of the code % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (112) (11) ] def % Create a string of the available characters /barchars (0123456789) def % Determine the mirror map based on mod 4 checksum /mirrormap [(00) (01) (10) (11)] barcode 0 2 getinterval cvi 4 mod get def /sbs 13 string def /txt 2 array def 0 1 1 { /i exch def % Prefix with either a start character or separator character i 0 eq { sbs 0 encs 10 get putinterval } { sbs i 1 sub 6 mul 7 add encs 11 get putinterval } ifelse % Lookup the encoding for the barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding mirrormap i get 49 eq { % Reverse enc if 1 in this position in mirrormap /enclen enc length def /revenc enclen string def 0 1 enclen 1 sub { /j exch def /char enc j get def revenc enclen j sub 1 sub char put } for /enc revenc def } if sbs i 6 mul 3 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 1 sub 9 mul 13 add textpos textfont textsize] put } for % Return the arguments /retval 4 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [12{height}repeat] put retval (bbs) [12{0}repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval (guardrightpos) 10 put retval (guardrightypos) textpos 4 add put retval (bordertop) 10 put retval end } bind def /ean2 load 0 1 dict put % --END ENCODER ean2-- % --BEGIN ENCODER isbn-- % --REQUIRES ean13-- % --DESC: ISBN % --EXAM: 1-86074-271 /isbn { 0 begin /options exch def % We are given an options string /useropts options def /isbntxt exch def % We are given the isbn text with dashes /includetext false def % Enable/disable ISBN text /isbnfont /Courier def /isbnsize 9 def /isbnpos (unset) def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /isbnfont isbnfont cvlit def /isbnsize isbnsize cvr def /height height cvr def isbnpos (unset) eq { /isbnpos height 72 mul 3 add def } { /isbnpos isbnpos cvr def } ifelse % Read the digits from isbntxt and calculate checksums /isbn 13 string def /checksum10 0 def /checksum13 0 def /i 0 def /n 0 def { % loop /isbnchar isbntxt i get 48 sub def isbnchar -3 ne { % Ignore dashes isbn n isbnchar 48 add put /checksum10 checksum10 10 n sub isbnchar mul add def n 2 mod 0 eq { /checksum13 isbnchar checksum13 add def } { /checksum13 isbnchar 3 mul checksum13 add def } ifelse /n n 1 add def } if /i i 1 add def i isbntxt length eq {exit} if } loop % Add the ISBN header to the isbntxt n 9 eq n 10 eq or { /checksum 11 checksum10 11 mod sub 11 mod def /isbn isbn 0 9 getinterval def /pad 18 string def } { /checksum 10 checksum13 10 mod sub 10 mod def /isbn isbn 0 12 getinterval def /pad 22 string def } ifelse pad 0 (ISBN ) putinterval pad 5 isbntxt putinterval % Add isbntxt to the pad % Add checksum digit if isbntxt length is 11 or 15 isbntxt length 11 eq isbntxt length 15 eq or { pad isbntxt length 5 add 45 put % Put a dash checksum 10 eq { pad isbntxt length 6 add checksum 78 add put % Check digit for 10 is X } { pad isbntxt length 6 add checksum 48 add put % Put check digit } ifelse } if /isbntxt pad def % isbntxt=pad % Convert ISBN digits to EAN-13 /barcode 12 string def isbn length 9 eq { barcode 0 (978) putinterval barcode 3 isbn putinterval } { barcode 0 isbn putinterval } ifelse % Get the result of encoding with ean13 /args barcode options ean13 def % Add the ISBN text includetext { isbn length 9 eq { /isbnxpos -1 def } { /isbnxpos -12 def } ifelse args (txt) known { /txt args (txt) get def /newtxt txt length 1 add array def newtxt 0 txt putinterval newtxt newtxt length 1 sub [isbntxt isbnxpos isbnpos isbnfont isbnsize] put args (txt) newtxt put } { args (txt) [ [isbntxt isbnxpos isbnpos isbnfont isbnsize] ] put } ifelse } if args (opt) useropts put args end } bind def /isbn load 0 1 dict put % --END ENCODER isbn-- % --BEGIN ENCODER code128-- % --DESC: Code 128 % --EXAM: ^104^102Count^0990123456789^101! /code128 { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textpos -7 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def % Create an array containing the character mappings /encs [ (212222) (222122) (222221) (121223) (121322) (131222) (122213) (122312) (132212) (221213) (221312) (231212) (112232) (122132) (122231) (113222) (123122) (123221) (223211) (221132) (221231) (213212) (223112) (312131) (311222) (321122) (321221) (312212) (322112) (322211) (212123) (212321) (232121) (111323) (131123) (131321) (112313) (132113) (132311) (211313) (231113) (231311) (112133) (112331) (132131) (113123) (113321) (133121) (313121) (211331) (231131) (213113) (213311) (213131) (311123) (311321) (331121) (312113) (312311) (332111) (314111) (221411) (431111) (111224) (111422) (121124) (121421) (141122) (141221) (112214) (112412) (122114) (122411) (142112) (142211) (241211) (221114) (413111) (241112) (134111) (111242) (121142) (121241) (114212) (124112) (124211) (411212) (421112) (421211) (212141) (214121) (412121) (111143) (111341) (131141) (114113) (114311) (411113) (411311) (113141) (114131) (311141) (411131) (211412) (211214) (211232) (2331112) ] def % Create a string of the available characters for alphabets A and B /barchars ( !"#$%&'\(\)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~) def /barlen barcode length def % Length of the code /sbs barlen 6 mul string def % sbs is 6 times length of barcode /txt barlen array def /mode -1 def % A=0, B=1, C=2 /checksum barcode 1 3 getinterval cvi def % Initialise the checksum /i 0 def /j 0 def { % loop i barlen eq {exit} if barcode i 1 getinterval (^) eq { % indx is given by the next three characters /indx barcode i 1 add 3 getinterval cvi def txt j [( ) j 11 mul textpos textfont textsize] put /i i 4 add def } { % indx depends on the mode mode 2 eq { /indx barcode i 2 getinterval cvi def txt j [barcode i 2 getinterval j 11 mul textpos textfont textsize] put /i i 2 add def } { barchars barcode i 1 getinterval search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post txt j [barchars indx 1 getinterval j 11 mul textpos textfont textsize] put /i i 1 add def } ifelse } ifelse /enc encs indx get def % Get the indxth encoding sbs j 6 mul enc putinterval % Put encoded digit into sbs % Update the mode indx 101 eq indx 103 eq or {/mode 0 def} if indx 100 eq indx 104 eq or {/mode 1 def} if indx 99 eq indx 105 eq or {/mode 2 def} if /checksum indx j mul checksum add def % checksum+=indx*j /j j 1 add def } loop % Put the checksum character /checksum checksum 103 mod def sbs j 6 mul encs checksum get putinterval % Put the end character sbs j 6 mul 6 add encs 106 get putinterval % Shrink sbs and txt to fit exactly /sbs sbs 0 j 6 mul 13 add getinterval def /txt txt 0 j getinterval def % Return the arguments /retval 1 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /code128 load 0 1 dict put % --END ENCODER code128-- % --BEGIN ENCODER code39-- % --DESC: Code 39 % --EXAM: THIS IS CODE 39 /code39 { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includecheck false def % Enable/disable checkdigit /includetext false def /includecheckintext false def /textfont /Courier def /textsize 10 def /textpos -7 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def % Create an array containing the character mappings /encs [ (1113313111) (3113111131) (1133111131) (3133111111) (1113311131) (3113311111) (1133311111) (1113113131) (3113113111) (1133113111) (3111131131) (1131131131) (3131131111) (1111331131) (3111331111) (1131331111) (1111133131) (3111133111) (1131133111) (1111333111) (3111111331) (1131111331) (3131111311) (1111311331) (3111311311) (1131311311) (1111113331) (3111113311) (1131113311) (1111313311) (3311111131) (1331111131) (3331111111) (1311311131) (3311311111) (1331311111) (1311113131) (3311113111) (1331113111) (1313131111) (1313111311) (1311131311) (1113131311) (1311313111) ] def % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*) def /barlen barcode length def % Length of the code includecheck { /sbs barlen 10 mul 30 add string def /txt barlen 3 add array def } { /sbs barlen 10 mul 20 add string def /txt barlen 2 add array def } ifelse /checksum 0 def % Put the start character sbs 0 encs 43 get putinterval txt 0 [(*) 0 textpos textfont textsize] put 0 1 barlen 1 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 10 mul 10 add enc putinterval % Put encoded digit into sbs txt i 1 add [barcode i 1 getinterval i 1 add 16 mul textpos textfont textsize] put /checksum checksum indx add def } for % Put the checksum and end characters includecheck { /checksum checksum 43 mod def sbs barlen 10 mul 10 add encs checksum get putinterval includecheckintext { txt barlen 1 add [barchars checksum 1 getinterval barlen 1 add 16 mul textpos textfont textsize] put } { txt barlen 1 add [() barlen 1 add 16 mul textpos textfont textsize] put } ifelse sbs barlen 10 mul 20 add encs 43 get putinterval txt barlen 2 add [(*) barlen 2 add 16 mul textpos textfont textsize] put } { sbs barlen 10 mul 10 add encs 43 get putinterval txt barlen 1 add [(*) barlen 1 add 16 mul textpos textfont textsize] put } ifelse % Return the arguments /retval 2 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /code39 load 0 1 dict put % --END ENCODER code39-- % --BEGIN ENCODER code93-- % --DESC: Code 93 % --EXAM: THIS IS CODE 93 /code93 { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includecheck false def % Enable/disable checkdigit /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textpos -7 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def /encs [ (131112) (111213) (111312) (111411) (121113) (121212) (121311) (111114) (131211) (141111) (211113) (211212) (211311) (221112) (221211) (231111) (112113) (112212) (112311) (122112) (132111) (111123) (111222) (111321) (121122) (131121) (212112) (212211) (211122) (211221) (221121) (222111) (112122) (112221) (122121) (123111) (121131) (311112) (311211) (321111) (112131) (113121) (211131) (121221) (312111) (311121) (122211) (111141) (1111411) ] def % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%) def /barlen barcode length def % Length of the code barcode { (^) search false eq {pop exit} if pop pop /barlen barlen 3 sub def } loop includecheck { /sbs barlen 6 mul 25 add string def } { /sbs barlen 6 mul 13 add string def } ifelse /txt barlen array def % Put the start character sbs 0 encs 47 get putinterval /checksum1 0 def /checksum2 0 def /i 0 def /j 0 def { % loop j barlen eq {exit} if barcode i 1 getinterval (^) eq { % indx is given by the next three characters /indx barcode i 1 add 3 getinterval cvi def txt j [( ) j 9 mul 9 add textpos textfont textsize] put /i i 4 add def } { barchars barcode i 1 getinterval search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post txt j [barchars indx 1 getinterval j 9 mul 9 add textpos textfont textsize] put /i i 1 add def } ifelse /enc encs indx get def % Get the indxth encoding sbs j 6 mul 6 add enc putinterval % Put encoded digit into sbs /checksum1 checksum1 barlen j sub 1 sub 20 mod 1 add indx mul add def /checksum2 checksum2 barlen j sub 15 mod 1 add indx mul add def /j j 1 add def } loop includecheck { % Put the first checksum character /checksum1 checksum1 47 mod def /checksum2 checksum2 checksum1 add 47 mod def sbs j 6 mul 6 add encs checksum1 get putinterval sbs j 6 mul 12 add encs checksum2 get putinterval % Put the end character sbs j 6 mul 18 add encs 48 get putinterval } { % Put the end character sbs j 6 mul 6 add encs 48 get putinterval } ifelse % Return the arguments /retval 1 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /code93 load 0 1 dict put % --END ENCODER code93-- % --BEGIN ENCODER interleaved2of5-- % --DESC: Interleaved 2 of 5 (ITF) % --EXAM: 24012345678905 /interleaved2of5 { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includecheck false def % Enable/disable checkdigit /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textpos -7 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def /barlen barcode length def % Length of the code % Prefix 0 to barcode if length is even and including checkdigit % or length is odd and not including checkdigit barlen 2 mod 0 eq includecheck and % even & includecheck barlen 2 mod 0 ne includecheck not and or { % odd & !includecheck /pad barlen 1 add string def % Create pad one bigger than barcode pad 0 48 put % Put ascii 0 at start of pad pad 1 barcode putinterval % Add barcode to the end of pad /barcode pad def % barcode=pad /barlen barlen 1 add def % barlen++ } if % Add checksum to end of barcode includecheck { /checksum 0 def 0 1 barlen 1 sub { /i exch def i 2 mod 0 eq { /checksum checksum barcode i get 48 sub 3 mul add def } { /checksum checksum barcode i get 48 sub add def } ifelse } for /checksum 10 checksum 10 mod sub 10 mod def /pad barlen 1 add string def % Create pad one bigger than barcode pad 0 barcode putinterval % Add barcode to the start of pad pad barlen checksum 48 add put % Add checksum to end of pad /barcode pad def % barcode=pad /barlen barlen 1 add def % barlen++ } if % Create an array containing the character mappings /encs [ (11331) (31113) (13113) (33111) (11313) (31311) (13311) (11133) (31131) (13131) (1111) (3111) ] def % Create a string of the available characters /barchars (0123456789) def /sbs barlen 5 mul 8 add string def /txt barlen array def % Put the start character sbs 0 encs 10 get putinterval 0 2 barlen 1 sub { /i exch def % Lookup the encodings for two consecutive barcode characters barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enca encs indx get def % Get the indxth encoding barcode i 1 add 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /encb encs indx get def % Get the indxth encoding % Interleave the two character encodings /intl enca length 2 mul string def 0 1 enca length 1 sub { /j exch def /achar enca j get def /bchar encb j get def intl j 2 mul achar put intl j 2 mul 1 add bchar put } for sbs i 5 mul 4 add intl putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 9 mul 4 add textpos textfont textsize] put includecheck includecheckintext not and barlen 2 sub i eq and { txt i 1 add [( ) i 1 add 9 mul 4 add textpos textfont textsize] put } { txt i 1 add [barcode i 1 add 1 getinterval i 1 add 9 mul 4 add textpos textfont textsize] put } ifelse } for % Put the end character sbs barlen 5 mul 4 add encs 11 get putinterval % Return the arguments /retval 1 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /interleaved2of5 load 0 1 dict put % --END ENCODER interleaved2of5-- % --BEGIN ENCODER rss14-- % --DESC: Reduced Space Symbology 14 (RSS-14) % --EXAM: 24012345678905 /rss14 { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /height 1 def /linkage false def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /height height cvr def /getRSSwidths { /mw exch def /nm exch def /val exch def /j 0 def /i 0 def { /v () def mw 1 ne {/v i mw 4 string cvrs def} if 0 v {48 sub add} forall 4 add nm eq { j val eq {exit} if /j j 1 add def } if /i i 1 add def } loop [4 {1} repeat v {47 sub} forall] v length 4 getinterval } bind def /binval [barcode {48 sub} forall] def /binval [linkage {1} {0} ifelse binval 0 13 getinterval {} forall] def 0 1 12 { /i exch def binval i 1 add 2 copy get binval i get 4537077 mod 10 mul add put binval i binval i get 4537077 idiv put } for /right binval 13 get 4537077 mod def binval 13 2 copy get 4537077 idiv put /left 0 def /i true def 0 1 13 { /j exch def binval j get dup 0 eq i and { pop } { /i false def /left left 3 -1 roll 10 13 j sub exp cvi mul add def } ifelse } for /d1 left 1597 idiv def /d2 left 1597 mod def /d3 right 1597 idiv def /d4 right 1597 mod def /tab164 [ 160 0 12 4 8 1 161 1 960 161 10 6 6 3 80 10 2014 961 8 8 4 5 31 34 2714 2015 6 10 3 6 10 70 2840 2715 4 12 1 8 1 126 ] def /tab154 [ 335 0 5 10 2 7 4 84 1035 336 7 8 4 5 20 35 1515 1036 9 6 6 3 48 10 1596 1516 11 4 8 1 81 1 ] def /i 0 def { d1 tab164 i get le { tab164 i 1 add 7 getinterval {} forall /d1te exch def /d1to exch def /d1mwe exch def /d1mwo exch def /d1ele exch def /d1elo exch def /d1gs exch def exit } if /i i 8 add def } loop /i 0 def { d2 tab154 i get le { tab154 i 1 add 7 getinterval {} forall /d2te exch def /d2to exch def /d2mwe exch def /d2mwo exch def /d2ele exch def /d2elo exch def /d2gs exch def exit } if /i i 8 add def } loop /i 0 def { d3 tab164 i get le { tab164 i 1 add 7 getinterval {} forall /d3te exch def /d3to exch def /d3mwe exch def /d3mwo exch def /d3ele exch def /d3elo exch def /d3gs exch def exit } if /i i 8 add def } loop /i 0 def { d4 tab154 i get le { tab154 i 1 add 7 getinterval {} forall /d4te exch def /d4to exch def /d4mwe exch def /d4mwo exch def /d4ele exch def /d4elo exch def /d4gs exch def exit } if /i i 8 add def } loop /d1wo d1 d1gs sub d1te idiv d1elo d1mwo getRSSwidths def /d1we d1 d1gs sub d1te mod d1ele d1mwe getRSSwidths def /d2wo d2 d2gs sub d2to mod d2elo d2mwo getRSSwidths def /d2we d2 d2gs sub d2to idiv d2ele d2mwe getRSSwidths def /d3wo d3 d3gs sub d3te idiv d3elo d3mwo getRSSwidths def /d3we d3 d3gs sub d3te mod d3ele d3mwe getRSSwidths def /d4wo d4 d4gs sub d4to mod d4elo d4mwo getRSSwidths def /d4we d4 d4gs sub d4to idiv d4ele d4mwe getRSSwidths def /d1w 8 array def 0 1 3 { /i exch def d1w i 2 mul d1wo i get put d1w i 2 mul 1 add d1we i get put } for /d2w 8 array def 0 1 3 { /i exch def d2w 7 i 2 mul sub d2wo i get put d2w 6 i 2 mul sub d2we i get put } for /d3w 8 array def 0 1 3 { /i exch def d3w 7 i 2 mul sub d3wo i get put d3w 6 i 2 mul sub d3we i get put } for /d4w 8 array def 0 1 3 { /i exch def d4w i 2 mul d4wo i get put d4w i 2 mul 1 add d4we i get put } for /widths [ d1w {} forall d2w {} forall d3w {} forall d4w {} forall ] def /checkweights [ 1 3 9 27 2 6 18 54 58 72 24 8 29 36 12 4 74 51 17 32 37 65 48 16 64 34 23 69 49 68 46 59 ] def /checkwidths [ 3 8 2 1 1 3 5 5 1 1 3 3 7 1 1 3 1 9 1 1 2 7 4 1 1 2 5 6 1 1 2 3 8 1 1 1 5 7 1 1 1 3 9 1 1 ] def /checksum 0 def 0 1 31 { /i exch def /checksum checksum widths i get checkweights i get mul add def } for /checksum checksum 79 mod def checksum 8 ge {/checksum checksum 1 add def} if checksum 72 ge {/checksum checksum 1 add def} if /checklt checkwidths checksum 9 idiv 5 mul 5 getinterval def /checkrtrev checkwidths checksum 9 mod 5 mul 5 getinterval def /checkrt 5 array def 0 1 4 { /i exch def checkrt i checkrtrev 4 i sub get put } for /sbs [ 1 d1w {} forall checklt {} forall d2w {} forall d4w {} forall checkrt {} forall d3w {} forall 1 1 ] def % Return the arguments /retval 1 dict def retval (sbs) sbs put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put retval (opt) useropts put retval end } bind def /rss14 load 0 1 dict put % --END ENCODER rss14-- % --BEGIN ENCODER rsslimited-- % --DESC: Reduced Space Symbology Limited (RSS-Limited) % --EXAM: 00978186074271 /rsslimited { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /height height cvr def /getRSSwidths { /el exch def /mw exch def /nm exch def /val exch def /j 0 def /i 0 def { /v () def mw 1 ne {/v i mw el string cvrs def} if 0 v {48 sub add} forall el add nm eq { j val eq {exit} if /j j 1 add def } if /i i 1 add def } loop [el {1} repeat v {47 sub} forall] v length el getinterval } bind def /binval [barcode {48 sub} forall] def /binval [binval 0 13 getinterval {} forall] def 0 1 11 { /i exch def binval i 1 add 2 copy get binval i get 2013571 mod 10 mul add put binval i binval i get 2013571 idiv put } for /d2 binval 12 get 2013571 mod def binval 12 2 copy get 2013571 idiv put /d1 0 def /i true def 0 1 12 { /j exch def binval j get dup 0 eq i and { pop } { /i false def /d1 d1 3 -1 roll 10 12 j sub exp cvi mul add def } ifelse } for /tab267 [ 183063 0 17 9 6 3 6538 28 820063 183064 13 13 5 4 875 728 1000775 820064 9 17 3 6 28 6454 1491020 1000776 15 11 5 4 2415 203 1979844 1491021 11 15 4 5 203 2408 1996938 1979845 19 7 8 1 17094 1 2013570 1996939 7 19 1 8 1 16632 ] def /i 0 def { d1 tab267 i get le { tab267 i 1 add 7 getinterval {} forall /d1te exch def /d1to exch def /d1mwe exch def /d1mwo exch def /d1ele exch def /d1elo exch def /d1gs exch def exit } if /i i 8 add def } loop /i 0 def { d2 tab267 i get le { tab267 i 1 add 7 getinterval {} forall /d2te exch def /d2to exch def /d2mwe exch def /d2mwo exch def /d2ele exch def /d2elo exch def /d2gs exch def exit } if /i i 8 add def } loop /d1wo d1 d1gs sub d1te idiv d1elo d1mwo 7 getRSSwidths def /d1we d1 d1gs sub d1te mod d1ele d1mwe 7 getRSSwidths def /d2wo d2 d2gs sub d2te idiv d2elo d2mwo 7 getRSSwidths def /d2we d2 d2gs sub d2te mod d2ele d2mwe 7 getRSSwidths def /d1w 14 array def 0 1 6 { /i exch def d1w i 2 mul d1wo i get put d1w i 2 mul 1 add d1we i get put } for /d2w 14 array def 0 1 6 { /i exch def d2w i 2 mul d2wo i get put d2w i 2 mul 1 add d2we i get put } for /widths [ d1w {} forall d2w {} forall ] def /checkweights [ 1 3 9 27 81 65 17 51 64 14 42 37 22 66 20 60 2 6 18 54 73 41 34 13 39 28 84 74 ] def /checkseq [ 0 1 43 {} for 45 52 57 63 1 66 {} for 73 1 79 {} for 82 126 1 130 {} for 132 141 1 146 {} for 210 1 217 {} for 220 316 1 323 {} for 326 337 ] def /checksum 0 def 0 1 27 { /i exch def /checksum checksum widths i get checkweights i get mul add def } for /checksum checksum 89 mod def /seq checkseq checksum get def /swidths seq 21 idiv 8 3 6 getRSSwidths def /bwidths seq 21 mod 8 3 6 getRSSwidths def /checkwidths [0 0 0 0 0 0 0 0 0 0 0 0 1 1] def 0 1 5 { /i exch def checkwidths i 2 mul swidths i get put checkwidths i 2 mul 1 add bwidths i get put } for /sbs [ 1 d1w {} forall checkwidths {} forall d2w {} forall 1 1 ] def % Return the arguments /retval 1 dict def retval (sbs) sbs put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put retval (opt) useropts put retval end } bind def /rsslimited load 0 1 dict put % --END ENCODER rsslimited-- % --BEGIN ENCODER rssexpanded-- % --DESC: Reduced Space Symbology Expanded (RSS-Expanded) % --EXAM: 000000010011001010100001000000010000 /rssexpanded { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /height height cvr def /getRSSwidths { /mw exch def /nm exch def /val exch def /j 0 def /i 0 def { /v () def mw 1 ne {/v i mw 4 string cvrs def} if 0 v {48 sub add} forall 4 add nm eq { j val eq {exit} if /j j 1 add def } if /i i 1 add def } loop [4 {1} repeat v {47 sub} forall] v length 4 getinterval } bind def /binval [barcode {48 sub} forall] def /datalen binval length 12 idiv def /tab174 [ 347 0 12 5 7 2 87 4 1387 348 10 7 5 4 52 20 2947 1388 8 9 4 5 30 52 3987 2948 6 11 3 6 10 104 4191 3988 4 13 1 8 1 204 ] def /dxw datalen array def 0 1 datalen 1 sub { /x exch def /d binval x 12 mul 12 getinterval def /d 0 0 1 11 {/j exch def 2 11 j sub exp cvi d j get mul add} for def /j 0 def { d tab174 j get le { tab174 j 1 add 7 getinterval {} forall /dte exch def /dto exch def /dmwe exch def /dmwo exch def /dele exch def /delo exch def /dgs exch def exit } if /j j 8 add def } loop /dwo d dgs sub dte idiv delo dmwo getRSSwidths def /dwe d dgs sub dte mod dele dmwe getRSSwidths def /dw 8 array def x 2 mod 0 eq { 0 1 3 { /j exch def dw 7 j 2 mul sub dwo j get put dw 6 j 2 mul sub dwe j get put } for } { 0 1 3 { /j exch def dw j 2 mul dwo j get put dw j 2 mul 1 add dwe j get put } for } ifelse dxw x dw put } for /widths [ dxw {{} forall} forall ] def /checkweights [ 77 96 32 81 27 9 3 1 20 60 180 118 143 7 21 63 205 209 140 117 39 13 145 189 193 157 49 147 19 57 171 91 132 44 85 169 197 136 186 62 185 133 188 142 4 12 36 108 50 87 29 80 97 173 128 113 150 28 84 41 123 158 52 156 166 196 206 139 187 203 138 46 76 17 51 153 37 111 122 155 146 119 110 107 106 176 129 43 16 48 144 10 30 90 59 177 164 125 112 178 200 137 116 109 70 210 208 202 184 130 179 115 190 204 68 93 31 151 191 134 148 22 66 198 172 94 71 2 40 154 192 64 162 54 18 6 120 149 25 75 14 42 126 167 175 199 207 69 23 78 26 79 103 98 83 38 114 131 182 124 159 53 88 170 127 183 61 161 55 165 73 8 24 72 5 15 89 100 174 58 160 194 135 45 ] def /checksum 0 def 0 1 widths length 1 sub { /i exch def /checksum checksum widths i get checkweights i get mul add def } for /checksum checksum 211 mod datalen 3 sub 211 mul add def /i 0 def { checksum tab174 i get le { tab174 i 1 add 7 getinterval {} forall /cte exch def /cto exch def /cmwe exch def /cmwo exch def /cele exch def /celo exch def /cgs exch def exit } if /i i 8 add def } loop /cwo checksum cgs sub cte idiv celo cmwo getRSSwidths def /cwe checksum cgs sub cte mod cele cmwe getRSSwidths def /cw 8 array def 0 1 3 { /i exch def cw i 2 mul cwo i get put cw i 2 mul 1 add cwe i get put } for /finderwidths [ 1 8 4 1 1 1 1 4 8 1 3 6 4 1 1 1 1 4 6 3 3 4 6 1 1 1 1 6 4 3 3 2 8 1 1 1 1 8 2 3 2 6 5 1 1 1 1 5 6 2 2 2 9 1 1 1 1 9 2 2 ] def /finderseq [ [0 1] [0 3 2] [0 5 2 7] [0 9 2 7 4] [0 9 2 7 6 11] [0 9 2 7 8 11 10] [0 1 2 3 4 5 6 7] [0 1 2 3 4 5 6 9 8] [0 1 2 3 4 5 6 9 10 11] [0 1 2 3 4 7 6 9 8 11 10] ] def /seq finderseq datalen 2 add 2 idiv 2 sub get def /fxw seq length array def 0 1 seq length 1 sub { /x exch def fxw x finderwidths seq x get 5 mul 5 getinterval put } for /sbs [ 1 cw {} forall 0 1 datalen 1 sub { /i exch def i 2 mod 0 eq {fxw i 2 idiv get {} forall} if dxw i get {} forall } for 1 1 ] def % Return the arguments /retval 1 dict def retval (sbs) sbs put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put retval (opt) useropts put retval end } bind def /rssexpanded load 0 1 dict put % --END ENCODER rssexpanded-- % --BEGIN ENCODER code2of5-- % --DESC: Code 25 % --EXAM: 01234567 /code2of5 { % Thanks to Michael Landers 0 begin % Confine variable to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includecheck false def /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textpos -7 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def % Create an array containing the character mappings /encs [ (1111313111) (3111111131) (1131111131) (3131111111) (1111311131) (3111311111) (1131311111) (1111113131) (3111113111) (1131113111) (313111) (311131) ] def % Create a string of the available characters /barchars (0123456789) def /barlen barcode length def % Length of the code includecheck { /sbs barlen 10 mul 22 add string def /txt barlen 1 add array def } { /sbs barlen 10 mul 12 add string def /txt barlen array def } ifelse % Put the start character sbs 0 encs 10 get putinterval /checksum 0 def 0 1 barlen 1 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 10 mul 6 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 14 mul 10 add textpos textfont textsize] put barlen i sub 2 mod 0 eq { /checksum checksum indx add def } { /checksum checksum indx 3 mul add def } ifelse } for % Put the checksum and end characters includecheck { /checksum 10 checksum 10 mod sub 10 mod def sbs barlen 10 mul 6 add encs checksum get putinterval sbs barlen 10 mul 16 add encs 11 get putinterval includecheckintext { txt barlen [barchars checksum 1 getinterval barlen 14 mul 10 add textpos textfont textsize] put } { txt barlen [( ) barlen 14 mul 10 add textpos textfont textsize] put } ifelse } { sbs barlen 10 mul 6 add encs 11 get putinterval } ifelse % Return the arguments /retval 1 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /code2of5 load 0 1 dict put % --END ENCODER code2of5-- % --BEGIN ENCODER code11-- % --DESC: Code 11 % --EXAM: 0123456789 /code11 { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includecheck false def /includetext false def /includecheckintext false def /textfont /Courier def /textsize 10 def /textpos -7 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def % Create an array containing the character mappings /encs [ (111131) (311131) (131131) (331111) (113131) (313111) (133111) (111331) (311311) (311111) (113111) (113311) ] def % Create a string of the available characters /barchars (0123456789-) def /barlen barcode length def % Length of the code includecheck { barlen 10 ge { /sbs barlen 6 mul 24 add string def /txt barlen 2 add array def } { /sbs barlen 6 mul 18 add string def /txt barlen 1 add array def } ifelse } { /sbs barlen 6 mul 12 add string def /txt barlen array def } ifelse % Put the start character sbs 0 encs 10 get putinterval /checksum1 0 def /checksum2 0 def /xpos 8 def 0 1 barlen 1 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 6 mul 6 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval xpos textpos textfont textsize] put 0 1 5 { % xpos+=width of the character /xpos exch enc exch get 48 sub xpos add def } for /checksum1 checksum1 barlen i sub 1 sub 10 mod 1 add indx mul add def /checksum2 checksum2 barlen i sub 9 mod 1 add indx mul add def } for % Put the checksum and end characters includecheck { /checksum1 checksum1 11 mod def barlen 10 ge { /checksum2 checksum2 checksum1 add 11 mod def sbs barlen 6 mul 6 add encs checksum1 get putinterval sbs barlen 6 mul 12 add encs checksum2 get putinterval includecheckintext { txt barlen [barchars checksum1 1 getinterval xpos textpos textfont textsize] put /enc encs checksum1 get def 0 1 5 { % xpos+=width of the character /xpos exch enc exch get 48 sub xpos add def } for txt barlen 1 add [barchars checksum2 1 getinterval xpos textpos textfont textsize] put } { txt barlen [() xpos textpos textfont textsize] put txt barlen 1 add [() xpos textpos textfont textsize] put } ifelse sbs barlen 6 mul 18 add encs 11 get putinterval } { sbs barlen 6 mul 6 add encs checksum1 get putinterval includecheckintext { txt barlen [barchars checksum1 1 getinterval xpos textpos textfont textsize] put } { txt barlen [() xpos textpos textfont textsize] put } ifelse sbs barlen 6 mul 12 add encs 11 get putinterval } ifelse } { sbs barlen 6 mul 6 add encs 11 get putinterval } ifelse % Return the arguments /retval 1 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /code11 load 0 1 dict put % --END ENCODER code11-- % --BEGIN ENCODER rationalizedCodabar-- % --DESC: Rationalized Codabar % --EXAM: A0123456789B /rationalizedCodabar { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includecheck false def % Enable/disable checkdigit /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textpos -7 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def % Create an array containing the character mappings /encs [ (11111331) (11113311) (11131131) (33111111) (11311311) (31111311) (13111131) (13113111) (13311111) (31131111) (11133111) (11331111) (31113131) (31311131) (31313111) (11313131) (11331311) (13131131) (11131331) (11133311) ] def % Create a string of the available characters /barchars (0123456789-$:/.+ABCD) def /barlen barcode length def % Length of the code includecheck { /sbs barlen 8 mul 8 add string def /txt barlen 1 add array def } { /sbs barlen 8 mul string def /txt barlen array def } ifelse /checksum 0 def /xpos 0 def 0 1 barlen 2 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 8 mul enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval xpos textpos textfont textsize] put 0 1 7 { % xpos+=width of the character /xpos exch enc exch get 48 sub xpos add def } for /checksum checksum indx add def } for % Find index of last character barcode barlen 1 sub 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post includecheck { % Put the checksum character /checksum checksum indx add def /checksum 16 checksum 16 mod sub 16 mod def sbs barlen 8 mul 8 sub encs checksum get putinterval includecheckintext { txt barlen 1 sub [barchars checksum 1 getinterval xpos textpos textfont textsize] put } { txt barlen 1 sub [( ) xpos textpos textfont textsize] put } ifelse 0 1 7 { % xpos+=width of the character /xpos exch encs checksum get exch get 48 sub xpos add def } for % Put the end character /enc encs indx get def % Get the indxth encoding sbs barlen 8 mul enc putinterval % Put encoded digit into sbs txt barlen [barcode barlen 1 sub 1 getinterval xpos textpos textfont textsize] put } { % Put the end character /enc encs indx get def % Get the indxth encoding sbs barlen 8 mul 8 sub enc putinterval % Put encoded digit into sbs txt barlen 1 sub [barcode barlen 1 sub 1 getinterval xpos textpos textfont textsize] put } ifelse % Return the arguments /retval 1 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /rationalizedCodabar load 0 1 dict put % --END ENCODER rationalizedCodabar-- % --BEGIN ENCODER onecode-- % --DESC: United States Postal Service OneCode % --EXAM: 0123456709498765432101234567891 /onecode { 0 begin /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /height 0.175 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /height height cvr def /barlen barcode length def /normalize { /base exch def /num exch def num length 1 sub -1 1 { /i exch def num i 1 sub 2 copy get num i get base idiv add put num i num i get base mod put } for { %loop - extend input as necessary num 0 get base lt {exit} if /num [0 num {} forall] def num 0 num 0 get num 1 get base idiv add put num 1 num 1 get base mod put } loop % Trim leading zeros /num [/i true def num {dup 0 eq i and {pop} {/i false def} ifelse} forall] def num length 0 eq {/num [0] def} if num } bind def /bigadd { 2 copy length exch length 2 copy sub abs /offset exch def lt {exch} if /a exch def /b exch def 0 1 b length 1 sub { dup a exch offset add 2 copy get b 5 -1 roll get add put } for a } bind def % Conversion of data fields into binary data barlen 20 eq {[0]} if barlen 25 eq {[1]} if barlen 29 eq {[1 0 0 0 0 1]} if barlen 31 eq {[1 0 0 0 1 0 0 0 0 1]} if /binval exch [barcode 20 barlen 20 sub getinterval {48 sub} forall] bigadd def /binval [binval {} forall barcode 0 get 48 sub] def /binval [binval {5 mul} forall] [barcode 1 get 48 sub] bigadd 10 normalize def /binval [binval {} forall barcode 2 18 getinterval {48 sub} forall] def % Conversion of binary data into byte array /bytes 13 array def /bintmp [binval {} forall] def 12 -1 0 { /i exch def 0 1 bintmp length 2 sub { /j exch def bintmp j 1 add 2 copy get bintmp j get 256 mod 10 mul add put bintmp j bintmp j get 256 idiv put } for bytes i bintmp bintmp length 1 sub get 256 mod put bintmp bintmp length 1 sub 2 copy get 256 idiv put } for % Generation of 11-bit CRC on byte array /fcs 2047 def /dat bytes 0 get 5 bitshift def 6 { fcs dat xor 1024 and 0 ne { /fcs fcs 1 bitshift 3893 xor def } { /fcs fcs 1 bitshift def } ifelse /fcs fcs 2047 and def /dat dat 1 bitshift def } repeat 1 1 12 { bytes exch get 3 bitshift /dat exch def 8 { fcs dat xor 1024 and 0 ne { /fcs fcs 1 bitshift 3893 xor def } { /fcs fcs 1 bitshift def } ifelse /fcs fcs 2047 and def /dat dat 1 bitshift def } repeat } for % Conversion from binary data to codewords /codewords 10 array def 9 -1 0 { /i exch def i 9 eq { /b 636 def } { /b 1365 def } ifelse 0 1 binval length 2 sub { /j exch def binval j 1 add 2 copy get binval j get b mod 10 mul add put binval j binval j get b idiv put } for codewords i binval binval length 1 sub get b mod put binval binval length 1 sub 2 copy get b idiv put } for % Inserting additional information into codewords codewords 9 codewords 9 get 2 mul put fcs 1024 and 0 ne { codewords 0 codewords 0 get 659 add put } if % Conversion from codewords to characters /tab513 1287 dict def /lo 0 def /hi 1286 def 0 1 8191 { { % no loop - provides common exit point /i exch def /onbits 0 def 0 1 12 { i exch 1 exch bitshift and 0 ne { /onbits onbits 1 add def } if } for onbits 5 ne {exit} if /j i def /rev 0 def 16 { /rev rev 1 bitshift j 1 and or def /j j -1 bitshift def } repeat /rev rev -3 bitshift def rev i lt {exit} if rev i eq { tab513 hi i put /hi hi 1 sub def } { tab513 lo i put tab513 lo 1 add rev put /lo lo 2 add def } ifelse exit } loop } for /tab213 78 dict def /lo 0 def /hi 77 def 0 1 8191 { { % no loop - provides common exit point /i exch def /onbits 0 def 0 1 12 { i exch 1 exch bitshift and 0 ne { /onbits onbits 1 add def } if } for onbits 2 ne {exit} if /j i def /rev 0 def 16 { /rev rev 1 bitshift j 1 and or def /j j -1 bitshift def } repeat /rev rev -3 bitshift def rev i lt {exit} if rev i eq { tab213 hi i put /hi hi 1 sub def } { tab213 lo i put tab213 lo 1 add rev put /lo lo 2 add def } ifelse exit } loop } for /chars 10 array def 0 1 9 { /i exch def codewords i get dup 1286 le { tab513 exch get } { tab213 exch 1287 sub get } ifelse chars i 3 -1 roll put } for 9 -1 0 { /i exch def 2 i exp cvi fcs and 0 ne { chars i chars i get 8191 xor put } if } for % Conversion from characters to the OneCode encoding /barmap [ 7 2 4 3 1 10 0 0 9 12 2 8 5 5 6 11 8 9 3 1 0 1 5 12 2 5 1 8 4 4 9 11 6 3 8 10 3 9 7 6 5 11 1 4 8 5 2 12 9 10 0 2 7 1 6 7 3 6 4 9 0 3 8 6 6 4 2 7 1 1 9 9 7 10 5 2 4 0 3 8 6 2 0 4 8 11 1 0 9 8 3 12 2 6 7 7 5 1 4 10 1 12 6 9 7 3 8 0 5 8 9 7 4 6 2 10 3 4 0 5 8 4 5 7 7 11 1 9 6 0 9 6 0 6 4 8 2 1 3 2 5 9 8 12 4 11 6 1 9 5 7 4 3 3 1 2 0 7 2 0 1 3 4 1 6 10 3 5 8 7 9 4 2 11 5 6 0 8 7 12 4 2 8 1 5 10 3 0 9 3 0 9 6 5 2 4 7 8 1 7 5 0 4 5 2 3 0 10 6 12 9 2 3 11 1 6 8 8 7 9 5 4 0 11 1 5 2 2 9 1 4 12 8 3 6 6 7 0 3 7 4 7 7 5 0 12 1 11 2 9 9 0 6 8 5 3 3 10 8 2 ] def /bbs 65 array def /bhs 65 array def 0 1 64 { /i exch def /dec chars barmap i 4 mul get get 2 barmap i 4 mul 1 add get exp cvi and 0 ne def /asc chars barmap i 4 mul 2 add get get 2 barmap i 4 mul 3 add get exp cvi and 0 ne def dec not asc not and { bbs i 3 height mul 8 div put bhs i 2 height mul 8 div put } if dec not asc and { bbs i 3 height mul 8 div put bhs i 5 height mul 8 div put } if dec asc not and { bbs i 0 height mul 8 div put bhs i 5 height mul 8 div put } if dec asc and { bbs i 0 height mul 8 div put bhs i 8 height mul 8 div put } if } for /retval 4 dict def retval (bbs) bbs put retval (bhs) bhs put retval (sbs) [bhs length 1 sub {1.44 1.872} repeat 1.44] put retval (opt) useropts put retval end } bind def /onecode load 0 1 dict put % --END ENCODER onecode-- % --BEGIN ENCODER postnet-- % --DESC: United States Postal Service Postnet % --EXAM: 012345 /postnet { % Thanks to Ross McFarland 0 begin /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textpos -7 def /height 0.125 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def /barlen barcode length def % Create an array containing the character mappings /encs [ (55222) (22255) (22525) (22552) (25225) (25252) (25522) (52225) (52252) (52522) (5) (5) ] def % Create a string of the available characters /barchars (0123456789) def /bhs barlen 5 mul 7 add array def /txt barlen 1 add array def % Put start character /enc encs 10 get def /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs 0 heights putinterval % Put encoded digit into sbs /checksum 0 def 0 1 barlen 1 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs i 5 mul 1 add heights putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 5 mul 1 add 3.312 mul textpos textfont textsize] put /checksum checksum indx add def % checksum+=indx } for % Put the checksum character /checksum 10 checksum 10 mod sub 10 mod def /enc encs checksum get def /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs barlen 5 mul 1 add heights putinterval includecheckintext { txt barlen [barchars checksum 1 getinterval barlen 5 mul 1 add 3.312 mul textpos textfont textsize] put } { txt barlen [( ) barlen 5 mul 1 add 72 mul 25 div textpos textfont textsize] put } ifelse % Put end character /enc encs 11 get def /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs barlen 5 mul 6 add heights putinterval /retval 1 dict def retval (bhs) bhs put retval (bbs) [bhs length {0} repeat] put retval (sbs) [bhs length 1 sub {1.44 1.872} repeat 1.44] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /postnet load 0 1 dict put % --END ENCODER postnet-- % --BEGIN ENCODER royalmail-- % --DESC: Royal Mail 4 State Customer Code (RM4SCC) % --EXAM: LE28HS9Z /royalmail { 0 begin /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textpos -7 def /height 0.175 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def % Create an array containing the character mappings /encs [ (3300) (2211) (2301) (2310) (3201) (3210) (1122) (0033) (0123) (0132) (1023) (1032) (1302) (0213) (0303) (0312) (1203) (1212) (1320) (0231) (0321) (0330) (1221) (1230) (3102) (2013) (2103) (2112) (3003) (3012) (3120) (2031) (2121) (2130) (3021) (3030) (2) (3) ] def % Create a string of the available characters /barchars (ZUVWXY501234B6789AHCDEFGNIJKLMTOPQRS) def /barlen barcode length def /encstr barlen 4 mul 6 add string def /txt barlen 1 add array def % Put start character encstr 0 encs 36 get putinterval /checksumrow 0 def /checksumcol 0 def 0 1 barlen 1 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding encstr i 4 mul 1 add enc putinterval txt i [barcode i 1 getinterval i 4 mul 1 add 3.312 mul textpos textfont textsize] put /checksumrow checksumrow indx 6 idiv add def /checksumcol checksumcol indx 6 mod add def } for % Put the checksum character /checksum checksumrow 6 mod 6 mul checksumcol 6 mod add def /enc encs checksum get def encstr barlen 4 mul 1 add enc putinterval includecheckintext { txt barlen [barchars checksum 1 getinterval barlen 4 mul 1 add 3.312 mul textpos textfont textsize] put } { txt barlen [( ) barlen 4 mul 1 add 3.312 mul textpos textfont textsize] put } ifelse % Put end character encstr barlen 4 mul 5 add encs 37 get putinterval /bbs encstr length array def /bhs encstr length array def 0 1 encstr length 1 sub { /i exch def /enc encstr i 1 getinterval def enc (0) eq { bbs i 3 height mul 8 div put bhs i 2 height mul 8 div put } if enc (1) eq { bbs i 0 height mul 8 div put bhs i 5 height mul 8 div put } if enc (2) eq { bbs i 3 height mul 8 div put bhs i 5 height mul 8 div put } if enc (3) eq { bbs i 0 height mul 8 div put bhs i 8 height mul 8 div put } if } for /retval 4 dict def retval (bbs) bbs put retval (bhs) bhs put retval (sbs) [bhs length 1 sub {1.44 1.872} repeat 1.44] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /royalmail load 0 1 dict put % --END ENCODER royalmail-- % --BEGIN ENCODER auspost-- % --DESC: AusPost 4 State Customer Code % --EXAM: 5956439111ABA 9 /auspost { 0 begin /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textpos -7 def /height 0.175 def /custinfoenc (character) def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def % Create an array containing the character mappings /encs [ (000) (001) (002) (010) (011) (012) (020) (021) (022) (100) (101) (102) (110) (111) (112) (120) (121) (122) (200) (201) (202) (210) (211) (212) (220) (221) (222) (300) (301) (302) (310) (311) (312) (320) (321) (322) (023) (030) (031) (032) (033) (103) (113) (123) (130) (131) (132) (133) (203) (213) (223) (230) (231) (232) (233) (303) (313) (323) (330) (331) (332) (333) (003) (013) (00) (01) (02) (10) (11) (12) (20) (21) (22) (30) (13) (3) ] def % Create a string of the available characters /barchars (ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz #) def /barlen barcode length def barcode 0 2 getinterval (11) eq {37} if barcode 0 2 getinterval (59) eq {52} if barcode 0 2 getinterval (62) eq {67} if /encstr exch string def /txt barlen 2 sub array def % Put start character encstr 0 encs 74 get putinterval % Encode the FCC 0 1 1 { /i exch def encs barcode i 1 getinterval cvi 64 add get encstr i 2 mul 2 add 3 2 roll putinterval } for % Encode the DPID 2 1 9 { /i exch def encs barcode i 1 getinterval cvi 64 add get encstr i 2 mul 2 add 3 2 roll putinterval txt i 2 sub [barcode i 1 getinterval i 2 sub 2 mul 6 add 3.312 mul textpos textfont textsize] put } for % Encode the customer information custinfoenc (numeric) eq { 0 1 barlen 11 sub { /i exch def encs barcode i 10 add 1 getinterval cvi 64 add get encstr i 2 mul 22 add 3 2 roll putinterval txt i 8 add [barcode i 10 add 1 getinterval i 2 mul 22 add 3.312 mul textpos textfont textsize] put } for /ciflen barlen 10 sub 2 mul def } { 0 1 barlen 11 sub { /i exch def barcode i 10 add 1 getinterval barchars exch search pop length /indx exch def pop pop /enc encs indx get def encstr i 3 mul 22 add enc putinterval txt i 8 add [barcode i 10 add 1 getinterval i 3 mul 22 add 3.312 mul textpos textfont textsize] put } for /ciflen barlen 10 sub 3 mul def } ifelse % Add any filler characters 22 ciflen add 1 encstr length 14 sub { encstr exch encs 75 get putinterval } for % Create the 64x64 Reed-Solomon table /rstable 64 64 mul array def rstable 0 [ 64 {0} repeat ] putinterval rstable 64 [ 0 1 63 {} for ] putinterval /prev 1 def 64 { /next prev 1 bitshift def next 64 and 0 ne { /next next 67 xor def } if 0 1 63 { /j exch def /nextcell {rstable 64 next mul j add} def nextcell rstable 64 prev mul j add get 1 bitshift put nextcell get 64 and 0 ne { nextcell nextcell get 67 xor put } if } for /prev next def } repeat % Calculate the Reed-Solomon codes for triples /rscodes encstr length 16 sub 3 idiv 4 add array def rscodes 0 [ 4 {0} repeat ] putinterval 2 3 encstr length 16 sub { /i exch def rscodes rscodes length i 2 sub 3 idiv sub 1 sub encstr i 1 getinterval cvi 16 mul encstr i 1 add 1 getinterval cvi 4 mul add encstr i 2 add 1 getinterval cvi add put } for rscodes length 5 sub -1 0 { /i exch def 0 1 4 { /j exch def rscodes i j add rscodes i j add get rstable 64 [48 17 29 30 1] j get mul rscodes i 4 add get add get xor put } for } for /checkcode (000000000000) def 0 1 3 { /i exch def /enc rscodes 3 i sub get 4 3 string cvrs def checkcode i 3 mul 3 enc length sub add enc putinterval } for % Put checkcode and end characters encstr encstr length 14 sub checkcode putinterval encstr encstr length 2 sub encs 74 get putinterval /bbs encstr length array def /bhs encstr length array def 0 1 encstr length 1 sub { /i exch def /enc encstr i 1 getinterval def enc (0) eq { bbs i 0 height mul 8 div put bhs i 8 height mul 8 div put } if enc (1) eq { bbs i 3 height mul 8 div put bhs i 5 height mul 8 div put } if enc (2) eq { bbs i 0 height mul 8 div put bhs i 5 height mul 8 div put } if enc (3) eq { bbs i 3 height mul 8 div put bhs i 2 height mul 8 div put } if } for /retval 4 dict def retval (bbs) bbs put retval (bhs) bhs put retval (sbs) [bhs length 1 sub {1.44 1.872} repeat 1.44] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /auspost load 0 1 dict put % --END ENCODER auspost-- % --BEGIN ENCODER kix-- % --DESC: Royal Dutch TPG Post KIX 4-State Barcode % --EXAM: 1231FZ13XHS /kix { 0 begin /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textpos -7 def /height 0.175 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def % Create an array containing the character mappings /encs [ (0033) (0123) (0132) (1023) (1032) (1122) (0213) (0303) (0312) (1203) (1212) (1302) (0231) (0321) (0330) (1221) (1230) (1320) (2013) (2103) (2112) (3003) (3012) (3102) (2031) (2121) (2130) (3021) (3030) (3120) (2211) (2301) (2310) (3201) (3210) (3300) ] def % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) def /barlen barcode length def /encstr barlen 4 mul string def /txt barlen array def 0 1 barlen 1 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding encstr i 4 mul enc putinterval txt i [barcode i 1 getinterval i 4 mul 3.312 mul textpos textfont textsize] put } for /bbs encstr length array def /bhs encstr length array def 0 1 encstr length 1 sub { /i exch def /enc encstr i 1 getinterval def enc (0) eq { bbs i 3 height mul 8 div put bhs i 2 height mul 8 div put } if enc (1) eq { bbs i 0 height mul 8 div put bhs i 5 height mul 8 div put } if enc (2) eq { bbs i 3 height mul 8 div put bhs i 5 height mul 8 div put } if enc (3) eq { bbs i 0 height mul 8 div put bhs i 8 height mul 8 div put } if } for /retval 4 dict def retval (bbs) bbs put retval (bhs) bhs put retval (sbs) [bhs length 1 sub {1.44 1.872} repeat 1.44] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /kix load 0 1 dict put % --END ENCODER kix-- % --BEGIN ENCODER msi-- % --DESC: MSI Modified Plessey % --EXAM: 0123456789 /msi { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includecheck false def % Enable/disable checkdigit /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textpos -7 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def % Create an array containing the character mappings /encs [ (13131313) (13131331) (13133113) (13133131) (13311313) (13311331) (13313113) (13313131) (31131313) (31131331) (31) (131) ] def % Create a string of the available characters /barchars (0123456789) def /barlen barcode length def % Length of the code includecheck { /sbs barlen 8 mul 13 add string def /txt barlen 1 add array def } { /sbs barlen 8 mul 5 add string def /txt barlen array def } ifelse % Put start character sbs 0 encs 10 get putinterval /checksum 0 def 0 1 barlen 1 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 8 mul 2 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 16 mul 4 add textpos textfont textsize] put barlen i sub 2 mod 0 eq { /checksum indx checksum add def } { /checksum indx 2 mul dup 10 idiv add checksum add def } ifelse } for % Put the checksum and end characters includecheck { /checksum 10 checksum 10 mod sub 10 mod def sbs barlen 8 mul 2 add encs checksum get putinterval includecheckintext { txt barlen [barchars checksum 1 getinterval barlen 16 mul 4 add textpos textfont textsize] put } { txt barlen [( ) barlen 16 mul 4 add textpos textfont textsize] put } ifelse sbs barlen 8 mul 10 add encs 11 get putinterval } { sbs barlen 8 mul 2 add encs 11 get putinterval } ifelse % Return the arguments /retval 1 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /msi load 0 1 dict put % --END ENCODER msi-- % --BEGIN ENCODER plessey-- % --DESC: Plessey % --EXAM: 01234ABCD /plessey { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /barcode exch def % We are given a barcode string /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textpos -7 def /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def % Create an array containing the character mappings /encs [ (13131313) (31131313) (13311313) (31311313) (13133113) (31133113) (13313113) (31313113) (13131331) (31131331) (13311331) (31311331) (13133131) (31133131) (13313131) (31313131) (31311331) (331311313) ] def % Create a string of the available characters /barchars (0123456789ABCDEF) def /barlen barcode length def % Length of the code /sbs barlen 8 mul 33 add string def /txt barlen 2 add array def /checkbits barlen 4 mul 8 add array def checkbits barlen 4 mul [ 0 0 0 0 0 0 0 0 ] putinterval % Put start character sbs 0 encs 16 get putinterval 0 1 barlen 1 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 8 mul 8 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 16 mul 16 add textpos textfont textsize] put checkbits i 4 mul [ indx 1 and indx -1 bitshift 1 and indx -2 bitshift 1 and indx -3 bitshift ] putinterval } for % Checksum is last 8 bits of a CRC using a salt /checksalt [ 1 1 1 1 0 1 0 0 1 ] def 0 1 barlen 4 mul 1 sub { /i exch def checkbits i get 1 eq { 0 1 8 { /j exch def checkbits i j add checkbits i j add get checksalt j get xor put } for } if } for % Calculate the value of the checksum digits /checkval 0 def 0 1 7 { /i exch def /checkval checkval 2 7 i sub exp cvi checkbits barlen 4 mul i add get mul add def } for % Put the checksum characters /checksum1 checkval -4 bitshift def /checksum2 checkval 15 and def sbs barlen 8 mul 8 add encs checksum1 get putinterval sbs barlen 8 mul 16 add encs checksum2 get putinterval includecheckintext { txt barlen [barchars checksum1 1 getinterval barlen 16 mul 16 add textpos textfont textsize] put txt barlen 1 add [barchars checksum2 1 getinterval barlen 1 add 16 mul 16 add textpos textfont textsize] put } { txt barlen [( ) barlen 16 mul 16 add textpos textfont textsize] put txt barlen 1 add [( ) barlen 1 add 16 mul 16 add textpos textfont textsize] put } ifelse % Put end character sbs barlen 8 mul 24 add encs 17 get putinterval % Return the arguments /retval 1 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval end } bind def /plessey load 0 1 dict put % --END ENCODER plessey-- % --BEGIN ENCODER raw-- % --DESC: Raw bar space succession for custom symbologies % --EXAM: 331132131313411122131311333213114131131221323 /raw { 0 begin % Confine variables to local scope /options exch def % We are given an option string /useropts options def /sbs exch def % We are given a barcode string /height 1 def % Parse the input options options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /height height cvr def % Return the arguments /retval 1 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put retval (opt) useropts put retval end } bind def /raw load 0 1 dict put % --END ENCODER raw-- % --BEGIN ENCODER symbol-- % --DESC: Miscellaneous symbols % --EXAM: fima /symbol { 0 begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string barcode (fima) eq { /sbs [2.25 2.25 2.25 11.25 2.25 11.25 2.25 2.25 2.25] def /bhs [.625 .625 .625 .625 .625] def /bbs [0 0 0 0 0] def } if barcode (fimb) eq { /sbs [2.25 6.75 2.25 2.25 2.25 6.25 2.25 2.25 2.25 6.75 2.25] def /bhs [.625 .625 .625 .625 .625 .625] def /bbs [0 0 0 0 0 0] def } if barcode (fimc) eq { /sbs [2.25 2.25 2.25 6.75 2.25 6.75 2.25 6.75 2.25 2.25 2.25] def /bhs [.625 .625 .625 .625 .625 .625] def /bbs [0 0 0 0 0 0] def } if barcode (fimd) eq { /sbs [2.25 2.25 2.25 2.25 2.25 6.75 2.25 6.75 2.25 2.25 2.25 2.25 2.25] def /bhs [.625 .625 .625 .625 .625 .625 .625] def /bbs [0 0 0 0 0 0 0] def } if % Return the arguments /retval 4 dict def retval (sbs) sbs put retval (bhs) bhs put retval (bbs) bbs put retval (opt) options put retval end } bind def /symbol load 0 1 dict put % --END ENCODER symbol-- % --BEGIN RENDERER-- /barcode { 0 begin % Confine variables to local scope /args exch def % We are given some arguments % Default options /sbs [] def /bhs [] def /bbs [] def /txt [] def /barcolor (unset) def /textcolor (unset) def /bordercolor (unset) def /backgroundcolor (unset) def /inkspread 0.15 def /width 0 def /barratio 1 def /spaceratio 1 def /showborder false def /borderleft 10 def /borderright 10 def /bordertop 1 def /borderbottom 1 def /borderwidth 0.5 def /guardwhitespace false def /guardleftpos 0 def /guardleftypos 0 def /guardrightpos 0 def /guardrightypos 0 def /guardwidth 6 def /guardheight 7 def % Apply the renderer options args {exch cvlit exch def} forall % Parse the user options opt { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /barcolor barcolor cvlit def /textcolor textcolor cvlit def /bordercolor bordercolor cvlit def /backgroundcolor backgroundcolor cvlit def /inkspread inkspread cvr def /width width cvr def /barratio barratio cvr def /spaceratio spaceratio cvr def /borderleft borderleft cvr def /borderright borderright cvr def /bordertop bordertop cvr def /borderbottom borderbottom cvr def /borderwidth borderwidth cvr def /guardleftpos guardleftpos cvr def /guardleftypos guardleftypos cvr def /guardrightpos guardrightpos cvr def /guardrightypos guardrightypos cvr def /guardwidth guardwidth cvr def /guardheight guardheight cvr def % Create bar elements and put them into the bars array /bars sbs length 1 add 2 idiv array def /x 0.00 def /maxh 0 def 0 1 sbs length 1 add 2 idiv 2 mul 2 sub { /i exch def i 2 mod 0 eq { % i is even /d sbs i get barratio mul barratio sub 1 add def % d=digit*r-r+1 /h bhs i 2 idiv get 72 mul def % Height from bhs /c d 2 div x add def % Centre of the bar = x + d/2 /y bbs i 2 idiv get 72 mul def % Baseline from bbs /w d inkspread sub def % bar width = digit - inkspread bars i 2 idiv [h c y w] put % Add the bar entry h maxh gt {/maxh h def} if } { /d sbs i get spaceratio mul spaceratio sub 1 add def % d=digit*r-r+1 } ifelse /x x d add def % x+=d } for gsave currentpoint translate % Force symbol to given width width 0 ne { width 72 mul x div 1 scale } if % Display the border and background newpath borderleft neg borderbottom neg moveto x borderleft add borderright add 0 rlineto 0 maxh borderbottom add bordertop add rlineto x borderleft add borderright add neg 0 rlineto 0 maxh borderbottom add bordertop add neg rlineto closepath backgroundcolor (unset) ne { gsave (< >) dup 1 backgroundcolor putinterval cvx exec {255 div} forall setrgbcolor fill grestore } if showborder { gsave bordercolor (unset) ne { (< >) dup 1 bordercolor putinterval cvx exec {255 div} forall setrgbcolor } if borderwidth setlinewidth stroke grestore } if % Display the bars for elements in the bars array gsave barcolor (unset) ne { (< >) dup 1 barcolor putinterval cvx exec {255 div} forall setrgbcolor } if bars { {} forall newpath setlinewidth moveto 0 exch rlineto stroke } forall grestore % Display the text for elements in the text array textcolor (unset) ne { (< >) dup 1 textcolor putinterval cvx exec {255 div} forall setrgbcolor } if /s 0 def /f () def txt { {} forall 2 copy s ne exch f ne or { 2 copy /s exch def /f exch def exch findfont exch scalefont setfont } { pop pop } ifelse moveto show } forall % Display the guard elements guardwhitespace { 0.75 setlinewidth guardleftpos 0 ne { newpath guardleftpos neg guardwidth add guardleftypos guardwidth 2 div add moveto guardwidth neg guardheight -2 div rlineto guardwidth guardheight -2 div rlineto stroke } if guardrightpos 0 ne { newpath guardrightpos x add guardwidth sub guardrightypos guardheight 2 div add moveto guardwidth guardheight -2 div rlineto guardwidth neg guardheight -2 div rlineto stroke } if } if grestore end } bind def /barcode load 0 1 dict put % --END RENDERER-- % --END TEMPLATE-- %%EndProcSet %%BeginProcSet: 8r.enc % File 8r.enc as of 2002-03-12 for PSNFSS 9 % % This is the encoding vector for Type1 and TrueType fonts to be used % with TeX. This file is part of the PSNFSS bundle, version 9 % % Authors: S. Rahtz, P. MacKay, Alan Jeffrey, B. Horn, K. Berry, W. Schmidt % % Idea is to have all the characters normally included in Type 1 fonts % available for typesetting. This is effectively the characters in Adobe % Standard Encoding + ISO Latin 1 + extra characters from Lucida + Euro. % % Character code assignments were made as follows: % % (1) the Windows ANSI characters are almost all in their Windows ANSI % positions, because some Windows users cannot easily reencode the % fonts, and it makes no difference on other systems. The only Windows % ANSI characters not available are those that make no sense for % typesetting -- rubout (127 decimal), nobreakspace (160), softhyphen % (173). quotesingle and grave are moved just because it's such an % irritation not having them in TeX positions. % % (2) Remaining characters are assigned arbitrarily to the lower part % of the range, avoiding 0, 10 and 13 in case we meet dumb software. % % (3) Y&Y Lucida Bright includes some extra text characters; in the % hopes that other PostScript fonts, perhaps created for public % consumption, will include them, they are included starting at 0x12. % % (4) Remaining positions left undefined are for use in (hopefully) % upward-compatible revisions, if someday more characters are generally % available. % % (5) hyphen appears twice for compatibility with both ASCII and Windows. % % (6) /Euro is assigned to 128, as in Windows ANSI % /TeXBase1Encoding [ % 0x00 (encoded characters from Adobe Standard not in Windows 3.1) /.notdef /dotaccent /fi /fl /fraction /hungarumlaut /Lslash /lslash /ogonek /ring /.notdef /breve /minus /.notdef % These are the only two remaining unencoded characters, so may as % well include them. /Zcaron /zcaron % 0x10 /caron /dotlessi % (unusual TeX characters available in, e.g., Lucida Bright) /dotlessj /ff /ffi /ffl /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef % very contentious; it's so painful not having quoteleft and quoteright % at 96 and 145 that we move the things normally found there down to here. /grave /quotesingle % 0x20 (ASCII begins) /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash % 0x30 /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question % 0x40 /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O % 0x50 /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore % 0x60 /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o % 0x70 /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef % rubout; ASCII ends % 0x80 /Euro /.notdef /quotesinglbase /florin /quotedblbase /ellipsis /dagger /daggerdbl /circumflex /perthousand /Scaron /guilsinglleft /OE /.notdef /.notdef /.notdef % 0x90 /.notdef /.notdef /.notdef /quotedblleft /quotedblright /bullet /endash /emdash /tilde /trademark /scaron /guilsinglright /oe /.notdef /.notdef /Ydieresis % 0xA0 /.notdef % nobreakspace /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen % Y&Y (also at 45); Windows' softhyphen /registered /macron % 0xD0 /degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown % 0xC0 /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis % 0xD0 /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls % 0xE0 /agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis % 0xF0 /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis ] def %%EndProcSet %%BeginProcSet: aae443f0.enc % Thomas Esser, Dec 2002. public domain % % Encoding for: % cmmi10 cmmi12 cmmi5 cmmi6 cmmi7 cmmi8 cmmi9 cmmib10 % /TeXaae443f0Encoding [ /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /Omega /alpha /beta /gamma /delta /epsilon1 /zeta /eta /theta /iota /kappa /lambda /mu /nu /xi /pi /rho /sigma /tau /upsilon /phi /chi /psi /omega /epsilon /theta1 /pi1 /rho1 /sigma1 /phi1 /arrowlefttophalf /arrowleftbothalf /arrowrighttophalf /arrowrightbothalf /arrowhookleft /arrowhookright /triangleright /triangleleft /zerooldstyle /oneoldstyle /twooldstyle /threeoldstyle /fouroldstyle /fiveoldstyle /sixoldstyle /sevenoldstyle /eightoldstyle /nineoldstyle /period /comma /less /slash /greater /star /partialdiff /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /flat /natural /sharp /slurbelow /slurabove /lscript /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /dotlessi /dotlessj /weierstrass /vector /tie /psi /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /.notdef /.notdef /Omega /alpha /beta /gamma /delta /epsilon1 /zeta /eta /theta /iota /kappa /lambda /mu /nu /xi /pi /rho /sigma /tau /upsilon /phi /chi /psi /tie /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef ] def %%EndProcSet %%BeginProcSet: bbad153f.enc % Thomas Esser, Dec 2002. public domain % % Encoding for: % cmsy10 cmsy5 cmsy6 cmsy7 cmsy8 cmsy9 % /TeXbbad153fEncoding [ /minus /periodcentered /multiply /asteriskmath /divide /diamondmath /plusminus /minusplus /circleplus /circleminus /circlemultiply /circledivide /circledot /circlecopyrt /openbullet /bullet /equivasymptotic /equivalence /reflexsubset /reflexsuperset /lessequal /greaterequal /precedesequal /followsequal /similar /approxequal /propersubset /propersuperset /lessmuch /greatermuch /precedes /follows /arrowleft /arrowright /arrowup /arrowdown /arrowboth /arrownortheast /arrowsoutheast /similarequal /arrowdblleft /arrowdblright /arrowdblup /arrowdbldown /arrowdblboth /arrownorthwest /arrowsouthwest /proportional /prime /infinity /element /owner /triangle /triangleinv /negationslash /mapsto /universal /existential /logicalnot /emptyset /Rfractur /Ifractur /latticetop /perpendicular /aleph /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /union /intersection /unionmulti /logicaland /logicalor /turnstileleft /turnstileright /floorleft /floorright /ceilingleft /ceilingright /braceleft /braceright /angbracketleft /angbracketright /bar /bardbl /arrowbothv /arrowdblbothv /backslash /wreathproduct /radical /coproduct /nabla /integral /unionsq /intersectionsq /subsetsqequal /supersetsqequal /section /dagger /daggerdbl /paragraph /club /diamond /heart /spade /arrowleft /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /minus /periodcentered /multiply /asteriskmath /divide /diamondmath /plusminus /minusplus /circleplus /circleminus /.notdef /.notdef /circlemultiply /circledivide /circledot /circlecopyrt /openbullet /bullet /equivasymptotic /equivalence /reflexsubset /reflexsuperset /lessequal /greaterequal /precedesequal /followsequal /similar /approxequal /propersubset /propersuperset /lessmuch /greatermuch /precedes /follows /arrowleft /spade /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef ] def %%EndProcSet %%BeginProcSet: texps.pro %! TeXDict begin/rf{findfont dup length 1 add dict begin{1 index/FID ne 2 index/UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]FontType 0 ne{/Metrics exch def dict begin Encoding{exch dup type/integertype ne{ pop pop 1 sub dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div def}ifelse}forall Metrics/Metrics currentdict end def}{{1 index type /nametype eq{exit}if exch pop}loop}ifelse[2 index currentdict end definefont 3 -1 roll makefont/setfont cvx]cvx def}def/ObliqueSlant{dup sin S cos div neg}B/SlantFont{4 index mul add}def/ExtendFont{3 -1 roll mul exch}def/ReEncodeFont{CharStrings rcheck{/Encoding false def dup[ exch{dup CharStrings exch known not{pop/.notdef/Encoding true def}if} forall Encoding{]exch pop}{cleartomark}ifelse}if/Encoding exch def}def end %%EndProcSet %%BeginProcSet: special.pro %! TeXDict begin/SDict 200 dict N SDict begin/@SpecialDefaults{/hs 612 N /vs 792 N/ho 0 N/vo 0 N/hsc 1 N/vsc 1 N/ang 0 N/CLIP 0 N/rwiSeen false N /rhiSeen false N/letter{}N/note{}N/a4{}N/legal{}N}B/@scaleunit 100 N /@hscale{@scaleunit div/hsc X}B/@vscale{@scaleunit div/vsc X}B/@hsize{ /hs X/CLIP 1 N}B/@vsize{/vs X/CLIP 1 N}B/@clip{/CLIP 2 N}B/@hoffset{/ho X}B/@voffset{/vo X}B/@angle{/ang X}B/@rwi{10 div/rwi X/rwiSeen true N}B /@rhi{10 div/rhi X/rhiSeen true N}B/@llx{/llx X}B/@lly{/lly X}B/@urx{ /urx X}B/@ury{/ury X}B/magscale true def end/@MacSetUp{userdict/md known {userdict/md get type/dicttype eq{userdict begin md length 10 add md maxlength ge{/md md dup length 20 add dict copy def}if end md begin /letter{}N/note{}N/legal{}N/od{txpose 1 0 mtx defaultmatrix dtransform S atan/pa X newpath clippath mark{transform{itransform moveto}}{transform{ itransform lineto}}{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}}{{closepath}}pathforall newpath counttomark array astore/gc xdf pop ct 39 0 put 10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack} if}N/txpose{pxs pys scale ppr aload pop por{noflips{pop S neg S TR pop 1 -1 scale}if xflip yflip and{pop S neg S TR 180 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not and{pop S neg S TR pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip not and{ppr 1 get neg ppr 0 get neg TR}if}{ noflips{TR pop pop 270 rotate 1 -1 scale}if xflip yflip and{TR pop pop 90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not and{TR pop pop 90 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip not and{TR pop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 S TR}if}ifelse scaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy TR .96 dup scale neg S neg S TR}if}N/cp{pop pop showpage pm restore}N end}if}if}N/normalscale{ Resolution 72 div VResolution 72 div neg scale magscale{DVImag dup scale }if 0 setgray}N/psfts{S 65781.76 div N}N/startTexFig{/psf$SavedState save N userdict maxlength dict begin/magscale true def normalscale currentpoint TR/psf$ury psfts/psf$urx psfts/psf$lly psfts/psf$llx psfts /psf$y psfts/psf$x psfts currentpoint/psf$cy X/psf$cx X/psf$sx psf$x psf$urx psf$llx sub div N/psf$sy psf$y psf$ury psf$lly sub div N psf$sx psf$sy scale psf$cx psf$sx div psf$llx sub psf$cy psf$sy div psf$ury sub TR/showpage{}N/erasepage{}N/setpagedevice{pop}N/copypage{}N/p 3 def @MacSetUp}N/doclip{psf$llx psf$lly psf$urx psf$ury currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll S lineto S lineto S lineto closepath clip newpath moveto}N/endTexFig{end psf$SavedState restore}N /@beginspecial{SDict begin/SpecialSave save N gsave normalscale currentpoint TR @SpecialDefaults count/ocount X/dcount countdictstack N} N/@setspecial{CLIP 1 eq{newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto closepath clip}if ho vo TR hsc vsc scale ang rotate rwiSeen{rwi urx llx sub div rhiSeen{rhi ury lly sub div}{dup}ifelse scale llx neg lly neg TR}{rhiSeen{rhi ury lly sub div dup scale llx neg lly neg TR}if}ifelse CLIP 2 eq{newpath llx lly moveto urx lly lineto urx ury lineto llx ury lineto closepath clip}if/showpage{}N/erasepage{}N /setpagedevice{pop}N/copypage{}N newpath}N/@endspecial{count ocount sub{ pop}repeat countdictstack dcount sub{end}repeat grestore SpecialSave restore end}N/@defspecial{SDict begin}N/@fedspecial{end}B/li{lineto}B /rl{rlineto}B/rc{rcurveto}B/np{/SaveX currentpoint/SaveY X N 1 setlinecap newpath}N/st{stroke SaveX SaveY moveto}N/fil{fill SaveX SaveY moveto}N/ellipse{/endangle X/startangle X/yrad X/xrad X/savematrix matrix currentmatrix N TR xrad yrad scale 0 0 1 startangle endangle arc savematrix setmatrix}N end %%EndProcSet %%BeginFont: CMSY10 %!PS-AdobeFont-1.1: CMSY10 1.0 %%CreationDate: 1991 Aug 15 07:20:57 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.0) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMSY10) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle -14.035 def /isFixedPitch false def end readonly def /FontName /CMSY10 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-29 -960 1116 775}readonly def /UniqueID 5000820 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA052F09F9C8ADE9D907C058B87E9B6964 7D53359E51216774A4EAA1E2B58EC3176BD1184A633B951372B4198D4E8C5EF4 A213ACB58AA0A658908035BF2ED8531779838A960DFE2B27EA49C37156989C85 E21B3ABF72E39A89232CD9F4237FC80C9E64E8425AA3BEF7DED60B122A52922A 221A37D9A807DD01161779DDE7D31FF2B87F97C73D63EECDDA4C49501773468A 27D1663E0B62F461F6E40A5D6676D1D12B51E641C1D4E8E2771864FC104F8CBF 5B78EC1D88228725F1C453A678F58A7E1B7BD7CA700717D288EB8DA1F57C4F09 0ABF1D42C5DDD0C384C7E22F8F8047BE1D4C1CC8E33368FB1AC82B4E96146730 DE3302B2E6B819CB6AE455B1AF3187FFE8071AA57EF8A6616B9CB7941D44EC7A 71A7BB3DF755178D7D2E4BB69859EFA4BBC30BD6BB1531133FD4D9438FF99F09 4ECC068A324D75B5F696B8688EEB2F17E5ED34CCD6D047A4E3806D000C199D7C 515DB70A8D4F6146FE068DC1E5DE8BC5703711DA090312BA3FC00A08C453C609 C627A8BFEF75B4DEFAF34B44B356A516B765AFCDD3F5475B1F928731D09D2170 B97E40F12CCEDF4F6BB3756C4734F6E98D74B7E942A954B1BAAB83D4AD727FF6 DF6DC50B2223BCB5568A73A112E4860AD490554E64E780073FF3399CB4688D33 9E8829667CD6EAEF25E0C7D2D44F2BBFA40E999325F9561514844221B50BC8FC 4C7AD68CA7220D69125C2AF06849A3E068D18733276F0C0A6A2936D3C2C87CDE 59CD1AF148C44F85784A5DAD569F5FF53C061056C067CE29AEF1E3BD1FD8B0B8 71A0A638CDAC6AEEDBD5337D4683C084BB60B1859E600F59CB4E19C5FC5C6327 EC544A68134496A9BD0B87D83AF6FDA3CB62FBF0B54FACE1F0E6A2D84B467AFF 0F62DB 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont %%BeginFont: CMMI10 %!PS-AdobeFont-1.1: CMMI10 1.100 %%CreationDate: 1996 Jul 23 07:53:57 % Copyright (C) 1997 American Mathematical Society. All Rights Reserved. 11 dict begin /FontInfo 7 dict dup begin /version (1.100) readonly def /Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def /FullName (CMMI10) readonly def /FamilyName (Computer Modern) readonly def /Weight (Medium) readonly def /ItalicAngle -14.04 def /isFixedPitch false def end readonly def /FontName /CMMI10 def /PaintType 0 def /FontType 1 def /FontMatrix [0.001 0 0 0.001 0 0] readonly def /Encoding 256 array 0 1 255 {1 index exch /.notdef put} for dup 0 /.notdef put readonly def /FontBBox{-32 -250 1048 750}readonly def /UniqueID 5087385 def currentdict end currentfile eexec D9D66F633B846A97B686A97E45A3D0AA0529731C99A784CCBE85B4993B2EEBDE 3B12D472B7CF54651EF21185116A69AB1096ED4BAD2F646635E019B6417CC77B 532F85D811C70D1429A19A5307EF63EB5C5E02C89FC6C20F6D9D89E7D91FE470 B72BEFDA23F5DF76BE05AF4CE93137A219ED8A04A9D7D6FDF37E6B7FCDE0D90B 986423E5960A5D9FBB4C956556E8DF90CBFAEC476FA36FD9A5C8175C9AF513FE D919C2DDD26BDC0D99398B9F4D03D5993DFC0930297866E1CD0A319B6B1FD958 9E394A533A081C36D456A09920001A3D2199583EB9B84B4DEE08E3D12939E321 990CD249827D9648574955F61BAAA11263A91B6C3D47A5190165B0C25ABF6D3E 6EC187E4B05182126BB0D0323D943170B795255260F9FD25F2248D04F45DFBFB DEF7FF8B19BFEF637B210018AE02572B389B3F76282BEB29CC301905D388C721 59616893E774413F48DE0B408BC66DCE3FE17CB9F84D205839D58014D6A88823 D9320AE93AF96D97A02C4D5A2BB2B8C7925C4578003959C46E3CE1A2F0EAC4BF 8B9B325E46435BDE60BC54D72BC8ACB5C0A34413AC87045DC7B84646A324B808 6FD8E34217213E131C3B1510415CE45420688ED9C1D27890EC68BD7C1235FAF9 1DAB3A369DD2FC3BE5CF9655C7B7EDA7361D7E05E5831B6B8E2EEC542A7B38EE 03BE4BAC6079D038ACB3C7C916279764547C2D51976BABA94BA9866D79F13909 95AA39B0F03103A07CBDF441B8C5669F729020AF284B7FF52A29C6255FCAACF1 74109050FBA2602E72593FBCBFC26E726EE4AEF97B7632BC4F5F353B5C67FED2 3EA752A4A57B8F7FEFF1D7341D895F0A3A0BE1D8E3391970457A967EFF84F6D8 47750B1145B8CC5BD96EE7AA99DDC9E06939E383BDA41175233D58AD263EBF19 AFC0E2F840512D321166547B306C592B8A01E1FA2564B9A26DAC14256414E4C8 42616728D918C74D13C349F4186EC7B9708B86467425A6FDB3A396562F7EE4D8 40B43621744CF8A23A6E532649B66C2A0002DD04F8F39618E4F572819DD34837 B5A08E643FDCA1505AF6A1FA3DDFD1FA758013CAED8ACDDBBB334D664DFF5B53 95601766777978D01677B8D19E1B10A078432D2884BB4F7B8C3293B68BB78100 16724E495064BA0168CC86D413CB48560D6D318357397832F7A858CD82030C7D 8A4A1919716E8B26AFF8789AAF489EE4E0A88DC477551A87C7DF2856189E4596 FE015956AFE5CC019F5CA6323A12B763B7B08B92C1A2940D3C566C43729E5482 63C6DC5E834AEB4DAFB5AE8F0B8931A4687C94D11587B9071C8D81DA14F12776 53A1985A3EBE37827656BD4635E03F09C3231F906874645E7DB3E59045A59D67 E745D8487CF73FC50F64060544F624F357BC998A87FBE468DEBB38A09449EBCA D041D7C29225ACD16CB8A59E87924D15A9125F064710A6CCCA3AD3103D8FCC94 CC3571C6F9192774FCFE5BB42A14B27960903144D28BF047BF4C77646EA7BF6F 440D4EDEB712C63F2E8080419E42D1D58EED685EB5CDD49F80DB6E5553B519FA C6A39A093155802F3EC607721F390307E91ECB597ABA60A537E3F8C045BF5DD3 D88CF6518D37FCD95D2F295D902D617440D23516D962F47750A682A319ACE1 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 cleartomark %%EndFont TeXDict begin 39158280 55380996 1000 600 600 (barcodewriter.dvi) @start /Fa 242[83 13[{ TeXbbad153fEncoding ReEncodeFont }1 83.022 /CMSY10 rf /Fb 136[55 2[23 4[42 1[60 23 2[23 42 42 23 37 42 1[42 52[28 45[{ TeXBase1Encoding ReEncodeFont }13 83.022 /Times-Italic rf /Fc 134[33 1[48 33 33 18 26 22 1[33 33 33 52 18 33 1[18 33 33 22 29 33 29 33 29 12[41 37 2[37 3[41 8[44 44 19[17 1[17 2[22 22 40[{ TeXBase1Encoding ReEncodeFont }32 66.4176 /Times-Roman rf /Fd 205[25 25 49[{ TeXBase1Encoding ReEncodeFont }2 49.8132 /Times-Roman rf /Fe 133[44 50 2[50 55 33 39 44 55 55 50 55 83 28 2[28 55 50 33 44 55 44 55 50 10[72 72 66 55 72 1[61 1[72 94 66 2[39 78 78 61 66 72 72 66 72 7[50 50 50 50 50 50 50 50 50 50 28 25 33 5[33 36[55 2[{ TeXBase1Encoding ReEncodeFont }55 99.6264 /Times-Bold rf /Ff 119[42 10[42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 1[42 1[42 42 42 42 3[42 42 42 42 42 1[42 42 42 42 42 42 1[42 42 42 42 42 42 42 42 42 42 1[42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 1[42 42 42 42 42 33[{ .85 ExtendFont TeXBase1Encoding ReEncodeFont }85 83.022 /Courier rf /Fh 190[44 14[31 31 49[{ TeXBase1Encoding ReEncodeFont }3 61.4362 /Times-Roman rf /Fi 134[42 42 2[46 28 32 37 1[46 42 46 69 23 2[23 46 42 1[37 46 37 46 42 9[83 2[55 46 60 2[65 60 1[55 65 1[32 3[55 60 60 55 8[42 3[42 42 42 42 42 3[28 45[{ TeXBase1Encoding ReEncodeFont }39 83.022 /Times-Bold rf /Fj 134[60 60 86 1[66 40 47 53 1[66 60 66 100 33 66 1[33 1[60 1[53 66 53 66 60 13[66 86 5[80 2[47 3[80 1[86 1[86 11[60 60 60 60 60 49[{ TeXBase1Encoding ReEncodeFont }32 119.552 /Times-Bold rf /Fk 32[42 74[37 25[37 42 42 60 42 42 23 32 28 42 42 42 42 65 23 42 23 23 42 42 28 37 42 37 42 37 7[60 60 78 60 60 51 46 55 1[46 60 60 74 51 60 32 28 60 60 46 51 60 55 55 60 6[23 42 42 42 42 42 42 42 42 42 42 23 21 28 21 2[28 28 28 22[28 12[46 46 2[{ TeXBase1Encoding ReEncodeFont }73 83.022 /Times-Roman rf /Fl 134[37 37 54 37 37 21 29 25 1[37 37 37 58 21 1[21 21 37 37 25 33 37 33 37 33 9[71 2[46 3[42 13[50 19[19 25 19 44[{ TeXBase1Encoding ReEncodeFont }30 74.7198 /Times-Roman rf /Fm 139[25 29 33 14[33 42 37 31[54 65[{ TeXBase1Encoding ReEncodeFont }7 74.7198 /Times-Bold rf /Fn 193[77 1[77 60[{ TeXaae443f0Encoding ReEncodeFont }2 99.6264 /CMMI10 rf /Fp 133[44 50 3[50 28 1[33 2[50 50 2[50 5[44 1[44 50 13[61 4[72 12[66 1[92 9[50 3[50 50 50 1[25 1[25 44[{ TeXBase1Encoding ReEncodeFont }21 99.6264 /Times-Roman rf /Fq 138[72 40 56 48 1[72 72 72 4[40 3[64 72 64 1[64 9[135 6[80 13[96 66[{ TeXBase1Encoding ReEncodeFont }15 143.462 /Times-Roman rf end %%EndProlog %%BeginSetup %%Feature: *Resolution 600dpi TeXDict begin %%PaperSize: A4 end %%EndSetup %%Page: 1 1 TeXDict begin 1 0 bop 979 872 a Fq(Barcode)34 b(Writer)h(in)g(Pure)g (Postscript)1150 1160 y Fp(T)-7 b(erry)25 b(Burton)g Fn(<)p Fp(tez@terryb)n(urton.co.uk)p Fn(>)1600 1401 y Fp(October)f(21,)h(2006)1808 1706 y Fm(Abstract)834 1857 y Fl(This)j(document)i(describes)e(the)h(implementation)g(of)f(the)g (Barcode)h(Writer)d(in)i(Pure)722 1948 y(Postscript)21 b(project,)g(e)o(xplains)g(by)g(e)o(xample)h(ho)n(w)f(to)g(use)g(this)g (to)f(generate)i(your)f(o)n(wn)h(bar)o(-)722 2039 y(codes,)e(and)f(pro) o(vides)h(a)f(simple)g(reference)h(to)e(using)i(the)f(symbologies)h (that)f(it)f(supports.)515 2236 y Fk(Note:)24 b(Despite)17 b(the)g(date)h(on)e(this)i(document,)e(the)h(information)e(contained)h (herein)g(is)i(some)n(what)515 2336 y(out)25 b(of)h(date.)43 b(A)26 b(much)f(more)h(thorough)d(and)i(up-to-date)f(reference)h(to)h (this)h(project)e(is)i(a)n(v)n(ail-)515 2435 y(able)19 b(in)h(the)g(wiki,)f(http://www)-5 b(.terryb)n(urton.co.uk/b)o(arco)o (de)m(writer/wik)o(i/)f(.)26 b(This)20 b(wiki)f(pro)o(vides)515 2535 y(a)29 b(collaborati)n(v)o(e)d(approach)h(to)i(documentation)d (that)i(allo)n(ws)i(users)e(to)h(add)g(and)f(edit)h(content)515 2635 y(collecti)n(v)o(ely)-5 b(.)1935 5255 y(i)p eop end %%Page: 2 2 TeXDict begin 2 1 bop 515 523 a Fj(Contents)515 756 y Fi(1)82 b(Intr)o(oduction)2246 b(1)515 986 y(2)82 b(Code)20 b(Commentary)2021 b(2)639 1133 y Fk(2.1)86 b(The)20 b(Barcode)f(Data)i (Structure)f(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h (.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)165 b(2)639 1279 y(2.2)86 b(An)20 b(Encoder)52 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h (.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) g(.)h(.)165 b(3)639 1426 y(2.3)86 b(The)20 b(Renderer)59 b(.)41 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)165 b(5)639 1573 y(2.4)86 b(Notes)21 b(Re)o(garding)d(Coding)h(Style)59 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.) f(.)g(.)g(.)h(.)165 b(8)515 1803 y Fi(3)82 b(Resour)o(ces)20 b(and)h(Examples)1818 b(9)639 1950 y Fk(3.1)86 b(Language)18 b(Speci\002c)j(APIs)i(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)165 b(9)639 2097 y(3.2)86 b(Front)20 b(Ends)i(.)42 b(.)f(.)g(.)g(.)h(.)f(.) g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f (.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)165 b(9)639 2244 y(3.3)86 b(Installing)30 b(the)i(Barcode)e(Generation)f(Capability)i(into)g(a)g (Printer')-5 b(s)31 b(V)-5 b(irtual)830 2343 y(Machine)36 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.) h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(10)639 2490 y(3.4)86 b(Hints)21 b(for)e(Generating)g(Precisely)h(the) g(Required)f(Symbol)h(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(11)639 2637 y(3.5)86 b(Printing)20 b(in)g(Perl)69 b(.)41 b(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f (.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(12)515 2867 y Fi(4)82 b(Supported)21 b(Symbologies)1818 b(13)639 3014 y Fk(4.1)86 b(EAN-13)45 b(.)c(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f (.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.) h(.)f(.)g(.)g(.)h(.)124 b(13)639 3161 y(4.2)86 b(EAN-8)25 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(13)639 3308 y(4.3)86 b(UPC-A)79 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g (.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.) g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(14)639 3454 y(4.4)86 b(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g(.)g(.)h (.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(17)639 4483 y(4.11)44 b(Interlea)n(v)o(ed)18 b(2)j(of)f(5)g(and)g(ITF-14)29 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.) h(.)f(.)g(.)g(.)h(.)124 b(18)639 4629 y(4.12)44 b(Code)20 b(2)h(of)e(5)63 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.) g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h (.)124 b(18)639 4776 y(4.13)44 b(Postnet)21 b(.)41 b(.)g(.)h(.)f(.)g(.) g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f (.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(19)639 4923 y(4.14)44 b(Ro)o(yal)20 b(Mail)78 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)h (.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.) g(.)h(.)f(.)g(.)g(.)h(.)124 b(19)1924 5255 y(ii)p eop end %%Page: 3 3 TeXDict begin 3 2 bop 639 523 a Fk(4.15)44 b(MSI)56 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g (.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(20)639 670 y(4.16)44 b(Plesse)o(y)80 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f (.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.) f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(20)515 900 y Fi(5)82 b(License)2390 b(21)1912 5255 y Fk(iii)p eop end %%Page: 1 4 TeXDict begin 1 3 bop 515 523 a Fj(1)119 b(Intr)n(oduction)515 756 y Fk(Barcode)20 b(Writer)h(in)g(Pure)g(Postscript)g(is)h(an)f(a)o (w)o(ard-winning)d(open)i(source)g(barcode)f(mak)o(er)m(,)h(as)515 855 y(used)j(by)h(N)m(ASA,)g(that)g(f)o(acilitates)g(the)g(printing)e (of)i(all)g(major)f(barcode)f(symbologies)g(entirely)515 955 y(within)29 b(le)n(v)o(el)h(2)g(PostScript,)i(ideal)e(for)f(v)n (ariable)g(data)h(printing.)53 b(The)29 b(complete)g(process)h(of)515 1055 y(generating)15 b(printed)g(barcodes)g(is)j(performed)c(entirely)i (within)h(the)g(printer)e(\(or)h(print)h(system\))f(so)515 1154 y(that)22 b(it)g(is)h(no)f(longer)e(the)i(responsibility)f(of)g (your)g(application)f(or)i(a)g(library)-5 b(.)29 b(There)21 b(is)i(no)e(need)515 1254 y(for)27 b(an)o(y)h(barcode)e(fonts)i(and)g (the)g(\003e)o(xibility)f(of)n(fered)g(by)h(direct)f(PostScript)i (means)e(you)h(can)515 1354 y(a)n(v)n(oid)16 b(re-implementing)d (barcode)i(generator)f(code,)j(or)f(migrating)e(to)j(ne)n(w)f (libraries,)h(whene)n(v)o(er)515 1453 y(your)i(project)g(language)f (needs)i(change.)515 1600 y(T)-7 b(o)35 b(mak)o(e)f(it)i(as)f(easy)g (as)h(possible)f(to)g(incorporate)d(this)k(project)e(into)g(your)g(o)n (wn)g(systems,)515 1700 y(whether)e(the)o(y)h(be)h(freely)e(a)n(v)n (ailable)i(or)f(proprietary)-5 b(,)34 b(it)g(is)h(licensed)e(under)f (the)i(permissi)n(v)o(e)515 1799 y(MIT/X-Consortium)17 b(License)j(gi)n(v)o(en)f(in)i(section)f(5.)515 1946 y(The)g(project)f(homepage)f(is)j(at)g(http://www)-5 b(.terryb)n(urton.co.uk)o(/bar)o(cod)o(e)n(wr)o(iter)g(.)515 2093 y(This)27 b(is)g(the)g(main)f(resource)g(for)g(the)h(project)f (pro)o(viding)d(the)k(latest)h(do)n(wnloads)d(of)h(code)g(and)515 2193 y(documentation,)17 b(as)k(well)f(as)h(access)g(to)f(the)h (support)d(and)i(de)n(v)o(elopment)d(mailing)j(list.)515 2520 y Fj(Ackno)o(wledgements)515 2753 y Fk(The)28 b(author)g(wishes)h (to)g(tak)o(e)g(this)h(opportunity)c(to)j(thank)f(the)h(gro)n(wing)e (community)f(of)j(v)n(ol-)515 2853 y(unteers)d(that)g(ha)n(v)o(e)g (helped)f(to)i(de)n(v)o(elop,)f(test)h(and)f(document)e(this)j (project.)43 b(Most)27 b(especially)515 2952 y(Michael)e(Landers)g(and) h(Ross)g(McF)o(arland)f(for)g(freely)g(donating)f(their)i(encoder)e (implementa-)515 3052 y(tions)c(early)g(in)g(the)g(life)h(of)f(the)g (project.)515 3199 y(Also,)d(special)g(appreciation)e(is)j(e)o(xtended) c(to)j(the)g(de)n(v)o(elopers)e(that)i(ha)n(v)o(e)f(created)g(the)h (front-ends)515 3298 y(necessary)f(to)i(mak)o(e)f(the)g(code)g(v)n (aluable)f(to)i(ordinary)d(computer)g(users,)j(especially)f(Petr)h(V)-9 b(an)5 b(\020)-33 b(ek,)515 3398 y(Dominik)19 b(Seichter)h(and)f (Herbert)g(V)-11 b(o\337.)1926 5255 y(1)p eop end %%Page: 2 5 TeXDict begin 2 4 bop 515 523 a Fj(2)119 b(Code)31 b(Commentary)515 756 y Fk(This)20 b(commentary)e(assumes)i(f)o(amiliarity)g(with)g(the)g (PostScript)g(language)2741 726 y Fh(1)2774 756 y Fk(.)515 903 y(The)g(code)f(is)i(split)g(cleanly)f(into)f(tw)o(o)i(types)f(of)g (procedure:)515 1133 y Fi(The)h(encoders)41 b Fk(Each)19 b(of)h(these)g(represents)f(a)i(barcode)d(symbology)2566 1102 y Fh(2)2598 1133 y Fk(,)i(e.g.)25 b(EAN-13)18 b(or)i(Code-)722 1232 y(128.)k(It)c(tak)o(es)g(a)g(string)f(containing)f(the)i(barcode)e (data)h(and)g(a)h(string)f(containing)f(a)i(list)h(of)722 1332 y(options)e(that)g(modify)e(the)j(output)e(of)h(the)g(encoder)-5 b(.)23 b(It)d(generates)e(a)h(structured)f(represen-)722 1431 y(tation)j(of)g(the)g(barcode)e(and)i(its)h(te)o(xt)f(for)f(the)h (symbology)-5 b(,)19 b(including)g(the)i(calculation)f(of)722 1531 y(check)g(digits)g(where)g(necessary)-5 b(.)515 1697 y Fi(The)21 b(r)o(ender)o(er)40 b Fk(This)24 b(tak)o(es)h(the)g (output)e(of)h(an)g(encoder)f(and)h(generates)f(a)i(visual)f (representa-)722 1797 y(tion)c(of)g(the)g(barcode.)515 2027 y(This)g(means)g(that)g(all)h(barcodes)e(can)h(be)g(generated)e (simply)i(in)h(a)f(similar)h(manner:)515 2257 y Ff(\(78858101497\))47 b(\(includetext)f(height=0.6\))g(upca)e(barcode)515 2356 y(\(0123456789\))i(\(includecheck\))h(interleaved2of5)h(barcode)515 2641 y Fe(2.1)99 b(The)26 b(Bar)n(code)g(Data)f(Structur)n(e)515 2844 y Fk(The)c(follo)n(wing)g(table)h(describes)f(the)h(structured)f (representation)e(of)j(a)g(barcode)f(that)h(is)h(passed)515 2944 y(by)d(an)g(encoder)e(to)j(the)f(renderer)e(as)j(a)g(dictionary)d (when)i(the)g(PostScript)g(is)h(e)o(x)o(ecuted.)650 3170 y(Element)p 1422 3200 4 100 v 546 w(K)n(e)o(y)p 1657 3200 V 98 w(V)-9 b(alue)p 600 3203 2694 4 v 650 3273 a(Space)20 b(bar)g(succession)p 1422 3402 4 200 v 126 w Ff(sbs)p 1657 3402 V 104 w Fk(Array)f(containing)e(the)i(widths,)g (in)g(points,)g(of)g(each)1708 3372 y(bar)h(and)g(space,)g(starting)f (with)i(the)f(leftmost)g(bar)-5 b(.)650 3472 y(Bar)21 b(height)e(succession)p 1422 3602 V 103 w Ff(bhs)p 1657 3602 V 104 w Fk(Array)40 b(containing)f(the)i(height)f(of)h(each)g(bar) f(in)1708 3572 y(inches,)20 b(starting)g(with)g(the)g(leftmost)g(bar)-5 b(.)650 3671 y(Bar)21 b(base)f(succession)p 1422 3801 V 163 w Ff(bbs)p 1657 3801 V 104 w Fk(Array)f(containing)f(the)i(of)n (fset)g(of)f(the)h(base)g(of)g(each)1708 3771 y(bar)g(in)g(inches,)g (starting)g(with)g(the)g(leftmost)g(bar)-5 b(.)650 3871 y(Human)19 b(readable)g(te)o(xt)p 1422 4199 4 399 v 137 w Ff(txt)p 1657 4199 V 104 w Fk(Array)k(of)g(arrays)f(that)h(contain)g (the)g(character)m(,)f(po-)1708 3970 y(sition,)f(height,)f(font)g(and)h (scale)g(f)o(actor)f(\(font)g(size\),)1708 4070 y(in)29 b(points,)i(for)d(each)h(of)g(the)g(visible)g(te)o(xt)f(charac-)1708 4169 y(ters.)650 4269 y(Renderer)19 b(options)p 1422 4399 4 200 v 257 w Ff(opt)p 1657 4399 V 104 w Fk(String)d(containing)f (the)h(user)n(-de\002ned)f(renderer)f(op-)1708 4369 y(tions.)515 4594 y(Other)24 b(k)o(e)o(ys)h(and)f(v)n(alues)h(may)g(be)g(contained)e (in)i(this)h(structure)e(that)h(o)o(v)o(erride)d(the)j(render)f(de-)515 4693 y(f)o(aults)c(with)g(encoder)f(speci\002c)h(def)o(aults.)p 515 4765 1146 4 v 605 4820 a Fd(1)634 4844 y Fc(The)14 b(PostScript)h(Language)f(T)m(utorial)h(and)f(Cookbook)h(\(a.k.a.)k (the)c(Blue)f(Book\),)g(which)h(is)e(freely)i(a)o(v)n(ailable)h (online,)515 4923 y(serv)o(es)h(as)g(both)h(a)f(useful)h(tutorial)h (and)f(reference)i(manual)e(to)f(the)h(language.)605 4981 y Fd(2)634 5005 y Fc(By)f(symbology)h(we)f(mean)h(an)f(accepted)j (standard)f(for)e(representation)k(of)16 b(data)j(as)e(a)g(barcode)1926 5255 y Fk(2)p eop end %%Page: 3 6 TeXDict begin 3 5 bop 515 523 a Fe(2.2)99 b(An)25 b(Encoder)515 726 y Fk(The)j(procedure)e(labelled)i(code2of5)e(is)k(a)f(simple)f(e)o (xample)f(of)i(an)f(encoder)m(,)h(which)f(we)h(will)515 826 y(no)n(w)19 b(consider)-5 b(.)24 b(Its)d(purpose)d(is)j(to)f (accept)f(as)i(input)e(a)h(string)f(containing)f(the)i(barcode)e (contents)515 925 y(and)23 b(a)i(string)e(containing)f(a)j(list)g(of)f (options,)f(and)h(to)g(process)g(these)g(in)g(a)g(w)o(ay)g(that)g(is)h (speci\002c)515 1025 y(to)k(this)h(encoder)m(,)f(and)g(\002nally)g(to)g (output)f(an)h(instance)g(of)g(the)g(dictionary-based)d(data)j(struc-) 515 1124 y(ture)e(described)f(in)h(section)g(2.1)g(that)g(represents)g (the)g(barcode)f(contents)g(in)i(the)f(Code)g(2)g(of)g(5)515 1224 y(symbology)-5 b(.)515 1371 y(As)17 b(with)g(all)g(of)f(the)g (encoders,)g(the)g(input)g(string)g(is)h(assumed)f(to)h(be)f(v)n(alid)g (for)g(the)g(corresponding)515 1471 y(symbology)-5 b(,)17 b(otherwise)i(the)i(beha)n(viour)d(is)j(unde\002ned.)515 1617 y(The)d(v)n(ariables)h(that)g(we)g(use)g(in)g(this)h(procedure)c (are)j(con\002ned)f(to)h(local)g(scope)f(by)h(declaring)f(the)515 1717 y(procedure)f(as)k(follo)n(ws:)515 1933 y Ff(/code2of5)45 b({)726 2132 y(0)e(begin)515 2332 y(...)726 2531 y(end)515 2730 y(})f(bind)i(def)515 2830 y(/code2of5)h(load)f(0)f(1)f(dict)i(put) 515 3046 y Fk(W)-7 b(e)27 b(start)f(by)f(immediately)f(reading)g(the)i (contents)f(strings)h(that)f(are)h(passed)f(as)i(ar)o(guments)c(to)515 3146 y(this)j(procedure)e(by)i(the)g(user)-5 b(.)44 b(W)-7 b(e)27 b(duplicate)e(the)h(options)g(string)g(because)f(it)i(is)g (later)g(passed)515 3245 y(unamended)17 b(to)k(the)f(renderer)-5 b(.)726 3461 y Ff(/options)46 b(exch)d(def)726 3561 y(/useropts)j (options)f(def)726 3661 y(/barcode)h(exch)d(def)515 3877 y Fk(W)-7 b(e)20 b(initialise)f(a)g(fe)n(w)g(def)o(ault)f(v)n (ariables.)24 b(Those)18 b(v)n(ariables)g(corresponding)d(to)k(options) f(that)h(can)515 3976 y(be)h(enabled)f(with)h(the)g(options)g(ar)o (gument)d(are)k(initially)f(set)h(to)f(f)o(alse.)726 4192 y Ff(/includetext)47 b(false)d(def)726 4292 y(/textfont)i (/Courier)f(def)726 4392 y(/textsize)h(10)d(def)726 4491 y(/textpos)j(-7)d(def)726 4591 y(/height)i(1)e(def)515 4807 y Fk(The)18 b(options)f(string)g(is)j(tok)o(enised)d(with)h(each)g (successi)n(v)o(e)f(tok)o(en)h(de\002ning)f(either)g(a)i(name)e(v)n (alue)515 4907 y(pair)j(which)g(we)h(instantiate)f(or)h(a)g(lone)f(v)n (ariable)f(that)i(we)g(de\002ne)f(as)h(true,)g(allo)n(wing)e(us)i(to)g (o)o(v)o(er)n(-)515 5006 y(ride)f(the)g(gi)n(v)o(en)f(def)o(ault)g(v)n (ariables)h(gi)n(v)o(en)e(abo)o(v)o(e.)1926 5255 y(3)p eop end %%Page: 4 7 TeXDict begin 4 6 bop 515 523 a Ff(options)44 b({)684 623 y(token)g(false)g(eq)f({exit})i(if)e(dup)g(length)h(string)h(cvs)e (\(=\))g(search)684 722 y(true)h(eq)f({cvlit)h(exch)g(pop)f(exch)h (def})g({cvlit)g(true)g(def})f(ifelse)515 822 y(})f(loop)515 1049 y Fk(Since)22 b(an)o(y)g(user)h(gi)n(v)o(en)e(options)h(create)g (v)n(ariables)g(that)h(are)g(strings)f(we)h(need)f(to)h(con)m(v)o(ert)e (them)515 1149 y(back)e(to)i(their)f(intended)e(types.)515 1376 y Ff(/textfont)45 b(textfont)g(cvlit)f(def)515 1476 y(/textsize)h(textsize)g(cvr)f(def)515 1575 y(/textpos)h(textpos)g(cvr) e(def)515 1675 y(/height)h(height)h(cvr)e(def)515 1902 y Fk(W)-7 b(e)23 b(then)e(create)h(an)g(array)f(of)h(string)g (encodings)e(for)h(each)h(of)g(the)g(a)n(v)n(ailable)f(characters)g (which)515 2002 y(we)d(then)f(declare)f(in)i(another)e(string.)24 b(This)17 b(information)f(can)h(be)g(deri)n(v)o(ed)f(from)g(careful)h (reading)515 2101 y(of)j(the)g(rele)n(v)n(ant)f(speci\002cation,)g (although)f(this)j(is)g(often)f(surprisingly)e(dif)n(\002cult)i(to)g (obtain.)726 2329 y Ff(/encs)726 2428 y([)43 b(\(1111313111\))k (\(3111111131\))f(\(1131111131\))g(\(3131111111\))811 2528 y(\(1111311131\))h(\(3111311111\))f(\(1131311111\))g (\(1111113131\))811 2627 y(\(3111113111\))h(\(1131113111\))f (\(313111\))f(\(311131\))726 2727 y(])e(def)726 2926 y(/barchars)j(\(0123456789\))g(def)515 3153 y Fk(W)-7 b(e)19 b(no)n(w)e(store)h(the)g(length)f(of)g(the)h(content)f(string)h (and)f(calculate)h(the)g(total)g(number)e(of)h(bars)h(and)515 3253 y(spaces)23 b(in)g(the)f(resulting)g(barcode.)31 b(W)-7 b(e)24 b(initialise)g(a)f(string)f(of)h(size)g(dependant)e(on)h (this)h(length)515 3353 y(into)h(which)h(we)g(will)h(b)n(uild)e(the)h (space)g(bar)f(succession.)39 b(Similarly)-5 b(,)25 b(we)g(create)g(an) g(array)f(into)515 3452 y(which)19 b(we)i(will)g(add)f(the)g(human)e (readable)h(te)o(xt)h(information.)726 3680 y Ff(/barlen)45 b(barcode)g(length)f(def)726 3779 y(/sbs)g(barlen)h(10)e(mul)g(12)g (add)g(string)i(def)726 3879 y(/txt)f(barlen)h(array)f(def)515 4106 y Fk(W)-7 b(e)21 b(no)n(w)e(be)o(gin)g(to)h(populate)e(the)i (space)f(bar)h(succession)f(by)h(adding)e(the)i(encoding)e(of)h(the)h (start)515 4206 y(character)f(to)h(the)g(be)o(ginning.)726 4433 y Ff(sbs)44 b(0)e(encs)i(10)f(get)h(putinterval)515 4660 y Fk(W)-7 b(e)23 b(no)n(w)e(enter)h(the)f(main)h(loop)f(which)g (iterates)i(o)o(v)o(er)d(the)i(content)f(string)g(from)g(start)i(to)f (\002nish,)515 4760 y(looking)c(up)i(the)g(encoding)e(for)i(each)g (character)m(,)e(adding)h(this)i(to)f(the)g(space)g(bar)g(succession.) 515 4907 y(It)g(is)g(important)e(to)i(understand)d(ho)n(w)i(the)h (encoding)d(for)i(a)h(gi)n(v)o(en)e(character)g(is)j(deri)n(v)o(ed.)i (Firstly)-5 b(,)515 5006 y(gi)n(v)o(en)20 b(a)i(character)m(,)e(we)i (\002nd)f(its)i(position)e(in)h(the)f(string)g(of)h(all)g(a)n(v)n (ailable)f(characters.)28 b(W)-7 b(e)23 b(then)1926 5255 y(4)p eop end %%Page: 5 8 TeXDict begin 5 7 bop 515 523 a Fk(use)17 b(this)g(position)f(to)h (inde)o(x)e(the)i(array)f(of)h(character)e(encodings)g(to)i(obtain)f (the)h(encoding)d(for)j(the)515 623 y(gi)n(v)o(en)i(character)m(,)h (which)g(is)i(added)e(to)h(the)h(space/bar)e(succession.)27 b(Lik)o(e)n(wise,)21 b(the)g(character)f(is)515 722 y(added)e(to)h(the) g(array)g(of)g(human)f(readable)g(te)o(xt)h(along)f(with)h(positioning) f(and)h(font)f(information.)684 945 y Ff(0)43 b(1)f(barlen)j(1)e(sub)g ({)853 1044 y(/i)g(exch)h(def)853 1144 y(barcode)h(i)e(1)g(getinterval) j(barchars)f(exch)e(search)853 1244 y(pop)853 1343 y(length)i(/indx)f (exch)g(def)853 1443 y(pop)g(pop)853 1543 y(/enc)g(encs)g(indx)g(get)f (def)853 1642 y(sbs)h(i)f(10)g(mul)g(6)g(add)g(enc)g(putinterval)853 1742 y(txt)h(i)f([barcode)i(i)d(1)h(getinterval)j(i)d(14)g(mul)g(10)g (add)g(-7)1150 1841 y(textfont)i(textsize])g(put)684 1941 y(})e(for)515 2164 y Fk(The)24 b(encoding)e(for)i(the)h(end)f (character)f(is)j(obtained)d(and)h(added)f(to)i(the)g(end)f(of)g(the)g (space)h(bar)515 2263 y(succession.)684 2486 y Ff(sbs)43 b(barlen)i(10)e(mul)g(6)g(add)g(encs)h(11)f(get)g(putinterval)515 2708 y Fk(Finally)24 b(we)h(prepare)e(to)h(push)g(a)h(dictionary)d (containing)h(the)h(space)h(bar)f(succession)g(\(and)f(an)o(y)515 2808 y(additional)c(information)e(de\002ned)j(in)g(section)g(2.1\))f (that)h(will)h(be)f(passed)g(to)h(the)f(renderer)-5 b(.)726 3030 y Ff(/retval)45 b(1)e(dict)h(def)726 3130 y(retval)h(\(sbs\))f ([sbs)g({48)f(sub})h(forall])g(put)726 3230 y(retval)h(\(bhs\))f([sbs)g (length)g(1)f(add)g(2)g(idiv)g({height})i(repeat])g(put)726 3329 y(retval)g(\(bbs\))f([sbs)g(length)g(1)f(add)g(2)g(idiv)g({0})h (repeat])g(put)726 3429 y(includetext)j({)896 3529 y(retval)d(\(txt\))g (txt)g(put)726 3628 y(})f(if)726 3728 y(retval)i(\(opt\))f(useropts)h (put)726 3828 y(retval)515 4111 y Fe(2.3)99 b(The)26 b(Render)n(er)515 4314 y Fk(This)20 b(description)f(is)i(out)f(of)g (date.)515 4461 y(The)i(procedure)e(labelled)i(barcode)f(is)j(kno)n(wn) d(as)i(the)g(renderer)m(,)e(which)h(we)h(no)n(w)f(consider)-5 b(.)32 b(Its)515 4560 y(purpose)14 b(is)i(to)g(accept)f(as)h(input)f (an)g(instance)g(of)g(the)h(dictionary-based)c(data)j(structure)g (described)515 4660 y(in)29 b(section)f(2.1)g(that)h(represents)f(a)h (barcode)e(in)i(some)g(arbitrary)e(symbology)f(and)i(produce)f(a)515 4760 y(visual)20 b(rendering)e(of)i(this)g(at)h(the)f(current)f(point.) 515 4907 y(The)f(v)n(ariables)h(that)g(we)g(use)g(in)g(this)h (procedure)c(are)j(con\002ned)f(to)h(local)g(scope)f(by)h(declaring)f (the)515 5006 y(procedure)f(as)k(follo)n(ws:)1926 5255 y(5)p eop end %%Page: 6 9 TeXDict begin 6 8 bop 515 523 a Ff(/barcode)45 b({)726 722 y(0)e(begin)515 922 y(...)726 1121 y(end)515 1320 y(})f(bind)i(def)515 1420 y(/barcode)h(load)f(0)e(1)h(dict)h(put)515 1633 y Fk(W)-7 b(e)32 b(then)g(immediately)e(read)h(the)g (dictionary-based)e(data)i(structure)g(which)g(is)h(passed)g(as)g(a)515 1733 y(single)22 b(ar)o(gument)e(to)i(this)g(procedure)e(by)i(an)g (encoder)m(,)e(from)h(which)h(we)g(e)o(xtract)g(the)g(space)g(bar)515 1832 y(succession,)d(bar)h(height)f(succession)h(and)g(bar)g(base)g (succession.)684 2046 y Ff(/args)44 b(exch)g(def)684 2146 y(/sbs)g(args)g(\(sbs\))g(get)f(def)684 2245 y(/bhs)h(args)g (\(bhs\))g(get)f(def)684 2345 y(/bbs)h(args)g(\(bbs\))g(get)f(def)684 2444 y(/renderopts)j(args)e(\(opt\))g(get)f(def)515 2658 y Fk(W)-7 b(e)27 b(attempt)e(to)h(e)o(xtract)f(from)g(the)h(dictionary) e(the)i(array)f(containing)f(the)i(information)e(about)515 2758 y(human)f(readable)g(te)o(xt.)37 b(Ho)n(we)n(v)o(er)m(,)23 b(this)i(may)f(not)g(e)o(xist)g(in)g(the)h(dictionary)d(in)j(which)e (case)i(we)515 2857 y(create)20 b(a)g(def)o(ault)g(empty)f(array)-5 b(.)684 3071 y Ff(args)44 b(\(txt\))g(known)g({)853 3170 y(/txt)g(args)g(\(txt\))g(get)f(def)684 3270 y(})g({)853 3370 y(/txt)h([])f(def)684 3469 y(})g(ifelse)515 3683 y Fk(Just)23 b(as)g(with)f(the)g(encoders,)f(we)i(read)e(and)h(tok)o (enise)g(the)g(supplied)f(options)g(allo)n(wing)g(speci\002c)515 3782 y(rendering)d(options)h(to)h(be)g(o)o(v)o(erridden.)684 3996 y Ff(/inkspread)46 b(0.15)e(def)684 4095 y(renderopts)i({)853 4195 y(token)f(false)f(eq)f({exit})h(if)f(dup)g(length)i(string)f(cvs)f (\(=\))h(search)853 4295 y(true)g(eq)f({cvlit)i(exch)e(pop)h(exch)f (def})h({cvlit)g(true)g(def})g(ifelse)684 4394 y(})f(loop)684 4494 y(/inkspread)j(inkspread)f(cvr)f(def)515 4707 y Fk(W)-7 b(e)22 b(ha)n(v)o(e)e(e)o(xtracted)g(or)g(deri)n(v)o(ed)f(all)j (of)e(the)h(necessary)f(information)f(from)h(the)h(input,)f(and)g(no)n (w)515 4807 y(use)k(the)g(space)g(bar)g(succession,)g(bar)g(height)f (succession)h(and)f(bar)h(base)g(succession)g(in)g(calcu-)515 4907 y(lations)f(that)f(create)h(a)g(single)g(array)f(containing)f (elements)h(that)h(gi)n(v)o(e)f(coordinates)f(for)h(each)h(of)515 5006 y(the)d(bars)g(in)g(the)h(barcode.)1926 5255 y(6)p eop end %%Page: 7 10 TeXDict begin 7 9 bop 515 523 a Fk(W)-7 b(e)21 b(start)f(by)g(creating) f(a)h(bars)g(array)f(that)h(is)h(half)e(the)h(length)f(of)h(the)g (space)f(bar)h(succession.)k(W)-7 b(e)515 623 y(b)n(uild)27 b(this)i(by)e(repeatedly)g(adding)f(array)h(elements)h(that)g(contain)f (the)h(height,)h(x-coordinate,)515 722 y(y-coordinate)18 b(and)j(width)g(of)h(single)f(bars.)28 b(The)22 b(height)e(and)h (y-coordinates)e(are)i(read)g(from)g(the)515 822 y(bar)d(height)f (succession)h(and)g(the)g(bar)g(base)g(succession,)g(respecti)n(v)o (ely)-5 b(,)16 b(whilst)j(the)f(x-coordinate)515 922 y(and)24 b(the)g(width)g(are)g(made)g(from)f(a)i(calculation)e(of)h (the)h(total)f(indent,)g(based)g(on)g(the)h(space)f(bar)515 1021 y(succession)c(and)f(a)i(compensating)d(f)o(actor)h(that)i (accounts)e(for)g(ink)h(spread.)684 1249 y Ff(/bars)44 b(sbs)g(length)g(1)f(add)g(2)g(idiv)g(array)h(def)684 1349 y(/x)f(0.00)h(def)684 1449 y(0)f(1)f(sbs)i(length)g(1)f(sub)g({) 853 1548 y(/i)g(exch)h(def)853 1648 y(/d)f(sbs)h(i)f(get)g(48)g(sub)g (def)853 1748 y(i)g(2)g(mod)g(0)g(eq)g({)1023 1847 y(/h)g(bhs)g(i)g(2)g (idiv)g(get)h(72)f(mul)g(def)1023 1947 y(/c)g(d)g(2)f(div)i(x)e(add)i (def)1023 2046 y(/y)f(bbs)g(i)g(2)g(idiv)g(get)h(72)f(mul)g(def)1023 2146 y(/w)g(d)g(inkspread)i(sub)e(def)1023 2246 y(bars)h(i)e(2)h(idiv)h ([h)f(c)f(y)h(w])g(put)853 2345 y(})g(if)853 2445 y(/x)g(x)g(d)g(add)g (def)684 2545 y(})g(for)515 2773 y Fk(Finally)-5 b(,)22 b(we)g(perform)f(the)h(actual)g(rendering)e(in)i(tw)o(o)h(phases.)31 b(Firstly)23 b(we)f(use)h(the)f(contents)g(of)515 2872 y(the)27 b(bars)h(array)e(that)i(we)g(just)g(b)n(uilt)g(to)f(render)g (each)g(of)g(the)h(bars,)h(and)e(secondly)f(we)i(use)g(the)515 2972 y(contents)g(of)i(the)f(te)o(xt)g(array)g(e)o(xtracted)f(from)g (the)i(input)f(ar)o(gument)e(to)i(render)f(the)i(te)o(xt.)52 b(W)-7 b(e)515 3072 y(mak)o(e)19 b(an)g(ef)n(\002cienc)o(y)f(sa)n(ving) i(here)f(by)g(not)g(performing)e(loading)h(and)h(rescaling)g(of)g(a)h (font)f(if)h(the)515 3171 y(scale)26 b(f)o(actor)g(for)f(the)h(font)g (size)g(is)i(0.)42 b(The)26 b(graphics)f(state)i(is)g(preserv)o(ed)d (across)i(calls)h(to)f(this)515 3271 y(procedure)17 b(to)k(pre)n(v)o (ent)d(une)o(xpected)g(interference)g(with)i(the)h(users)f(en)m (vironment.)684 3499 y Ff(gsave)684 3698 y(bars)44 b({)853 3798 y({})f(forall)853 3898 y(setlinewidth)k(moveto)d(0)f(exch)h (rlineto)g(stroke)684 3997 y(})f(forall)684 4196 y(txt)g({)853 4296 y({})g(forall)853 4396 y(dup)h(0)f(ne)g({exch)h(findfont)h(exch)e (scalefont)j(setfont})853 4495 y({pop)e(pop})853 4595 y(ifelse)853 4695 y(moveto)h(show)684 4794 y(})e(forall)684 4993 y(grestore)1926 5255 y Fk(7)p eop end %%Page: 8 11 TeXDict begin 8 10 bop 515 523 a Fe(2.4)99 b(Notes)25 b(Regarding)g(Coding)g(Style)515 726 y Fk(PostScript)16 b(programming)d(v)o(eterans)i(are)i(encouraged)c(to)k(remember)d(that)j (the)f(majority)f(of)h(peo-)515 826 y(ple)k(who)g(read)f(the)i(code)e (are)h(lik)o(ely)g(to)h(ha)n(v)o(e)e(little,)i(if)f(an)o(y)-5 b(,)19 b(prior)g(kno)n(wledge)f(of)i(the)g(language.)515 972 y(T)-7 b(o)20 b(encourage)e(de)n(v)o(elopment,)f(the)j(code)g(has)g (been)g(written)g(with)g(these)g(goals)g(in)h(mind:)653 1202 y(-)41 b(That)20 b(it)h(be)f(easy)h(to)f(use)g(and)g(to)g (comprehend)653 1368 y(-)41 b(That)20 b(it)h(be)f(easy)h(to)f(modify)f (and)g(enhance)515 1598 y(T)-7 b(o)20 b(this)h(end)e(the)i(follo)n (wing)d(points)i(should)f(be)h(observ)o(ed)e(for)i(all)h(ne)n(w)f(code) f(submissions:)653 1828 y(-)41 b(Ne)n(w)21 b(encoders)e(should)g(be)h (based)g(on)f(the)i(code)e(of)h(a)h(similar)f(e)o(xisting)f(encoder)653 1994 y(-)41 b(Include)21 b(comments)g(where)g(these)h(clarify)f(the)h (operations)e(in)m(v)n(olv)o(ed,)h(particular)f(where)722 2094 y(something)f(une)o(xpected)f(happens)653 2260 y(-)41 b(Prefer)25 b(simplicity)g(to)g(ef)n(\002cenc)o(y)f(and)g(clarity)h(to) g(obfuscation,)f(e)o(xcept)h(where)f(this)i(will)722 2360 y(be)20 b(a)h(problem)1926 5255 y(8)p eop end %%Page: 9 12 TeXDict begin 9 11 bop 515 523 a Fj(3)119 b(Resour)n(ces)30 b(and)g(Examples)515 756 y Fk(There)19 b(are)h(se)n(v)o(eral)g(w)o(ays) g(of)g(using)g(the)g(PostScript)g(within)g(your)f(o)n(wn)h(projects.) 515 903 y(Man)o(y)15 b(e)o(xample)f(uses)j(of)e(the)h(code)g(for)f(v)n (arious)g(languages)f(and)i(platforms)f(can)g(be)h(do)n(wnloaded)515 1002 y(from)e(the)h(code)g(repository)e(at)j(http://www)-5 b(.terryb)n(urton.co.uk)o(/bar)o(cod)o(e)n(writer)o(/\002les/repo)o (sitory)o(/)515 1287 y Fe(3.1)99 b(Language)26 b(Speci\002c)g(APIs)515 1490 y Fk(No)19 b(language)f(speci\002c)i(APIs)g(e)o(xist)g(yet.)25 b(If)20 b(you)e(ha)n(v)o(e)h(e)o(xperience)f(writing)h(API)h (speci\002cations)515 1590 y(and)f(w)o(ould)h(lik)o(e)g(to)h(help)e (create)h(an)g(API)h(design)e(for)h(the)g(project)g(then)f(contact)h (the)g(author)-5 b(.)515 1875 y Fe(3.2)99 b(Fr)n(ont)25 b(Ends)515 2078 y Fk(The)20 b(follo)n(wing)e(is)j(a)g(list)g(of)f(the)g (front)f(ends)h(a)n(v)n(ailable)g(for)g(the)g(project.)515 2307 y Fi(W)-5 b(eb)20 b(based)h(generator)39 b Fk(http://www)-5 b(.terryb)n(urton.co.uk/b)o(arc)o(ode)m(writer/g)o(ene)o(rato)o(r/)515 2473 y Fi(Scrib)n(us)42 b Fk(Scrib)n(us)26 b(v)o(ersions)g(1.3)f(and)h (later)g(come)g(with)g(a)h(Barcode)e(Mak)o(er)h(plugin)f(based)h(on)722 2573 y(this)21 b(project.)722 2673 y(http://www)-5 b(.scrib)n(us.or)o (g.uk)515 2839 y Fi(KBar)o(code)39 b Fk(KBarcode)20 b(v)o(ersions)f(2)h (and)g(later)g(mak)o(e)g(use)g(of)g(this)h(project.)722 2938 y(http://www)-5 b(.kbarcode.net)515 3104 y Fi(pst-bar)o(code)39 b Fk(pst-barcode)18 b(is)k(a)e(PST)m(ricks)h(package)d(for)i(L)2270 3090 y Fh(A)2302 3104 y Fk(T)2339 3123 y(E)2379 3104 y(X.)722 3204 y(http://www)-5 b(.ctan.or)o(g/te)o(x-archi)n(v)n(e/gr)o (aph)o(ics/pstrick)o(s/contr)o(ib/pst-b)o(arco)o(de)o(/)1926 5255 y(9)p eop end %%Page: 10 13 TeXDict begin 10 12 bop 515 523 a Fe(3.3)99 b(Installing)31 b(the)j(Bar)n(code)f(Generation)g(Capability)f(into)h(a)f(Printer')l(s) 739 639 y(V)l(irtual)25 b(Machine)515 842 y Fk(Most)d(genuine)e (PostScript)h(printers)g(allo)n(w)h(procedures)d(to)j(be)g(de\002ned)e (such)i(that)f(the)o(y)g(persist)515 942 y(across)30 b(dif)n(ferent)e(jobs)i(through)e(the)j(use)f(of)g(the)g Ff(exitserver)k Fk(command.)53 b(If)30 b(your)f(printer)515 1041 y(supports)22 b(this)h(then)g(you)f(will)i(be)f(able)g(to)g(print) g(the)g(main)g(code)f(containing)f(the)j(de\002nitons)e(of)515 1141 y(all)e(the)f(encoders)f(and)h(the)h(renderer)d(once,)i(e.g.)24 b(soon)19 b(after)g(the)h(de)n(vice)e(is)j(turned)d(on,)h(and)f(later) 515 1241 y(omit)i(these)g(de\002nitons)f(from)h(each)f(of)h(the)h (barcode)d(documents)h(that)h(you)f(print.)515 1388 y(T)-7 b(o)25 b(install)g(the)g(barcode)f(generation)f(capabilities)i(into)f (the)h(virtual)g(machine)e(of)i(a)h(PostScript)515 1487 y(printer)19 b(you)g(need)h(to)g(uncomment)e(a)i(line)h(near)e(the)h (top)g(of)g(the)g(code)g(so)h(that)f(it)h(reads:)515 1717 y Ff(serverdict)45 b(begin)g(0)d(exitserver)515 1947 y Fk(Once)24 b(this)h(code)e(is)j(printed)d(the)h(procedural)e (de\002nitions)h(for)h(the)g(encoders)f(and)h(the)g(renderer)515 2047 y(will)g(remain)e(de\002ned)h(across)g(all)h(jobs)f(until)h(the)f (de)n(vice)f(is)j(reset)e(either)g(by)g(po)n(wer)n(-c)o(ycling)e(or)515 2146 y(with)f(the)g(follo)n(wing)f(code:)515 2376 y Ff(serverdict)45 b(begin)g(0)d(exitserver)k(systemdict)g(/quit)e(get)f(exec)1905 5255 y Fk(10)p eop end %%Page: 11 14 TeXDict begin 11 13 bop 515 523 a Fe(3.4)99 b(Hints)24 b(f)n(or)h(Generating)g(Pr)n(ecisely)g(the)h(Requir)n(ed)h(Symbol)515 726 y Fk(T)-7 b(o)20 b(create)f(a)i(barcode)d(to)i(a)g(required)e (width)i(and)f(height,)g(without)g(stretching)g(the)h(human)e(read-)515 826 y(able)i(te)o(xt,)g(perform)e(the)i(follo)n(wing)f(steps.)515 972 y(Create)30 b(a)g(basic)g(symbol)f(by)g(choosing)g(the)g(rele)n(v)n (ant)g(data)h(and)f(te)o(xt)h(options)f(for)g(the)h(corre-)515 1072 y(sponding)20 b(encoder)m(,)h(and)h(position)g(this)h(using)f Ff(translate)k Fk(such)d(that)f(the)h Fb(bottom-left)g Fk(corner)515 1172 y(of)d(the)g(bars)g(is)h(in)f(the)h(required)d (location:)515 1402 y Ff(gsave)515 1501 y(430)43 b(750)g(translate)515 1601 y(\(977147396801\))k(\(includetext\))g(ean13)d(barcode)515 1700 y(grestore)515 1930 y Fk(Find)25 b(the)g(uniform)e(scale)i(f)o (actor)g(\(same)g(v)n(alue)f(for)h(x)g(and)f(y\))h(that)g(mak)o(es)g (your)f(output)g(of)h(the)515 2030 y(required)18 b Fb(width)p Fk(:)515 2260 y Ff(gsave)515 2360 y(430)43 b(750)g(translate)515 2459 y(1.3)g(1.3)g(scale)256 b(\045)85 b(<--)44 b(Add)f(a)g(line)g (like)h(this)515 2559 y(\(977147396801\))j(\(includetext\))g(ean13)d (barcode)515 2658 y(grestore)515 2888 y Fk(Add)26 b(a)g(height)g (option)f(that)h(adjusts)h(the)f(bar)g Fb(height)h Fk(appropriately)c (\(taking)i(the)i(scaling)f(into)515 2988 y(account\):)515 3218 y Ff(gsave)515 3317 y(430)43 b(750)g(translate)515 3417 y(1.3)g(1.3)g(scale)515 3517 y(\045)f(Added)i(height=0.8)i(option) f(to)e(adjust)h(height)515 3616 y(\(977147396801\))j(\(includetext)f (height=0.8\))g(ean13)e(barcode)515 3716 y(grestore)515 3946 y Fk(The)19 b(result)g(should)g(no)n(w)f(be)i(of)f(the)g(intended) f(dimensions)g(at)i(the)f(desired)g(location)g(with)g(prop-)515 4045 y(erly)h(scaled)g(te)o(xt.)25 b(Y)-9 b(ou)19 b(can)h(no)n(w)g(add) f(an)o(y)h(additional)f(options)g(to)h(customise)g(the)g(symbol.)1905 5255 y(11)p eop end %%Page: 12 15 TeXDict begin 12 14 bop 515 523 a Fe(3.5)99 b(Printing)25 b(in)g(P)n(erl)515 726 y Fk(This)h(e)o(xample)f(will)i(print)f(a)h (page)e(of)h(EAN-13s)g(ranging)e(between)i(tw)o(o)g(gi)n(v)o(en)f(v)n (alues)h(when)515 826 y(called)20 b(from)f(a)i(shell)f(lik)o(e)h(this:) 515 1055 y Ff($)42 b(./ean13s.pl)47 b(978186074271)f(978186074292)g(|)d (lpr)515 1285 y Fk(The)20 b(contents)f(of)h(the)g(script)g Ff(ean13s.pl)k Fk(is)d(as)g(follo)n(ws:)515 1515 y Ff(#!/usr/bin/perl) 47 b(-w)515 1615 y(use)c(strict;)515 1814 y(die)g('Requires)j(two)d (arguments')j(if)d(\(@ARGV!=2\);)515 2013 y(open\(PS,'barcode.ps')q(\)) 48 b(||)43 b(die)h('File)g(not)f(found';)515 2113 y ($_=join\('',\);)515 2213 y(close\(PS\);)515 2412 y(print)h("\045!PS-Adobe-2.0\\n";)515 2611 y(m/)684 2711 y(\045\\)f(--BEGIN\\)i(TEMPLATE--)684 2810 y(\(.*\))684 2910 y(\045\\)e(--END\\)i(TEMPLATE--)684 3010 y(/sx)e(||)g(die)h ('Unable)h(to)e(parse)h(out)f(the)g(template';)515 3109 y(print)h($1;)515 3309 y(for)f(\(my)g($i=$ARGV[0],)k(my)c($j=0;)h ($i<$ARGV[1];)i($i++,)e($j++\))g({)684 3408 y(my)f ($x=100+150*\(int\($j/)q(7\)\))q(;)684 3508 y(my)g ($y=100+100*\($j\0457\);)684 3607 y(print)h("gsave\\n";)684 3707 y(print)g("$x)g($y)f(translate\\n";)684 3807 y(print)h("\($i\))g (\(includetext\))j(ean13)d(barcode\\n";)684 3906 y(print)g ("grestore\\n";)515 4006 y(})515 4205 y(print)g("showpage\\n";)1905 5255 y Fk(12)p eop end %%Page: 13 16 TeXDict begin 13 15 bop 515 523 a Fj(4)119 b(Supported)32 b(Symbologies)515 756 y Fk(The)24 b(follo)n(wing)g(section)g(sho)n(ws)h (the)g(symbologies)e(that)i(are)g(supported)e(by)h(the)h(encoders,)g (in-)515 855 y(cluding)d(the)i(a)n(v)n(ailable)f(features)g(for)g (each.)35 b(This)24 b(list)g(may)g(not)f(be)h(up-to-date.)33 b(If)23 b(it)h(does)g(not)515 955 y(contain)h(an)o(y)g(of)h(the)h (formats)e(or)h(features)g(that)g(you)f(require)g(then)h(check)g(the)g (project)f(source)515 1055 y(code)19 b(or)h(try)g(the)g(support)f (mailing)h(list.)515 1340 y Fe(4.1)99 b(EAN-13)515 1528 y Fi(Data)40 b Fk(12)20 b(or)g(13)f(digits)515 1743 y Fi(Options)888 1691 y Fk(Option)p 1401 1721 4 100 v 333 w(Feature)p 838 1724 1589 4 v 888 1794 a Ff(includetext)p 1401 1824 4 100 v 103 w Fk(Enable)g(human)g(readable)g(te)o(xt)515 1955 y Fi(Notes)41 b Fk(If)20 b(just)g(12)g(digits)g(are)g(entered)g (then)f(the)h(check)g(digit)g(is)h(calculated)e(automatically)1603 2756 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (9781860742712) (includetext guardwhitespace) ean13 barcode end @endspecial 534 2938 a(Figure)g(1:)26 b Ff(\(9781860742712\))47 b(\(includetext)g (guardwhitespace\))g(ean13)d(barcode)515 3276 y Fe(4.2)99 b(EAN-8)515 3465 y Fi(Data)40 b Fk(8)20 b(digits)515 3679 y Fi(Options)888 3627 y Fk(Option)p 1401 3657 V 333 w(Feature)p 838 3660 1589 4 v 888 3730 a Ff(includetext)p 1401 3760 4 100 v 103 w Fk(Enable)f(human)g(readable)g(te)o(xt)1721 4302 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (12345678) (includetext guardwhitespace height=0.6) ean8 barcode end @endspecial 515 4485 a(Figure)74 b(2:)136 b Ff(\(12345678\))46 b(\(includetext)g (guardwhitespace)i(height=0.6\))e(ean8)515 4585 y(barcode)1905 5255 y Fk(13)p eop end %%Page: 14 17 TeXDict begin 14 16 bop 515 523 a Fe(4.3)99 b(UPC-A)515 712 y Fi(Data)40 b Fk(11)20 b(or)g(12)f(digits)515 927 y Fi(Options)888 874 y Fk(Option)p 1401 904 4 100 v 333 w(Feature)p 838 908 1589 4 v 888 977 a Ff(includetext)p 1401 1007 4 100 v 103 w Fk(Enable)g(human)g(readable)g(te)o(xt)515 1139 y Fi(Notes)41 b Fk(If)20 b(just)g(11)g(digits)g(are)g(entered)g (then)f(the)h(check)g(digit)g(is)h(calculated)e(automatically)1603 1939 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (78858101497) (includetext) upca barcode end @endspecial 936 2122 a(Figure)h(3:)25 b Ff(\(78858101497\))47 b(\(includetext\))g(upca)c (barcode)515 2459 y Fe(4.4)99 b(UPC-E)515 2648 y Fi(Data)40 b Fk(7)20 b(or)g(8)g(digits)515 2863 y Fi(Options)888 2810 y Fk(Option)p 1401 2840 V 333 w(Feature)p 838 2844 1589 4 v 888 2913 a Ff(includetext)p 1401 2943 4 100 v 103 w Fk(Enable)f(human)g(readable)g(te)o(xt)515 3075 y Fi(Notes)41 b Fk(If)20 b(just)g(7)h(digits)f(are)g(entered)f(then)h (the)g(check)f(digit)h(is)h(calculated)f(automatically)1721 3875 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (0123456) (includetext) upce barcode end @endspecial 1021 4058 a(Figure)f(4:)26 b Ff(\(0123456\))45 b(\(includetext\))i(upce)d (barcode)1905 5255 y Fk(14)p eop end %%Page: 15 18 TeXDict begin 15 17 bop 515 523 a Fe(4.5)99 b(EAN-5)515 712 y Fi(Data)40 b Fk(5)20 b(digits)515 927 y Fi(Options)888 874 y Fk(Option)p 1401 904 4 100 v 333 w(Feature)p 838 908 1589 4 v 888 977 a Ff(includetext)p 1401 1007 4 100 v 103 w Fk(Enable)f(human)g(readable)g(te)o(xt)1721 1790 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (90200) (includetext guardwhitespace) ean5 barcode end @endspecial 724 1972 a(Figure)h(5:)25 b Ff(\(90200\))45 b(\(includetext)h(guardwhitespace\))i(ean5)c(barcode) 515 2288 y Fe(4.6)99 b(EAN-2)515 2477 y Fi(Data)40 b Fk(2)20 b(digits)515 2692 y Fi(Options)888 2640 y Fk(Option)p 1401 2670 V 333 w(Feature)p 838 2673 1589 4 v 888 2743 a Ff(includetext)p 1401 2773 4 100 v 103 w Fk(Enable)f(human)g (readable)g(te)o(xt)1839 3555 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (38) (includetext guardwhitespace) ean2 barcode end @endspecial 788 3738 a(Figure)g(6:)26 b Ff(\(38\))43 b(\(includetext)k(guardwhitespace\))h(ean2)43 b(barcode)1905 5255 y Fk(15)p eop end %%Page: 16 19 TeXDict begin 16 18 bop 515 523 a Fe(4.7)99 b(ISBN)515 712 y Fi(Data)40 b Fk(9)20 b(or)g(10)g(digits)g(seperated)f (appropriately)f(with)i(dashes)515 927 y Fi(Options)888 874 y Fk(Option)p 1401 904 4 100 v 333 w(Feature)p 838 908 1589 4 v 888 977 a Ff(includetext)p 1401 1007 4 100 v 103 w Fk(Enable)f(human)g(readable)g(te)o(xt)515 1139 y Fi(Notes)41 b Fk(If)23 b(just)g(9)h(digits)f(are)g(entered)f(then)h (the)g(human)f(readable)g(ISBN)i(check)e(digit)h(is)h(calcu-)722 1238 y(lated)c(automatically)1603 2039 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (1-58880-149) (includetext guardwhitespace) isbn barcode end @endspecial 936 2221 a(Figure)g(7:)25 b Ff(\(1-58880-149\))47 b(\(includetext\))g(isbn)c(barcode)515 2559 y Fe(4.8)99 b(Code-39)515 2748 y Fi(Data)40 b Fk(V)-9 b(ariable)19 b(number)g(of)h(characters,)f(digits)h(and)f(an)o(y)h(of)g (the)g(symbols)g Ff(-.)43 b(*$/+\045)p Fk(.)515 3062 y Fi(Options)888 2910 y Fk(Option)p 1698 2940 V 629 w(Feature)p 838 2943 2009 4 v 888 3013 a Ff(includecheck)p 1698 3043 4 100 v 357 w Fk(Enable)20 b(check)f(digit)888 3113 y Ff(includetext)p 1698 3142 V 399 w Fk(Enable)h(human)e(readable)h(te)o (xt)888 3212 y Ff(includecheckintext)p 1698 3242 V 105 w Fk(Mak)o(e)h(check)g(digit)g(visible)g(in)g(te)o(xt)1367 4025 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (CODE-39) (includecheck includetext) code39 barcode end @endspecial 703 4207 a(Figure)g(8:)25 b Ff(\(CODE-39\))46 b(\(includecheck)g(includetext\))h (code39)d(barcode)1905 5255 y Fk(16)p eop end %%Page: 17 20 TeXDict begin 17 19 bop 515 523 a Fe(4.9)99 b(Code-128)25 b(and)g(UCC/EAN-128)515 712 y Fi(Data)40 b Fk(V)-9 b(ariable)20 b(number)f(of)i(ASCII)g(characters)f(and)g(special)h(funtion)f (symbols,)g(starting)g(with)722 812 y(the)k(approriate)d(start)j (character)f(for)f(the)i(initial)g(character)e(set.)36 b(UCC/EAN-128s)23 b(must)722 911 y(ha)n(v)o(e)d(a)h(manditory)d Ff(FNC)43 b(1)21 b Fk(symbol)e(immediately)g(follo)n(wing)g(the)h (start)h(character)-5 b(.)515 1176 y Fi(Options)888 1074 y Fk(Option)p 1698 1103 4 100 v 629 w(Feature)p 838 1107 2009 4 v 888 1177 a Ff(includetext)p 1698 1206 4 100 v 399 w Fk(Enable)20 b(human)e(readable)h(te)o(xt)888 1276 y Ff(includecheckintext)p 1698 1306 V 105 w Fk(Mak)o(e)h(check)g (digit)g(visible)g(in)g(te)o(xt)515 1437 y Fi(Notes)41 b Fk(An)o(y)27 b(non-printable)e(character)i(can)i(be)f(entered)f(via)i (its)g(escaped)f(ordinal)f(v)n(alue,)i(for)722 1537 y(e)o(xample)c Ff(\210070)i Fk(for)e Ff(ACK)j Fk(and)d Ff(\210102)i Fk(for)f Ff(FNC)43 b(1)p Fk(.)f(Since)26 b(a)g(caret)g(symbol)f(serv)o (es)g(as)i(an)722 1637 y(escape)33 b(character)e(it)i(must)g(be)f (escaped)g(as)h Ff(\210062)i Fk(if)e(used)f(in)h(the)f(data.)62 b(The)32 b(check)722 1736 y(character)19 b(is)i(al)o(w)o(ays)g(added)e (automatically)-5 b(.)1367 2537 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (^104^102Count^0991234^101!) (includetext) code128 barcode end @endspecial 555 2720 a(Figure)20 b(9:)25 b Ff (\(\210104\210102Count\21009912)q(34\210)q(101)q(!\))49 b(\(includetext\))e(code128)d(barcode)515 3057 y Fe(4.10)99 b(Rationalized)24 b(Codabar)515 3246 y Fi(Data)40 b Fk(V)-9 b(ariable)19 b(number)g(of)h(digits)g(and)f(an)o(y)h(of)g(the)g (symbols)g Ff(-$:/.+ABCD)p Fk(.)515 3560 y Fi(Options)888 3408 y Fk(Option)p 1698 3438 V 629 w(Feature)p 838 3441 2009 4 v 888 3511 a Ff(includecheck)p 1698 3541 4 100 v 357 w Fk(Enable)g(check)f(digit)888 3611 y Ff(includetext)p 1698 3641 V 399 w Fk(Enable)h(human)e(readable)h(te)o(xt)888 3710 y Ff(includecheckintext)p 1698 3740 V 105 w Fk(Mak)o(e)h(check)g (digit)g(visible)g(in)g(te)o(xt)1485 4523 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (0123456789) (includetext) rationalizedCodabar barcode end @endspecial 619 4706 a(Figure)g(10:)k Ff(\(0123456789\))47 b(\(includetext\))g(rationalizedCodabar)h(barcode)1905 5255 y Fk(17)p eop end %%Page: 18 21 TeXDict begin 18 20 bop 515 523 a Fe(4.11)99 b(Interlea)n(v)o(ed)25 b(2)g(of)g(5)f(and)i(ITF-14)515 712 y Fi(Data)40 b Fk(V)-9 b(ariable)18 b(number)e(of)j(digits.)24 b(An)19 b(ITF-14)e(is)i(14)f (characters)g(and)g(does)g(not)g(ha)n(v)o(e)g(a)h(check)722 812 y(digit.)515 1126 y Fi(Options)888 974 y Fk(Option)p 1698 1004 4 100 v 629 w(Feature)p 838 1007 2009 4 v 888 1077 a Ff(includecheck)p 1698 1107 4 100 v 357 w Fk(Enable)h(check)f (digit)888 1177 y Ff(includetext)p 1698 1206 V 399 w Fk(Enable)h(human)e(readable)h(te)o(xt)888 1276 y Ff (includecheckintext)p 1698 1306 V 105 w Fk(Mak)o(e)h(check)g(digit)g (visible)g(in)g(te)o(xt)515 1437 y Fi(Notes)41 b Fk(The)21 b(data)h(may)g(be)g(automatically)f(pre\002x)o(ed)f(with)i(0)h(to)f (mak)o(e)g(the)g(data,)g(including)e(op-)722 1537 y(tional)g(check)g (digit,)f(of)h(e)n(v)o(en)f(length.)1367 2158 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (05012345678900) (includecheck height=0.7) interleaved2of5 barcode end @endspecial 515 2340 a(Figure)32 b(11:)51 b Ff(\(05012345678900\))d(\(includecheck)f(height=0.7\))f (interleaved2of5)515 2440 y(barcode)515 2760 y Fe(4.12)99 b(Code)25 b(2)g(of)g(5)515 2949 y Fi(Data)40 b Fk(V)-9 b(ariable)19 b(number)g(of)h(digits)515 3164 y Fi(Options)888 3112 y Fk(Option)p 1401 3141 V 333 w(Feature)p 838 3145 1589 4 v 888 3215 a Ff(includetext)p 1401 3244 4 100 v 103 w Fk(Enable)f(human)g(readable)g(te)o(xt)1367 4147 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (0123456789) (includetext textpos=75 textfont=Helvetica textsize=16) code2of5 barcode end @endspecial 515 4330 a(Figure)75 b(12:)135 b Ff(\(0123456789\))47 b(\(includetext)f(textpos=75)g (textfont=Helvetica)515 4429 y(textsize=16\))g(code2of5)f(barcode)1905 5255 y Fk(18)p eop end %%Page: 19 22 TeXDict begin 19 21 bop 515 523 a Fe(4.13)99 b(P)n(ostnet)515 712 y Fi(Data)40 b Fk(V)-9 b(ariable)19 b(number)g(digits)515 976 y Fi(Options)888 874 y Fk(Option)p 1698 904 4 100 v 629 w(Feature)p 838 908 2253 4 v 888 977 a Ff(includetext)p 1698 1007 4 100 v 399 w Fk(Enable)h(human)e(readable)h(te)o(xt)888 1077 y Ff(includecheckintext)p 1698 1107 V 105 w Fk(Mak)o(e)h(the)g (check)g(digit)g(visible)g(in)g(the)h(te)o(xt)515 1238 y Fi(Notes)41 b Fk(Check)19 b(digit)h(is)i(al)o(w)o(ays)e(added)f (automatically)1130 1619 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (01234567) (includetext textpos=-10 textfont=Arial textsize=10) postnet barcode end @endspecial 515 1801 a(Figure)145 b(13:)277 b Ff(\(01234567\))46 b(\(includetext)g(textpos=-10)g(textfont=Arial)515 1901 y(textsize=10\))g(postnet)f(barcode)515 2233 y Fe(4.14)99 b(Royal)24 b(Mail)515 2422 y Fi(Data)40 b Fk(V)-9 b(ariable)19 b(number)g(digits)h(and)g(capital)g(letters)515 2687 y Fi(Options)888 2584 y Fk(Option)p 1698 2614 V 629 w(Feature)p 838 2618 2253 4 v 888 2687 a Ff(includetext)p 1698 2717 4 100 v 399 w Fk(Enable)g(human)e(readable)h(te)o(xt)888 2787 y Ff(includecheckintext)p 1698 2817 V 105 w Fk(Mak)o(e)h(the)g (check)g(digit)g(visible)g(in)g(the)h(te)o(xt)515 2948 y Fi(Notes)41 b Fk(Check)19 b(digit)h(is)i(al)o(w)o(ays)e(added)f (automatically)1367 3449 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (LE28HS9Z) (includetext) royalmail barcode end @endspecial 873 3632 a(Figure)h(14:)k Ff(\(LE28HS9Z\))46 b(\(includetext\))h(royalmail)e(barcode)1905 5255 y Fk(19)p eop end %%Page: 20 23 TeXDict begin 20 22 bop 515 523 a Fe(4.15)99 b(MSI)515 712 y Fi(Data)40 b Fk(V)-9 b(ariable)19 b(number)g(digits)515 1026 y Fi(Options)888 874 y Fk(Option)p 1698 904 4 100 v 629 w(Feature)p 838 908 2131 4 v 888 977 a Ff(includecheck)p 1698 1007 4 100 v 357 w Fk(Enable)h(check)f(digit)888 1077 y Ff(includetext)p 1698 1107 V 399 w Fk(Enable)h(human)e(readable) h(te)o(xt)888 1177 y Ff(includecheckintext)p 1698 1206 V 105 w Fk(Mak)o(e)h(check)g(digit)g(visible)g(in)g(the)g(te)o(xt)1249 1989 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (0123456789) (includecheck includetext) msi barcode end @endspecial 682 2172 a(Figure)g(15:)25 b Ff(\(0123456789\))46 b(\(includecheck)h (includetext\))f(msi)e(barcode)515 2488 y Fe(4.16)99 b(Plessey)515 2677 y Fi(Data)40 b Fk(V)-9 b(ariable)19 b(number)g(of)h(he)o(xadecimal)e(characters)515 2924 y Fi(Options)888 2822 y Fk(Option)p 1698 2852 V 629 w(Feature)p 838 2855 2286 4 v 888 2925 a Ff(includetext)p 1698 2955 4 100 v 399 w Fk(Enable)i(human)e(readable)h(te)o(xt)888 3025 y Ff(includecheckintext)p 1698 3055 V 105 w Fk(Mak)o(e)h(the)g (check)g(digits)g(visible)g(in)h(the)f(te)o(xt)515 3186 y Fi(Notes)41 b Fk(Check)19 b(digits)i(are)f(al)o(w)o(ays)g(added)f (automatically)-5 b(.)540 3987 y @beginspecial @setspecial tx@Dict begin STP newpath 0.8 SLW 0. setgray 0 0 moveto (0123456789ABCDEF) (includetext) plessey barcode end @endspecial 831 4169 a(Figure)19 b(16:)25 b Ff(\(012345ABCDEF\))47 b(\(includetext\))g(plessey)e(barcode)1905 5255 y Fk(20)p eop end %%Page: 21 24 TeXDict begin 21 23 bop 515 523 a Fj(5)119 b(License)515 756 y Fk(Cop)o(yright)894 753 y(c)871 756 y Fa(\015)p Fk(2004)19 b(T)-6 b(erry)20 b(Burton)515 903 y(Permission)27 b(is)i(hereby)d(granted,)i(free)f(of)h(char)o(ge,)g(to)g(an)o(y)f (person)f(obtaining)g(a)j(cop)o(y)e(of)g(this)515 1002 y(softw)o(are)c(and)g(associated)h(documentation)d(\002les)j(\(the)g (\224Softw)o(are\224\),)f(to)h(deal)f(in)h(the)g(Softw)o(are)515 1102 y(without)18 b(restriction,)h(including)e(without)i(limitation)f (the)i(rights)e(to)i(use,)f(cop)o(y)-5 b(,)18 b(modify)-5 b(,)17 b(mer)o(ge,)515 1202 y(publish,)f(distrib)n(ute,)h(sublicense,)g (and/or)f(sell)i(copies)f(of)g(the)g(Softw)o(are,)g(and)g(to)g(permit)f (persons)515 1301 y(to)k(whom)f(the)i(Softw)o(are)e(is)i(furnished)e (to)h(do)g(so,)g(subject)g(to)g(the)h(follo)n(wing)d(conditions:)515 1448 y(The)24 b(abo)o(v)o(e)g(cop)o(yright)e(notice)j(and)f(this)i (permission)d(notice)i(shall)g(be)g(included)e(in)i(all)h(copies)515 1548 y(or)20 b(substantial)g(portions)e(of)i(the)h(Softw)o(are.)515 1695 y(The)28 b(softw)o(are)h(is)g(pro)o(vided)e(\224as)i(is\224,)j (without)c(w)o(arranty)f(of)i(an)o(y)f(kind,)i(e)o(xpress)e(or)h (implied,)515 1794 y(including)24 b(b)n(ut)j(not)f(limited)g(to)g(the)h (w)o(arranties)e(of)h(merchantability)-5 b(,)25 b(\002tness)i(for)f(a)h (particular)515 1894 y(purpose)f(and)i(noninfringement.)45 b(In)28 b(no)g(e)n(v)o(ent)f(shall)i(the)f(authors)f(or)h(cop)o(yright) e(holders)i(be)515 1993 y(liable)19 b(for)g(an)o(y)g(claim,)g(damages)f (or)i(other)e(liability)-5 b(,)19 b(whether)f(in)i(an)f(action)g(of)g (contract,)g(tort)g(or)515 2093 y(otherwise,)25 b(arising)f(from,)h (out)g(of)f(or)h(in)g(connection)e(with)i(the)g(softw)o(are)f(or)h(the) g(use)g(or)f(other)515 2193 y(dealings)19 b(in)i(the)f(softw)o(are.) 1905 5255 y(21)p eop end %%Trailer userdict /end-hook known{end-hook}if %%EOF postscriptbarcode-2014-03-12/open-build-service/000077500000000000000000000000001231007474100213275ustar00rootroot00000000000000postscriptbarcode-2014-03-12/open-build-service/postscriptbarcode.spec000066400000000000000000000026271231007474100257440ustar00rootroot00000000000000Name: postscriptbarcode Version: %(date +%%Y%%m%%d).nightly Release: 1%{?dist} Summary: Barcode Writer in Pure PostScript Group: Development/Libraries/Other License: MIT URL: https://code.google.com/p/postscriptbarcode/ # https://github.com/terryburton/%{name}/archive/master.tar.gz Source0: postscriptbarcode-master.tar.gz BuildArch: noarch BuildRequires: ghostscript BuildRequires: perl # Required for EPEL5 <= 5 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %description Barcode Writer in Pure Postscript generates all barcode formats entirely within PostScript so that the process of converting the input data into the printed output can be performed by the printer or RIP itself. This is ideal for variable data printing (VDP) and avoids the need to re-implement the barcode generation process whenever your language needs change. %prep %setup -q -n %{name}-master %build fc-cache -f -v /usr/share/fonts/default/Type1 make -j `nproc` make test %install mkdir -p %{buildroot}/%{_datadir}/%{name} cp -p build/monolithic_package/barcode.ps %{buildroot}%{_datadir}/%{name}/barcode.ps %files %defattr(-,root,root) %doc CHANGES LICENSE README TODO docs/* %dir %{_datadir}/%{name}/ %{_datadir}/%{name}/barcode.ps %changelog * Fri Nov 08 2013 Terry Burton - 20131102-1 - Configure nightly OBS build postscriptbarcode-2014-03-12/redhat/000077500000000000000000000000001231007474100171025ustar00rootroot00000000000000postscriptbarcode-2014-03-12/redhat/postscriptbarcode.spec000066400000000000000000000043201231007474100235070ustar00rootroot00000000000000%global commit 5843dcc374d55db26287f3c23ffdb8d6b6a164ed %global shortcommit %(c=%{commit}; echo ${c:0:7}) Name: postscriptbarcode Version: 20131102 Release: 3%{?dist} Summary: Barcode Writer in Pure PostScript Group: Development/Libraries/Other License: MIT URL: https://code.google.com/p/postscriptbarcode/ #Source0: https://github.com/terryburton/postscriptbarcode/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz Source0: https://github.com/terryburton/postscriptbarcode/archive/5843dcc374d55db26287f3c23ffdb8d6b6a164ed/postscriptbarcode-20131102-5843dcc.tar.gz BuildArch: noarch BuildRequires: ghostscript BuildRequires: perl # Required for EPEL5 <= 5 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %description Barcode Writer in Pure Postscript generates all barcode formats entirely within PostScript so that the process of converting the input data into the printed output can be performed by the printer or RIP itself. This is ideal for variable data printing (VDP) and avoids the need to re-implement the barcode generation process whenever your language needs change. %prep %setup -q -n %{name}-%{commit} %build make -j `nproc` make test %install mkdir -p %{buildroot}/%{_datadir}/%{name} cp -p build/monolithic_package/barcode.ps %{buildroot}%{_datadir}/%{name}/barcode.ps %files %defattr(-,root,root) %doc CHANGES LICENSE README TODO docs/* %dir %{_datadir}/%{name}/ %{_datadir}/%{name}/barcode.ps %changelog * Fri Nov 08 2013 Terry Burton - 20131102-1 - Permanent download link from GitHub - Compatibility changes for old EPEL and SuSE * Thu Oct 31 2013 Mario Blättermann - 20131006-2 - Add folder ownership for %%{_datadir}/%%{name}/ * Wed Oct 23 2013 Mario Blättermann - 20131006-1 - New upstream version - Permanent download link instead of Google Drive * Tue Sep 03 2013 Mario Blättermann - 20130603-2 - Renamed to postscriptbarcode - Build from sources instead of copying the single Postscript file * Sun Sep 01 2013 Mario Blättermann - 20130603-1 - Initial package postscriptbarcode-2014-03-12/src/000077500000000000000000000000001231007474100164225ustar00rootroot00000000000000postscriptbarcode-2014-03-12/src/README.monolithic000066400000000000000000000032301231007474100214440ustar00rootroot00000000000000Barcode Writer in Pure PostScript http://www.terryburton.co.uk/barcodewriter/ The monolithic barcode.ps file provides Barcode Writer in Pure PostScript as generic PostScript Level 2 named resources shipped in a single file for ease of inclusion within the Prolog section of a PostScript document template or for installing into a printer's initial job VM. Inclusion Within the Prolog Section of a Document An application will first include the contents of barcode.ps in the Prolog section of a PostScript file and then generate code like the following. In the file's Setup or PageSetup section: /qrcode dup /uk.co.terryburton.bwipp findresource def and in the page description where a barcode is needed: 0 0 moveto (BWIPP) (eclevel=M) qrcode If the application needs to import the resource under a different name to avoid a conflict, then the setup could be: /foo /qrcode /uk.co.terryburton.bwipp findresource def followed by: 0 0 moveto (BWIPP1) (eclevel=M) foo 0 0 moveto (BWIPP2) (eclevel=M) foo ... (The above is analogous to 'from uk.co.terryburton.bwipp import qrcode as foo' in other languages.) Or, to generate a few barcodes with no setup section or local name at all: 0 0 moveto (BWIPP) (eclevel=M) /qrcode /uk.co.terryburton.bwipp findresource exec This technique also reduces the possibility of namespace collision when using the library's procedures with other code. Installing to a Printer Initial Job VM Send barcode.ps to the printer with the line "true () startjob" added at the top where the parentheses contain the printer's startjob password. The named resources will remain available between jobs but will not persist accoss power cycles. postscriptbarcode-2014-03-12/src/README.resource000066400000000000000000000076621231007474100211430ustar00rootroot00000000000000Barcode Writer in Pure PostScript http://www.terryburton.co.uk/barcodewriter/ The contents of the Resource directory provides Barcode Writer in Pure PostScript as generic PostScript Level 2 named resources split into seperate files structured for ease of deployment. This standard delivery mechanism allows BWIPP resources to be added to a PostScript virtual machine's resource search path, or pre-downloaded to a printer's memory or permanent storage, or supplied by a document manager, all without any change in the code an application generates to use the resources. An application or administrator must first make the BWIPP resources available to the print system as described for a variety of situations below. An application will then generate code like the following. In the file's Setup or PageSetup section: /qrcode dup /uk.co.terryburton.bwipp findresource def and in the page description where a barcode is needed: 0 0 moveto (BWIPP) (eclevel=M) qrcode If the application needs to import the resource under a different name to avoid a conflict, then the setup could be: /foo /qrcode /uk.co.terryburton.bwipp findresource def followed by: 0 0 moveto (BWIPP1) (eclevel=M) foo 0 0 moveto (BWIPP2) (eclevel=M) foo ... (The above is analogous to 'from uk.co.terryburton.bwipp import qrcode as foo' in other languages.) Or, to generate a few barcodes with no setup section or local name at all: 0 0 moveto (BWIPP) (eclevel=M) /qrcode /uk.co.terryburton.bwipp findresource exec This technique also reduces the possibility of namespace collision when using the library's procedures with other code. If the definitions for the routines that generate and render the barcode are not already resident in memory then they will be fetched from a standard resource location in a way that is transparent to the user. GhostScript Unpack the contents of the Resource directory to somewhere accessible to the application. Specify the location of the Resource files using the -sGenericResourceDir parameter. Where this defaults to ./Resource (or equivalent) you can omit this parameter when running GhostScript from the location of the Resource files. A note for Windows users: "The Windows pre-built Ghostscript binary uses a ROM file system. If you want to modify the Resources available, then … put all the required resources on disk and tell Ghostscript to use the disk-based resources. … You will need to download the Ghostscript source (the Resources are not currently available separately) … modify the Resources directory and tell Ghostscript to use it by adding one of the relevant command line switches (-I, -sGenericResourceDir) or possibly by setting the GS_LIB environment variable." Thanks to Ken Sharp, http://ghostscript.com/pipermail/gs-devel/2013-December/009544.html Adobe Distiller Unpack the contents of the Resource directory to somewhere accessible to the application. Ensure that PSRESOURCEPATH contains the directory containing the .upr file when Distiller is run. The contents should be a list of directories separated by colons, to be searched in order with two consecutive colons to indicate where the default location should fall within the search order. Printer Hard Disk If a printer with a hard disk option is used, the resources can be downloaded once and remain available across power cycles. Resources can be downloaded with a vendor-specific tool, or by sending them to the printer with a snippet of PostScript at the top that queries the printer for the correct file name and creates the file. PostScript Document Manager Unpack the contents of the Resource directory to somewhere accessible to your document manager software then include the %%DocumentNeededResources and %%IncludeResource DSC comments at the appropriate locations within your PostScript output. The document manager software can be configured to transparently insert the requested resources as necessary. Any specific instuctions for common document manager software are welcome. postscriptbarcode-2014-03-12/src/VERSION000066400000000000000000000000131231007474100174640ustar00rootroot000000000000002014-03-12 postscriptbarcode-2014-03-12/src/auspost.ps000066400000000000000000000171661231007474100204770ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER auspost-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: AusPost 4 State Customer Code % --EXAM: 5956439111ABA 9 % --EXOP: includetext custinfoenc=character % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /auspost { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 0.175 def /custinfoenc (character) def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Create an array containing the character mappings /encs [ (000) (001) (002) (010) (011) (012) (020) (021) (022) (100) (101) (102) (110) (111) (112) (120) (121) (122) (200) (201) (202) (210) (211) (212) (220) (221) (222) (300) (301) (302) (310) (311) (312) (320) (321) (322) (023) (030) (031) (032) (033) (103) (113) (123) (130) (131) (132) (133) (203) (213) (223) (230) (231) (232) (233) (303) (313) (323) (330) (331) (332) (333) (003) (013) (00) (01) (02) (10) (11) (12) (20) (21) (22) (30) (13) (3) ] def % Create a string of the available characters /barchars (ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz #) def /barlen barcode length def barcode 0 2 getinterval (11) eq {37} if barcode 0 2 getinterval (45) eq {37} if barcode 0 2 getinterval (59) eq {52} if barcode 0 2 getinterval (62) eq {67} if /encstr exch string def /txt barlen 2 sub array def % Put start character encstr 0 encs 74 get putinterval % Encode the FCC 0 1 1 { /i exch def encs barcode i 1 getinterval cvi 64 add get encstr i 2 mul 2 add 3 2 roll putinterval } for % Encode the DPID 2 1 9 { /i exch def encs barcode i 1 getinterval cvi 64 add get encstr i 2 mul 2 add 3 2 roll putinterval txt i 2 sub [barcode i 1 getinterval i 2 sub 2 mul 6 add 3.312 mul textyoffset textfont textsize] put } for % Encode the customer information custinfoenc (numeric) eq { 0 1 barlen 11 sub { /i exch def encs barcode i 10 add 1 getinterval cvi 64 add get encstr i 2 mul 22 add 3 2 roll putinterval txt i 8 add [barcode i 10 add 1 getinterval i 2 mul 22 add 3.312 mul textyoffset textfont textsize] put } for /ciflen barlen 10 sub 2 mul def } { 0 1 barlen 11 sub { /i exch def barcode i 10 add 1 getinterval barchars exch search pop length /indx exch def pop pop /enc encs indx get def encstr i 3 mul 22 add enc putinterval txt i 8 add [barcode i 10 add 1 getinterval i 3 mul 22 add 3.312 mul textyoffset textfont textsize] put } for /ciflen barlen 10 sub 3 mul def } ifelse % Add any filler characters 22 ciflen add 1 encstr length 14 sub { encstr exch encs 75 get putinterval } for % Create the 64x64 Reed-Solomon table /rstable 64 64 mul array def rstable 0 [ 64 {0} repeat ] putinterval rstable 64 [ 0 1 63 {} for ] putinterval /prev 1 def 64 { /next prev 1 bitshift def next 64 and 0 ne { /next next 67 xor def } if 0 1 63 { /j exch def /nextcell {rstable 64 next mul j add} def nextcell rstable 64 prev mul j add get 1 bitshift put nextcell get 64 and 0 ne { nextcell nextcell get 67 xor put } if } for /prev next def } repeat % Calculate the Reed-Solomon codes for triples /rscodes encstr length 16 sub 3 idiv 4 add array def rscodes 0 [ 4 {0} repeat ] putinterval 2 3 encstr length 16 sub { /i exch def rscodes rscodes length i 2 sub 3 idiv sub 1 sub encstr i 1 getinterval cvi 16 mul encstr i 1 add 1 getinterval cvi 4 mul add encstr i 2 add 1 getinterval cvi add put } for rscodes length 5 sub -1 0 { /i exch def 0 1 4 { /j exch def rscodes i j add rscodes i j add get rstable 64 [48 17 29 30 1] j get mul rscodes i 4 add get add get xor put } for } for /checkcode (000000000000) 12 string copy def 0 1 3 { /i exch def /enc rscodes 3 i sub get 4 3 string cvrs def checkcode i 3 mul 3 enc length sub add enc putinterval } for % Put checkcode and end characters encstr encstr length 14 sub checkcode putinterval encstr encstr length 2 sub encs 74 get putinterval /bbs encstr length array def /bhs encstr length array def 0 1 encstr length 1 sub { /i exch def /enc encstr i 1 getinterval def enc (0) eq { bbs i 0 height mul 8 div put bhs i 8 height mul 8 div put } if enc (1) eq { bbs i 3 height mul 8 div put bhs i 5 height mul 8 div put } if enc (2) eq { bbs i 0 height mul 8 div put bhs i 5 height mul 8 div put } if enc (3) eq { bbs i 3 height mul 8 div put bhs i 2 height mul 8 div put } if } for % Return the arguments << /ren //renlinear /bbs bbs /bhs bhs /sbs [bhs length 1 sub {1.44 1.872} repeat 1.44] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /auspost dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER auspost-- postscriptbarcode-2014-03-12/src/azteccode.ps000066400000000000000000000376631231007474100207460ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER azteccode-- % --REQUIRES preamble raiseerror renmatrix-- % --DESC: Aztec Code % --EXAM: This is Aztec Code % --EXOP: format=full % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /azteccode { 20 dict begin /options exch def /barcode exch def /dontdraw false def /format (unset) def % full, compact or rune /readerinit false def /layers -1 def /eclevel 23 def /ecaddchars 3 def /raw false def /parse false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /layers layers cvi def /eclevel eclevel cvr def /ecaddchars ecaddchars cvi def % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if % Convert from input into message bitstream /msgbits () def format (rune) ne raw and {/msgbits barcode def} if format (rune) ne raw not and { % Simple autoencoder from input to bitstream using byte mode only % Determine the character count /barlen barcode length def barlen 31 le { (00000) 5 string copy dup barlen 2 5 string cvrs dup length 5 exch sub exch putinterval /cc exch def } { (0000000000000000) 16 string copy dup barlen 31 sub 2 16 string cvrs dup length 16 exch sub exch putinterval /cc exch def } ifelse /cclen cc length def % Create the bitstream as byte_mode_id character_count data_bytes /msgbits 5 cclen add barlen 8 mul add string def msgbits 0 (11111) putinterval msgbits 5 cc putinterval 0 1 barlen 1 sub { /i exch def (00000000) 8 string copy dup barcode i get cvi 2 8 string cvrs dup length 8 exch sub exch putinterval msgbits 5 cclen add i 8 mul add 3 -1 roll putinterval } for } if % Lookup the most appropriate symbol specification /metrics [ [ (rune) 0 0 0 6 ] % Special metric for rune symbols [ (compact) 1 1 17 6 ] [ (full) 1 1 21 6 ] [ (compact) 2 0 40 6 ] [ (full) 2 1 48 6 ] [ (compact) 3 0 51 8 ] [ (full) 3 1 60 8 ] [ (compact) 4 0 76 8 ] [ (full) 4 1 88 8 ] [ (full) 5 1 120 8 ] [ (full) 6 1 156 8 ] [ (full) 7 1 196 8 ] [ (full) 8 1 240 8 ] [ (full) 9 1 230 10 ] [ (full) 10 1 272 10 ] [ (full) 11 1 316 10 ] [ (full) 12 1 364 10 ] [ (full) 13 1 416 10 ] [ (full) 14 1 470 10 ] [ (full) 15 1 528 10 ] [ (full) 16 1 588 10 ] [ (full) 17 1 652 10 ] [ (full) 18 1 720 10 ] [ (full) 19 1 790 10 ] [ (full) 20 1 864 10 ] [ (full) 21 1 940 10 ] [ (full) 22 1 1020 10 ] [ (full) 23 0 920 12 ] [ (full) 24 0 992 12 ] [ (full) 25 0 1066 12 ] [ (full) 26 0 1144 12 ] [ (full) 27 0 1224 12 ] [ (full) 28 0 1306 12 ] [ (full) 29 0 1392 12 ] [ (full) 30 0 1480 12 ] [ (full) 31 0 1570 12 ] [ (full) 32 0 1664 12 ] ] def /i 0 def { % loop /m metrics i get def /frmt m 0 get def % Format of the symbol /mlyr m 1 get def % Data layers /icap m 2 get def % Reader initialisation capable /ncws m 3 get def % Total of codewords /bpcw m 4 get def % Bits per codeword /numecw ncws eclevel mul 100 div ecaddchars add ceiling cvi def msgbits length 0 eq {/numecw 0 def} if % Error correction codewords /numdcw ncws numecw sub def % Data codewords /okay true def format (unset) ne format frmt ne and {/okay false def} if readerinit icap 1 ne and {/okay false def} if layers -1 ne layers mlyr ne and {/okay false def} if msgbits length bpcw div ceiling cvi numdcw gt {/okay false def} if okay {exit} if /i i 1 add def } loop /layers mlyr def /format frmt def % Expand message bits into codewords avoiding codewords with all zeros or all ones /allzero {dup length (000000000000) 0 3 -1 roll getinterval eq} bind def /allones {dup length (111111111111) 0 3 -1 roll getinterval eq} bind def /cws ncws array def /m 0 def /c 0 def { msgbits length m le {exit} if msgbits length m sub bpcw ge { /cwb msgbits m bpcw 1 sub getinterval def % All but last bit /cwf msgbits m bpcw add 1 sub 1 getinterval def % Last bit cwb allzero {/cwf (1) def /m m 1 sub def} if % Flip last bit to avoid zeros cwb allones {/cwf (0) def /m m 1 sub def} if % Flip last bit to avoid ones % Concatinate the bits 12 string dup 0 cwb putinterval dup bpcw 1 sub cwf putinterval 0 bpcw getinterval /cwb exch def } { % Final codeword /cwb msgbits m msgbits length m sub getinterval def /cwb (111111111111) 12 string copy dup 0 cwb putinterval 0 bpcw getinterval def cwb allones {cwb cwb length 1 sub (0) putinterval} if % Prevent all ones } ifelse % Conversion of binary data into byte array /cw 0 def 0 1 bpcw 1 sub { /i exch def /cw cw 2 bpcw i sub 1 sub exp cvi cwb i get 48 sub mul add def } for cws c cw put /m m bpcw add def /c c 1 add def } loop /cws cws 0 c getinterval def % Reed-Solomon algorithm /rscodes { /rspm exch def /rsgf exch def /rsnc exch def /rscws exch def % Calculate the log and anti-log tables /rsalog [ 1 rsgf 1 sub { dup 2 mul dup rsgf ge {rspm xor} if } repeat ] def /rslog rsgf array def 1 1 rsgf 1 sub {dup rsalog exch get exch rslog 3 1 roll put} for % Function to calculate the product in the field /rsprod { 2 copy 0 ne exch 0 ne and { rslog exch get exch rslog exch get add rsgf 1 sub mod rsalog exch get } { pop pop 0 } ifelse } bind def % Generate the coefficients /coeffs [ 1 rsnc {0} repeat ] def 1 1 rsnc { /i exch def coeffs i coeffs i 1 sub get put i 1 sub -1 1 { /j exch def coeffs j coeffs j 1 sub get coeffs j get rsalog i get rsprod xor put } for coeffs 0 coeffs 0 get rsalog i get rsprod put } for % Extend the input with the error correction values /nd rscws length def /rscws [ rscws {} forall rsnc {0} repeat 0 ] def 0 1 nd 1 sub { /k exch rscws exch get rscws nd get xor def 0 1 rsnc 1 sub { /j exch def rscws nd j add rscws nd j add 1 add get k coeffs rsnc j sub 1 sub get rsprod xor put } for } for % Return all but the last codeword rscws 0 rscws length 1 sub getinterval } bind def % Create the codewords and bit string for the mode format (full) eq { /mode layers 1 sub 11 bitshift cws length 1 sub add def readerinit {/mode mode 2#0000010000000000 or def} if /mode [ mode 2#1111000000000000 and -12 bitshift mode 2#0000111100000000 and -8 bitshift mode 2#0000000011110000 and -4 bitshift mode 2#0000000000001111 and ] def /mode mode 6 16 19 rscodes def } if format (compact) eq { /mode layers 1 sub 6 bitshift cws length 1 sub add def readerinit {/mode mode 2#00100000 or def} if /mode [ mode 2#11110000 and -4 bitshift mode 2#00001111 and ] def /mode mode 5 16 19 rscodes def } if format (rune) eq { /mode barcode cvi def /mode [ mode 2#11110000 and -4 bitshift mode 2#00001111 and ] def /mode mode 5 16 19 rscodes def /mode [mode {2#1010 xor} forall] def % Invert alternate bits } if /modebits mode length 4 mul string def 0 1 modebits length 1 sub {modebits exch (0) putinterval} for 0 1 mode length 1 sub { /i exch def modebits mode i get 2 4 string cvrs dup length 4 exch sub 4 i mul add exch putinterval } for % Extend the data codewords with error correction codewords to create the bit string for the data /rsparams [ [] [] [] [] [] [] [ 64 67 ] % 6-bit codewords [] [ 256 301 ] % 8-bit codewords [] [ 1024 1033 ] % 10-bit codewords [] [ 4096 4201 ] % 12-bit codewords ] def /cws cws ncws cws length sub rsparams bpcw get {} forall rscodes def format (full) eq { /databits layers layers mul 16 mul layers 112 mul add string def } { /databits layers layers mul 16 mul layers 88 mul add string def } ifelse 0 1 databits length 1 sub {databits exch (0) putinterval} for 0 1 ncws 1 sub { /i exch def databits cws i get 2 bpcw string cvrs dup length bpcw exch sub bpcw i mul add databits length ncws bpcw mul sub add exch putinterval } for % Move to a point in the cartesian plane centered on the bullseye /cmv {size mul sub mid add} bind def % Move to a bit position within a layer /lmv { /lbit exch def /llyr exch def /lwid fw llyr 4 mul add def /ldir lbit 2 idiv lwid idiv def ldir 0 eq { % Top lwid 1 sub 2 idiv neg 1 add lbit 2 idiv lwid mod add fw 1 sub 2 idiv llyr 2 mul add lbit 2 mod add cmv } if ldir 1 eq { % Right fw 2 idiv llyr 2 mul add lbit 2 mod add lwid 1 sub 2 idiv 1 sub lbit 2 idiv lwid mod sub cmv } if ldir 2 eq { % Bottom lwid 2 idiv neg 1 add lbit 2 idiv lwid mod add neg fw 2 idiv llyr 2 mul add lbit 2 mod add neg cmv } if ldir 3 eq { % Left fw 1 sub 2 idiv llyr 2 mul add lbit 2 mod add neg lwid 2 idiv 1 sub lbit 2 idiv lwid mod sub neg cmv } if } bind def % Create the pixel map % For full symbols we disregard the reference grid at this stage format (full) eq {/fw 12 def} {/fw 9 def} ifelse /size fw layers 4 mul add 2 add def /pixs [size size mul {-1} repeat] def /mid size 1 sub 2 idiv size mul size 1 sub 2 idiv add def % Data layers /i 0 def 1 1 layers { /layer exch def 0 1 fw layer 4 mul add 8 mul 1 sub { /pos exch def pixs layer pos lmv databits databits length i sub 1 sub get 48 sub put /i i 1 add def } for } for % For full symbols expand the pixel map by inserting the reference grid format (full) eq { /fw 13 def /size fw layers 4 mul add 2 add layers 10.5 add 7.5 div 1 sub cvi 2 mul add def /mid size size mul 2 idiv def /npixs [size size mul {-2} repeat] def 0 16 size 2 idiv { /i exch def 0 1 size 1 sub { /j exch def npixs size 2 idiv neg j add i cmv [size 2 idiv j add i add 1 add 2 mod] putinterval npixs size 2 idiv neg j add i neg cmv [size 2 idiv j add i add 1 add 2 mod] putinterval npixs i size 2 idiv neg j add cmv [size 2 idiv j add i add 1 add 2 mod] putinterval npixs i neg size 2 idiv neg j add cmv [size 2 idiv j add i add 1 add 2 mod] putinterval } for } for /j 0 def 0 1 npixs length 1 sub { /i exch def npixs i get -2 eq { npixs i pixs j get put /j j 1 add def } if } for /pixs npixs def } if % Finder pattern /fw fw 2 idiv def fw neg 1 fw { /i exch def fw neg 1 fw { /j exch def pixs i j cmv i abs j abs gt {i abs} {j abs} ifelse 1 add 2 mod put } for } for % Orientation bits [ [ fw 1 add neg fw 1 ] [ fw 1 add neg fw 1 add 1 ] [ fw neg fw 1 add 1 ] [ fw 1 add fw 1 add 1 ] [ fw 1 add fw 1 ] [ fw 1 add fw neg 1 ] [ fw fw 1 add 0 ] [ fw 1 add fw 1 add neg 0 ] [ fw fw 1 add neg 0 ] [ fw neg fw 1 add neg 0 ] [ fw 1 add neg fw 1 add neg 0 ] [ fw 1 add neg fw neg 0 ] ] {pixs exch {} forall 3 1 roll cmv exch put} forall % Mode ring format (full) eq { /modemap [ [-5 7] [-4 7] [-3 7] [-2 7] [-1 7] [ 1 7] [ 2 7] [ 3 7] [ 4 7] [ 5 7] [ 7 5] [ 7 4] [ 7 3] [ 7 2] [ 7 1] [ 7 -1] [ 7 -2] [ 7 -3] [ 7 -4] [ 7 -5] [ 5 -7] [ 4 -7] [ 3 -7] [ 2 -7] [ 1 -7] [-1 -7] [-2 -7] [-3 -7] [-4 -7] [-5 -7] [-7 -5] [-7 -4] [-7 -3] [-7 -2] [-7 -1] [-7 1] [-7 2] [-7 3] [-7 4] [-7 5] ] def } { /modemap [ [-3 5] [-2 5] [-1 5] [ 0 5] [ 1 5] [ 2 5] [ 3 5] [ 5 3] [ 5 2] [ 5 1] [ 5 0] [ 5 -1] [ 5 -2] [ 5 -3] [ 3 -5] [ 2 -5] [ 1 -5] [ 0 -5] [-1 -5] [-2 -5] [-3 -5] [-5 -3] [-5 -2] [-5 -1] [-5 0] [-5 1] [-5 2] [-5 3] ] def } ifelse 0 1 modemap length 1 sub { /i exch def pixs modemap i get {} forall cmv modebits i get 48 sub put } for << /ren //renmatrix /pixs pixs /pixx size /pixy size /height size 2 mul 72 div /width size 2 mul 72 div /opt options >> dontdraw not //renmatrix if end } bind def /azteccode dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER azteccode-- postscriptbarcode-2014-03-12/src/bc412.ps000066400000000000000000000131211231007474100175770ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER bc412-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: BC412 % --EXAM: BC412 % --EXOP: semi includetext includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /bc412 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includecheck false def /validatecheck false def /includetext false def /includecheckintext false def /includestartstop false def /semi false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def semi { /includecheck true def /includestartstop true def } if % Create a string of the available characters /barchars (0R9GLVHA8EZ4NTS1J2Q6C7DYKBUIX3FWP5M) def /charvals 35 dict def 0 1 34 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.bc412badCharacter (BC412 must contain only digits and capital letters except O) //raiseerror exec } if } for /barlen barcode length validatecheck {1 sub} if def /checksum 0 def 0 1 barlen 1 sub { barcode exch 1 getinterval charvals exch get checksum add /checksum exch def } for /checksum checksum 35 mod def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.bc412badCheckDigit (Incorrect BC412 check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def /includecheck true def } if % Create an array containing the character mappings /encs [ (11111115) (13111212) (11131113) (12111213) (12121311) (13131111) (12111312) (11131212) (11121411) (11151111) (15111111) (11111511) (12131211) (13121112) (13111212) (11111214) (12121113) (11111313) (13111113) (11121213) (11141112) (11121312) (11141211) (14121111) (12121212) (11131311) (13121211) (12111411) (14111211) (11111412) (12111114) (14111112) (12141111) (11121114) (12131112) (12) (111) ] def /sbs barlen 1 add 8 mul 5 add string def includecheck { /txt barlen 1 add array def } { /txt barlen array def } ifelse % Put the start character includestartstop { sbs 0 encs 35 get putinterval /pos 2 def /txtpos 3 def } { /pos 0 def /txtpos 0 def } ifelse 0 1 barlen 1 sub { /i exch def /indx charvals barcode i 1 getinterval get def sbs pos encs indx get putinterval txt i [barcode i 1 getinterval i 12 mul txtpos add textyoffset textfont textsize] put /pos pos 8 add def } for % Put the checksum includecheck { sbs pos encs checksum get putinterval includecheckintext { txt barlen [barchars checksum 1 getinterval barlen 12 mul txtpos add textyoffset textfont textsize] put } { txt barlen [() barlen 12 mul txtpos add textyoffset textfont textsize] put } ifelse /pos pos 8 add def } if % Put the stop character includestartstop { sbs pos encs 36 get putinterval /pos pos 2 add def } if % Return the arguments /sbs sbs 0 pos getinterval def << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /bc412 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER bc412-- postscriptbarcode-2014-03-12/src/channelcode.ps000066400000000000000000000126621231007474100212400ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER channelcode-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Channel Code % --EXAM: 3493 % --EXOP: height=0.5 includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /channelcode { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /shortfinder false def /includetext false def /includecheck false def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /height height cvr def % Validate the input barcode length 2 lt barcode length 7 gt or { /bwipp.channelcodeBadLength (Channel Code must be 2 to 7 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.channelcodeBadCharacter (Channel Code must contain only digits) //raiseerror exec } if } forall barcode cvi [ 26 292 3493 44072 576688 7742862 ] barcode length 2 sub get gt { /bwipp.channelcodeTooBig (The Channel Code value is too big for the number of channels) //raiseerror exec } if /nextb { dup dup s exch get exch dup b exch 1 sub get exch dup s exch 1 sub get exch b exch 2 sub get exch add add add 4 gt {1} {2} ifelse 1 index chan 2 add lt { dup 1 4 index { b 3 index 2 index put 3 index exch sub 1 add 4 index 3 index 1 add nexts } for } { dup 3 index le { b 2 index 4 index put value target eq { /out [ 3 1 10 {dup s exch get exch b exch get} for ] 0 chan 2 mul getinterval def } if /value value 1 add def } if } ifelse pop pop pop pop } bind def /nexts { dup chan 2 add lt {1} {1 index} ifelse 1 3 index { s 2 index 2 index put 2 index exch sub 1 add 3 index 2 index nextb } for pop pop pop } bind def /encode { /chan exch def /target exch def /value 0 def /out -1 def /b [ 1 1 1 0 0 0 0 0 0 0 0 ] def /s [ 0 1 1 0 0 0 0 0 0 0 0 ] def chan dup 3 nexts out } bind def /barlen barcode length def % Determine finder /finder shortfinder { [ 1 1 1 1 1 ] } { [ 1 1 1 1 1 1 1 1 1 ] } ifelse def % Encode the main data /data barcode cvi barlen 1 add encode def % Determine check data /check [] def includecheck { /mod23 [ [] [] [ 13 12 4 9 3 1 ] [ 13 2 12 3 18 16 4 1 ] [ 11 16 17 8 20 4 10 2 5 1 ] [ 1 4 16 18 3 12 2 8 9 13 6 1 ] [ 20 16 22 13 15 12 5 4 8 9 21 3 7 1 ] [ 2 6 18 8 1 3 9 4 12 13 16 2 6 18 8 1 ] ] barlen get def 0 0 1 data length 1 sub { dup data exch get 1 sub exch mod23 exch get mul add } for 23 mod 3 encode /check exch def } if % Construct the symbol /sbs [ finder aload pop data aload pop check aload pop ] def % Create the human readable text /txt barlen array def 0 1 barlen 1 sub { /i exch def txt i [barcode i 1 getinterval 0 0 () 0] put } for % Return the arguments << /ren //renlinear /sbs sbs /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] /txt txt /textxalign (center) /opt options >> dontdraw not //renlinear if end } bind def /channelcode dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER channelcode-- postscriptbarcode-2014-03-12/src/codablockf.ps000066400000000000000000000447661231007474100210760ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER codablockf-- % --REQUIRES preamble raiseerror renmatrix-- % --DESC: Codablock F % --EXAM: CODABLOCK F 34567890123456789010040digit % --EXOP: columns=8 % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /codablockf { 20 dict begin /options exch def /barcode exch def /dontdraw false def /rows -1 def /columns 8 def /rowheight 10 def /sepheight 1 def /encoding (auto) def /parse false def /parsefnc false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /rows rows cvi def /columns columns cvi def /rowheight rowheight cvi def /sepheight sepheight cvi def columns 4 ge columns 62 le and rows 2 ge rows 44 le and rows -1 eq or and {/c columns def} if % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if /barlen barcode length def % Convert input into bytes accounting for FNC characters /swa -1 def /swb -2 def /swc -3 def /sft -4 def /fn1 -5 def /fn2 -6 def /fn3 -7 def /fn4 -8 def /sta -9 def /stp -10 def % Character maps for each state /charmaps [ % A B C A B C A B C [ 32 32 (00) ] [ (!) (!) (01) ] [ (") (") (02) ] % 0-2 [ (#) (#) (03) ] [ ($) ($) (04) ] [ (%) (%) (05) ] % 3-5 [ (&) (&) (06) ] [ (') (') (07) ] [ 40 40 (08) ] % 6-8 [ 41 41 (09) ] [ (*) (*) (10) ] [ (+) (+) (11) ] % 9-11 [ (,) (,) (12) ] [ (-) (-) (13) ] [ (.) (.) (14) ] % 12-14 [ (/) (/) (15) ] [ (0) (0) (16) ] [ (1) (1) (17) ] % 15-17 [ (2) (2) (18) ] [ (3) (3) (19) ] [ (4) (4) (20) ] % 18-20 [ (5) (5) (21) ] [ (6) (6) (22) ] [ (7) (7) (23) ] % 21-23 [ (8) (8) (24) ] [ (9) (9) (25) ] [ (:) (:) (26) ] % 24-26 [ (;) (;) (27) ] [ (<) (<) (28) ] [ (=) (=) (29) ] % 27-29 [ (>) (>) (30) ] [ (?) (?) (31) ] [ (@) (@) (32) ] % 30-32 [ (A) (A) (33) ] [ (B) (B) (34) ] [ (C) (C) (35) ] % 33-35 [ (D) (D) (36) ] [ (E) (E) (37) ] [ (F) (F) (38) ] % 36-38 [ (G) (G) (39) ] [ (H) (H) (40) ] [ (I) (I) (41) ] % 39-41 [ (J) (J) (42) ] [ (K) (K) (43) ] [ (L) (L) (44) ] % 42-44 [ (M) (M) (45) ] [ (N) (N) (46) ] [ (O) (O) (47) ] % 45-47 [ (P) (P) (48) ] [ (Q) (Q) (49) ] [ (R) (R) (50) ] % 48-50 [ (S) (S) (51) ] [ (T) (T) (52) ] [ (U) (U) (53) ] % 51-53 [ (V) (V) (54) ] [ (W) (W) (55) ] [ (X) (X) (56) ] % 54-56 [ (Y) (Y) (57) ] [ (Z) (Z) (58) ] [ ([) ([) (59) ] % 57-59 [ 92 92 (60) ] [ (]) (]) (61) ] [ (^) (^) (62) ] % 60-62 [ (_) (_) (63) ] [ 0 (`) (64) ] [ 1 (a) (65) ] % 63-65 [ 2 (b) (66) ] [ 3 (c) (67) ] [ 4 (d) (68) ] % 66-68 [ 5 (e) (69) ] [ 6 (f) (70) ] [ 7 (g) (71) ] % 69-71 [ 8 (h) (72) ] [ 9 (i) (73) ] [ 10 (j) (74) ] % 72-74 [ 11 (k) (75) ] [ 12 (l) (76) ] [ 13 (m) (77) ] % 75-77 [ 14 (n) (78) ] [ 15 (o) (79) ] [ 16 (p) (80) ] % 78-80 [ 17 (q) (81) ] [ 18 (r) (82) ] [ 19 (s) (83) ] % 81-83 [ 20 (t) (84) ] [ 21 (u) (85) ] [ 22 (v) (86) ] % 84-86 [ 23 (w) (87) ] [ 24 (x) (88) ] [ 25 (y) (89) ] % 87-89 [ 26 (z) (90) ] [ 27 ({) (91) ] [ 28 (|) (92) ] % 90-92 [ 29 (}) (93) ] [ 30 (~) (94) ] [ 31 127 (95) ] % 93-95 [ fn3 fn3 (96) ] [ fn2 fn2 (97) ] [ sft sft (98) ] % 96-98 [ swc swc (99) ] [ swb fn4 swb ] [ fn4 swa swa ] % 99-101 [ fn1 fn1 fn1 ] [ sta sta sta ] [ stp stp stp ] % 102-104 ] def % Invert charmaps to give character to value maps for each state /charvals [ 105 dict 105 dict 105 dict ] def 0 1 charmaps length 1 sub { /i exch def /encs charmaps i get def 0 1 2 { /j exch def encs j get dup type /stringtype eq {0 get} if % convert string to ASCII if required charvals j get exch i put } for } for /seta charvals 0 get def /setb charvals 1 get def /setc charvals 2 get def /fncvals << (FNC1) fn1 (FNC2) fn2 (FNC3) fn3 (FNC4) fn4 >> def /msg barlen array def /i 0 def /j 0 def { i barlen eq {exit} if /char barcode i get def parsefnc char 94 eq and i barlen 4 sub lt and { barcode i 1 add get 94 ne { /char fncvals barcode i 1 add 4 getinterval get def /i i 4 add def } { /i i 1 add def } ifelse } if msg j char put /i i 1 add def /j j 1 add def } loop /msg msg 0 j getinterval def /msglen msg length def % Determine digit runlength and characters from given position /numsscr { /n 0 def /s 0 def /p exch def { p msglen ge {exit} if msg p get dup setc exch known not {pop exit} if fn1 eq { % FNC1 in odd position of run like two digits s 2 mod 0 eq {/s s 1 add def} {exit} ifelse } if /n n 1 add def /s s 1 add def /p p 1 add def } loop n s } bind def % Encoding for each alphabet /enca { seta exch get cws exch j exch put /j j 1 add def } bind def /encb { setb exch get cws exch j exch put /j j 1 add def } bind def /encc { dup type /arraytype ne { setc exch get } { aload pop 48 sub exch 48 sub 10 mul add } ifelse cws exch j exch put /j j 1 add def } bind def % Character exclusively in either alphabet A or B /anotb {dup seta exch known exch setb exch known not and} bind def /bnota {dup setb exch known exch seta exch known not and} bind def % Pre-compute relative position of next anotb and next bnota characters /nextanotb [ msg length {0} repeat 9999 ] def /nextbnota [ msg length {0} repeat 9999 ] def msg length 1 sub -1 0 { /i exch def msg i get anotb { nextanotb i 0 put } { nextanotb i nextanotb i 1 add get 1 add put } ifelse msg i get bnota { nextbnota i 0 put } { nextbnota i nextbnota i 1 add get 1 add put } ifelse } for % Does a-only come before b-only after given position and vice versa /abeforeb {dup nextanotb exch get exch nextbnota exch get lt} bind def /bbeforea {dup nextbnota exch get exch nextanotb exch get lt} bind def % Add padding to row /padrow { { { % common exit cset (seta) eq {swc enca /cset (setc) def exit} if cset (setb) eq {swc encb /cset (setc) def exit} if cset (setc) eq {swb encc /cset (setb) def exit} if } loop } repeat } bind def % Convert message to codewords /cws c 5 add rows -1 ne {rows} {44} ifelse mul array def /i 0 def /j 0 def /r 1 def /lastrow false def { lastrow {exit} if % Add start character and code subset selector sta enca i msglen lt {i numsscr} {-1 -1} ifelse /nums exch def /nchars exch def { % common exit msglen 0 eq { swb enca /cset (setb) def exit } if nums 2 ge { swc enca /cset (setc) def exit } if i abeforeb { sft enca /cset (seta) def exit } if swb enca /cset (setb) def exit } loop /j j 1 add def % Skip row indicator position % Main encoding loop /endofrow false def { /rem c 3 add j c 5 add mod sub def % Codewords to end of row i msglen eq endofrow or {exit} if i numsscr /nums exch def /nchars exch def % Determine switches and shifts { % common exit cset (seta) eq cset (setb) eq or nums 4 ge and msg i get fn1 ne and { nums 2 mod 0 eq rem 3 ge and { swc cset (seta) eq {enca} {encb} ifelse /cset (setc) def 2 { msg i get fn1 eq { fn1 encc /i i 1 add def } { msg i 2 getinterval encc /i i 2 add def } ifelse } repeat exit } if nums 2 mod 0 ne rem 4 ge and { msg i get cset (seta) eq {enca} {encb} ifelse /i i 1 add def swc cset (seta) eq {enca} {encb} ifelse /cset (setc) def 2 { msg i get fn1 eq { fn1 encc /i i 1 add def } { msg i 2 getinterval encc /i i 2 add def } ifelse } repeat exit } if } if cset (setb) eq msg i get anotb and rem 2 ge and { i msglen 1 sub lt { i 1 add bbeforea { sft encb msg i get enca /i i 1 add def exit } if } if swa encb /cset (seta) def msg i get enca /i i 1 add def exit } if cset (seta) eq msg i get bnota and rem 2 ge and { i msglen 1 sub lt { i 1 add abeforeb { sft enca msg i get encb /i i 1 add def exit } if } if swb enca /cset (setb) def msg i get encb /i i 1 add def exit } if cset (setc) eq nums 2 lt and rem 2 ge and { i abeforeb { swa encc /cset (seta) def msg i get enca /i i 1 add def exit } if swb encc /cset (setb) def msg i get encb /i i 1 add def exit } if % No switches or latches so try to encode cset (seta) eq seta msg i get known and rem 1 ge and { msg i get enca /i i 1 add def exit } if cset (setb) eq setb msg i get known and rem 1 ge and { msg i get encb /i i 1 add def exit } if cset (setc) eq nums 2 ge and rem 1 ge and { msg i get fn1 eq { fn1 encc /i i 1 add def } { msg i 2 getinterval encc /i i 2 add def } ifelse exit } if % Encoding does not fit in the row /endofrow true def exit } loop % common exit } loop % Determine whether this is the final row r rows eq rows -1 eq or r 1 gt and i msglen eq and rem 2 ge and { rem 2 sub padrow /j j 3 add def % Skip symbol and row checksum character positions stp enca /lastrow true def } { rem padrow /j j 1 add def % Skip row checksum character positions stp enca /r r 1 add def } ifelse } loop /cws cws 0 j getinterval def % Maps for row indicators and symbol checksums /abmap [ 64 1 95 {} for 0 1 15 {} for 26 1 63 {} for ] def /cmap [ 0 1 85 {} for ] def % Add symbol check characters to last row /chkmsg msglen array def /j 0 def 0 1 msglen 1 sub { /i exch def /char msg i get def char 0 ge {chkmsg j char put /j j 1 add def} if char fn1 eq i 0 ne and {chkmsg j 29 put /j j 1 add def} if } for /t1 0 def /t2 0 def /k1 0 def /k2 0 def 0 1 j 1 sub { /i exch def /t1 chkmsg i get i mul 86 mod def /t2 t1 chkmsg i get add 86 mod def /k1 k1 t2 add 86 mod def /k2 k2 t1 add 86 mod def } for cws cws length 4 sub cset (setc) ne {abmap} {cmap} ifelse k1 get put cws cws length 3 sub cset (setc) ne {abmap} {cmap} ifelse k2 get put % Populate row indicators cws 2 2 copy 1 sub get 99 ne {abmap} {cmap} ifelse r 2 sub get put 1 1 r 1 sub { /i exch def cws i c 5 add mul 2 add 2 copy 1 sub get 99 ne {abmap} {cmap} ifelse i 42 add get put } for % Calculate row check characters 0 1 r 1 sub { cws exch c 5 add mul c 4 add getinterval /rcws exch def /csum rcws 0 get def 1 1 rcws length 2 sub { /i exch def /csum csum rcws i get i mul add def } for rcws rcws length 1 sub csum 103 mod put } for % Create an array containing the character mappings /encs [ (212222) (222122) (222221) (121223) (121322) (131222) (122213) (122312) (132212) (221213) (221312) (231212) (112232) (122132) (122231) (113222) (123122) (123221) (223211) (221132) (221231) (213212) (223112) (312131) (311222) (321122) (321221) (312212) (322112) (322211) (212123) (212321) (232121) (111323) (131123) (131321) (112313) (132113) (132311) (211313) (231113) (231311) (112133) (112331) (132131) (113123) (113321) (133121) (313121) (211331) (231131) (213113) (213311) (213131) (311123) (311321) (331121) (312113) (312311) (332111) (314111) (221411) (431111) (111224) (111422) (121124) (121421) (141122) (141221) (112214) (112412) (122114) (122411) (142112) (142211) (241211) (221114) (413111) (241112) (134111) (111242) (121142) (121241) (114212) (124112) (124211) (411212) (421112) (421211) (212141) (214121) (412121) (111143) (111341) (131141) (114113) (114311) (411113) (411311) (113141) (114131) (311141) (411131) (211412) (2331112) ] def % Derive the bits for each row /rowbits r array def 0 1 r 1 sub { /i exch def /sbs [ cws i c 5 add mul c 5 add getinterval { encs exch get {48 sub} forall } forall ] def mark 0 sbs {1 index 1 eq {{0}} {{1}} ifelse repeat} forall counttomark 1 sub array astore exch pop exch pop rowbits i 3 -1 roll put } for % Populate the bitmap /symwid c 11 mul 57 add def /pixs [ symwid sepheight mul {1} repeat 0 1 r 2 sub { /i exch def rowheight {rowbits i get aload pop} repeat sepheight { 1 1 0 1 0 0 0 0 1 0 0 symwid 24 sub {1} repeat 1 1 0 0 0 1 1 1 0 1 0 1 1 } repeat } for rowheight {rowbits r 1 sub get aload pop} repeat symwid sepheight mul {1} repeat ] def % Return the arguments << /ren //renmatrix /pixs pixs /pixx symwid /pixy pixs length symwid idiv /height pixs length symwid idiv 72 div /width symwid 72 div /opt options >> dontdraw not //renmatrix if end } bind def /codablockf dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER codablockf-- postscriptbarcode-2014-03-12/src/code11.ps000066400000000000000000000152361231007474100200510ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER code11-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Code 11 % --EXAM: 0123456789 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /code11 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includecheck false def /validatecheck false def /includetext false def /includecheckintext false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Create an array containing the character mappings /encs [ (111131) (311131) (131131) (331111) (113131) (313111) (133111) (111331) (311311) (311111) (113111) (113311) ] def % Create a string of the available characters /barchars (0123456789-) def /charvals 11 dict def 0 1 10 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.code11badCharacter (Code 11 must contain only digits and dashes) //raiseerror exec } if } for /barlen barcode length def validatecheck { barlen 11 eq { /bwipp.code11badLength (Code 11 cannot be 11 characters using check digits) //raiseerror exec } if /barlen barlen barlen 10 le {1} {2} ifelse sub def } if /numchecks includecheck validatecheck or {barlen 10 ge {2} {1} ifelse} {0} ifelse def /checksum1 0 def /checksum2 0 def 0 1 barlen 1 sub { /i exch def /indx charvals barcode i 1 getinterval get def /checksum1 checksum1 barlen i sub 1 sub 10 mod 1 add indx mul add def /checksum2 checksum2 barlen i sub 9 mod 1 add indx mul add def } for /checksum1 checksum1 11 mod def /checksum2 checksum2 checksum1 add 11 mod def validatecheck { numchecks 1 eq { barcode barlen get barchars checksum1 get ne { /bwipp.code11badCheckDigit (Incorrect Code 11 check digit provided) //raiseerror exec } if } { barcode barlen get barchars checksum1 get ne barcode barlen 1 add get barchars checksum2 get ne or { /bwipp.code11badCheckDigits (Incorrect Code 11 check digits provided) //raiseerror exec } if } ifelse /barcode barcode 0 barlen getinterval def /includecheck true def } if /sbs barlen numchecks add 6 mul 12 add string def /txt barlen numchecks add array def % Put the start character sbs 0 encs 11 get putinterval /xpos 8 def 0 1 barlen 1 sub { /i exch def /indx charvals barcode i 1 getinterval get def /enc encs indx get def sbs i 6 mul 6 add enc putinterval txt i [barcode i 1 getinterval xpos textyoffset textfont textsize] put 0 1 5 { % xpos+=width of the character /xpos exch enc exch get 48 sub xpos add def } for } for % Put the checksum and end characters includecheck { barlen 10 ge { sbs barlen 6 mul 6 add encs checksum1 get putinterval sbs barlen 6 mul 12 add encs checksum2 get putinterval includecheckintext { txt barlen [barchars checksum1 1 getinterval xpos textyoffset textfont textsize] put /enc encs checksum1 get def 0 1 5 { % xpos+=width of the character /xpos exch enc exch get 48 sub xpos add def } for txt barlen 1 add [barchars checksum2 1 getinterval xpos textyoffset textfont textsize] put } { txt barlen [() xpos textyoffset textfont textsize] put txt barlen 1 add [() xpos textyoffset textfont textsize] put } ifelse sbs barlen 6 mul 18 add encs 11 get putinterval } { sbs barlen 6 mul 6 add encs checksum1 get putinterval includecheckintext { txt barlen [barchars checksum1 1 getinterval xpos textyoffset textfont textsize] put } { txt barlen [() xpos textyoffset textfont textsize] put } ifelse sbs barlen 6 mul 12 add encs 11 get putinterval } ifelse } { sbs barlen 6 mul 6 add encs 11 get putinterval } ifelse % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /code11 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER code11-- postscriptbarcode-2014-03-12/src/code128.ps000066400000000000000000000377041231007474100201460ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER code128-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Code 128 % --EXAM: Count01234567^FNC2! % --EXOP: includetext parsefnc % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /code128 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textxoffset 0 def /textyoffset -7 def /height 1 def /encoding (auto) def /raw false def /parse false def /parsefnc false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /height height cvr def % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if /barlen barcode length def % Special function characters /sta -1 def /stb -2 def /stc -3 def /swa -4 def /swb -5 def /swc -6 def /fn1 -7 def /fn2 -8 def /fn3 -9 def /fn4 -10 def /sft -11 def /stp -12 def /lka -13 def /lkc -14 def % CC-A/B and CC-C linkage % Character maps for each state /charmaps [ % A B C A B C A B C [ 32 32 (00) ] [ (!) (!) (01) ] [ (") (") (02) ] % 0-2 [ (#) (#) (03) ] [ ($) ($) (04) ] [ (%) (%) (05) ] % 3-5 [ (&) (&) (06) ] [ (') (') (07) ] [ 40 40 (08) ] % 6-8 [ 41 41 (09) ] [ (*) (*) (10) ] [ (+) (+) (11) ] % 9-11 [ (,) (,) (12) ] [ (-) (-) (13) ] [ (.) (.) (14) ] % 12-14 [ (/) (/) (15) ] [ (0) (0) (16) ] [ (1) (1) (17) ] % 15-17 [ (2) (2) (18) ] [ (3) (3) (19) ] [ (4) (4) (20) ] % 18-20 [ (5) (5) (21) ] [ (6) (6) (22) ] [ (7) (7) (23) ] % 21-23 [ (8) (8) (24) ] [ (9) (9) (25) ] [ (:) (:) (26) ] % 24-26 [ (;) (;) (27) ] [ (<) (<) (28) ] [ (=) (=) (29) ] % 27-29 [ (>) (>) (30) ] [ (?) (?) (31) ] [ (@) (@) (32) ] % 30-32 [ (A) (A) (33) ] [ (B) (B) (34) ] [ (C) (C) (35) ] % 33-35 [ (D) (D) (36) ] [ (E) (E) (37) ] [ (F) (F) (38) ] % 36-38 [ (G) (G) (39) ] [ (H) (H) (40) ] [ (I) (I) (41) ] % 39-41 [ (J) (J) (42) ] [ (K) (K) (43) ] [ (L) (L) (44) ] % 42-44 [ (M) (M) (45) ] [ (N) (N) (46) ] [ (O) (O) (47) ] % 45-47 [ (P) (P) (48) ] [ (Q) (Q) (49) ] [ (R) (R) (50) ] % 48-50 [ (S) (S) (51) ] [ (T) (T) (52) ] [ (U) (U) (53) ] % 51-53 [ (V) (V) (54) ] [ (W) (W) (55) ] [ (X) (X) (56) ] % 54-56 [ (Y) (Y) (57) ] [ (Z) (Z) (58) ] [ ([) ([) (59) ] % 57-59 [ 92 92 (60) ] [ (]) (]) (61) ] [ (^) (^) (62) ] % 60-62 [ (_) (_) (63) ] [ 0 (`) (64) ] [ 1 (a) (65) ] % 63-65 [ 2 (b) (66) ] [ 3 (c) (67) ] [ 4 (d) (68) ] % 66-68 [ 5 (e) (69) ] [ 6 (f) (70) ] [ 7 (g) (71) ] % 69-71 [ 8 (h) (72) ] [ 9 (i) (73) ] [ 10 (j) (74) ] % 72-74 [ 11 (k) (75) ] [ 12 (l) (76) ] [ 13 (m) (77) ] % 75-77 [ 14 (n) (78) ] [ 15 (o) (79) ] [ 16 (p) (80) ] % 78-80 [ 17 (q) (81) ] [ 18 (r) (82) ] [ 19 (s) (83) ] % 81-83 [ 20 (t) (84) ] [ 21 (u) (85) ] [ 22 (v) (86) ] % 84-86 [ 23 (w) (87) ] [ 24 (x) (88) ] [ 25 (y) (89) ] % 87-89 [ 26 (z) (90) ] [ 27 ({) (91) ] [ 28 (|) (92) ] % 90-92 [ 29 (}) (93) ] [ 30 (~) (94) ] [ 31 127 (95) ] % 93-95 [ fn3 fn3 (96) ] [ fn2 fn2 (97) ] [ sft sft (98) ] % 96-98 [ swc swc (99) ] [ swb fn4 swb ] [ fn4 swa swa ] % 99-101 [ fn1 fn1 fn1 ] [ sta sta sta ] [ stb stb stb ] % 102-104 [ stc stc stc ] [ stp stp stp ] % 105-106 ] def % Invert charmaps to give character to value maps for each state /charvals [ 109 dict 109 dict 109 dict ] def 0 1 charmaps length 1 sub { /i exch def /encs charmaps i get def 0 1 2 { /j exch def encs j get dup type /stringtype eq {0 get} if % convert string to ASCII if required charvals j get exch i put } for } for /seta charvals 0 get def /setb charvals 1 get def /setc charvals 2 get def % Include pseudo characters for GS1-128 Composite linkage identifiers seta lka seta swb get put seta lkc seta swc get put setb lka setb swc get put setb lkc setb swa get put setc lka setc swa get put setc lkc setc swb get put raw {/encoding (raw) def} if encoding (raw) eq { /cws barlen array def /i 0 def /j 0 def { % loop i barlen eq {exit} if /cw barcode i 1 add 3 getinterval cvi def cws j cw put /i i 4 add def /j j 1 add def } loop /cws cws 0 j getinterval def /text () def } if encoding (auto) eq { /fncvals << (FNC1) fn1 (FNC2) fn2 (FNC3) fn3 (FNC4) fn4 (LNKA) lka (LNKC) lkc >> def % Convert input into bytes accounting for FNC and LNK characters /msg barlen array def /text barlen string def /i 0 def /j 0 def { i barlen eq {exit} if /char barcode i get def text j char put parsefnc char 94 eq and i barlen 4 sub lt and { barcode i 1 add get 94 ne { /char fncvals barcode i 1 add 4 getinterval get def text j ( ) putinterval /i i 4 add def } { /i i 1 add def } ifelse } if msg j char put /i i 1 add def /j j 1 add def } loop /msg msg 0 j getinterval def /msglen msg length def /text text 0 j getinterval def % Determine digit runlength and characters from given position /numsscr { /n 0 def /s 0 def /p exch def { p msglen ge {exit} if msg p get dup setc exch known not {pop exit} if fn1 eq { % FNC1 in odd position of run like two digits s 2 mod 0 eq {/s s 1 add def} {exit} ifelse } if /n n 1 add def /s s 1 add def /p p 1 add def } loop n s } bind def % Encoding for each alphabet /enca { seta exch get cws exch j exch put /j j 1 add def } bind def /encb { setb exch get cws exch j exch put /j j 1 add def } bind def /encc { dup type /arraytype ne { setc exch get } { aload pop 48 sub exch 48 sub 10 mul add } ifelse cws exch j exch put /j j 1 add def } bind def % Character exclusively in either alphabet A or B /anotb {dup seta exch known exch setb exch known not and} bind def /bnota {dup setb exch known exch seta exch known not and} bind def % Pre-compute relative position of next anotb and next bnota characters /nextanotb [ msg length {0} repeat 9999 ] def /nextbnota [ msg length {0} repeat 9999 ] def msg length 1 sub -1 0 { /i exch def msg i get anotb { nextanotb i 0 put } { nextanotb i nextanotb i 1 add get 1 add put } ifelse msg i get bnota { nextbnota i 0 put } { nextbnota i nextbnota i 1 add get 1 add put } ifelse } for % Does a-only come before b-only after given position and vice versa /abeforeb {dup nextanotb exch get exch nextbnota exch get lt} bind def /bbeforea {dup nextbnota exch get exch nextanotb exch get lt} bind def /cws barcode length 2 mul 3 add array def % Select start character /j 0 def msglen 0 gt {0 numsscr} {-1 -1} ifelse /nums exch def /nchars exch def { % common exit msglen 0 eq { stb enca /cset (setb) def exit } if msglen 2 eq nums 2 eq and { stc enca /cset (setc) def exit } if nums 4 ge { stc enca /cset (setc) def exit } if 0 abeforeb { sta enca /cset (seta) def exit } if stb enca /cset (setb) def exit } loop % Main encoding loop /i 0 def { i msglen eq {exit} if i numsscr /nums exch def /nchars exch def % Determine switches and shifts { % common exit cset (seta) eq cset (setb) eq or nums 4 ge and msg i get fn1 ne and { nums 2 mod 0 eq { swc cset (seta) eq {enca} {encb} ifelse /cset (setc) def exit } { msg i get cset (seta) eq {enca} {encb} ifelse /i i 1 add def swc cset (seta) eq {enca} {encb} ifelse /cset (setc) def exit } ifelse } if cset (setb) eq msg i get anotb and { i msglen 1 sub lt { i 1 add bbeforea { sft encb msg i get enca /i i 1 add def exit } if } if swa encb /cset (seta) def exit } if cset (seta) eq msg i get bnota and { i msglen 1 sub lt { i 1 add abeforeb { sft enca msg i get encb /i i 1 add def exit } if } if swb enca /cset (setb) def exit } if cset (setc) eq nums 2 lt and { i abeforeb { swa encc /cset (seta) def exit } if swb encc /cset (setb) def exit } if % No switches or latches so encode cset (seta) eq { msg i get enca /i i 1 add def exit } if cset (setb) eq { msg i get encb /i i 1 add def exit } if cset (setc) eq { msg i get fn1 eq { fn1 encc /i i 1 add def } { msg i 2 getinterval encc /i i 2 add def } ifelse exit } if exit } loop } loop /cws cws 0 j getinterval def } if % auto encoding % Derive checksum and place stop character /cws j 2 add array dup 0 cws putinterval def /csum cws 0 get def 1 1 j 1 sub { /i exch def /csum csum cws i get i mul add def } for /csum csum 103 mod def cws j csum put cws j 1 add seta stp get put % Create an array containing the character mappings /encs [ (212222) (222122) (222221) (121223) (121322) (131222) (122213) (122312) (132212) (221213) (221312) (231212) (112232) (122132) (122231) (113222) (123122) (123221) (223211) (221132) (221231) (213212) (223112) (312131) (311222) (321122) (321221) (312212) (322112) (322211) (212123) (212321) (232121) (111323) (131123) (131321) (112313) (132113) (132311) (211313) (231113) (231311) (112133) (112331) (132131) (113123) (113321) (133121) (313121) (211331) (231131) (213113) (213311) (213131) (311123) (311321) (331121) (312113) (312311) (332111) (314111) (221411) (431111) (111224) (111422) (121124) (121421) (141122) (141221) (112214) (112412) (122114) (122411) (142112) (142211) (241211) (221114) (413111) (241112) (134111) (111242) (121142) (121241) (114212) (124112) (124211) (411212) (421112) (421211) (212141) (214121) (412121) (111143) (111341) (131141) (114113) (114311) (411113) (411311) (113141) (114131) (311141) (411131) (211412) (211214) (211232) (2331112) ] def % Derive space bar succession /sbs cws length 6 mul 1 add string def 0 1 cws length 1 sub { /i exch def sbs i 6 mul encs cws i get get putinterval } for % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] /txt [ [text textxoffset textyoffset textfont textsize] ] /textxalign (center) /opt options >> dontdraw not //renlinear if end } bind def /code128 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER code128-- postscriptbarcode-2014-03-12/src/code16k.ps000066400000000000000000000644711231007474100202360ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER code16k-- % --REQUIRES preamble raiseerror renmatrix-- % --DESC: Code 16K % --EXAM: Abcd-1234567890-wxyZ % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /code16k { 20 dict begin /options exch def /barcode exch def /dontdraw false def /mode -1 def /pos -1 def /rows 0 def /rowheight 8 def /sepheight 1 def /encoding (auto) def /raw false def /parse false def /parsefnc false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /mode mode cvi def /pos pos cvi def /rows rows cvi def /rowheight rowheight cvi def /sepheight sepheight cvi def pos -1 ne {/rows 16 def} if % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if /barlen barcode length def % Convert input into bytes accounting for FNC characters /swa -1 def /swb -2 def /swc -3 def /sa1 -4 def /sb1 -5 def /sc1 -6 def /sa2 -7 def /sb2 -8 def /sc2 -9 def /pad -10 def /sb3 -11 def /sc3 -12 def /fn1 -13 def /fn2 -14 def /fn3 -15 def /fn4 -16 def % Character maps for each state /charmaps [ % A B C A B C A B C [ 32 32 (00) ] [ (!) (!) (01) ] [ (") (") (02) ] % 0-2 [ (#) (#) (03) ] [ ($) ($) (04) ] [ (%) (%) (05) ] % 3-5 [ (&) (&) (06) ] [ (') (') (07) ] [ 40 40 (08) ] % 6-8 [ 41 41 (09) ] [ (*) (*) (10) ] [ (+) (+) (11) ] % 9-11 [ (,) (,) (12) ] [ (-) (-) (13) ] [ (.) (.) (14) ] % 12-14 [ (/) (/) (15) ] [ (0) (0) (16) ] [ (1) (1) (17) ] % 15-17 [ (2) (2) (18) ] [ (3) (3) (19) ] [ (4) (4) (20) ] % 18-20 [ (5) (5) (21) ] [ (6) (6) (22) ] [ (7) (7) (23) ] % 21-23 [ (8) (8) (24) ] [ (9) (9) (25) ] [ (:) (:) (26) ] % 24-26 [ (;) (;) (27) ] [ (<) (<) (28) ] [ (=) (=) (29) ] % 27-29 [ (>) (>) (30) ] [ (?) (?) (31) ] [ (@) (@) (32) ] % 30-32 [ (A) (A) (33) ] [ (B) (B) (34) ] [ (C) (C) (35) ] % 33-35 [ (D) (D) (36) ] [ (E) (E) (37) ] [ (F) (F) (38) ] % 36-38 [ (G) (G) (39) ] [ (H) (H) (40) ] [ (I) (I) (41) ] % 39-41 [ (J) (J) (42) ] [ (K) (K) (43) ] [ (L) (L) (44) ] % 42-44 [ (M) (M) (45) ] [ (N) (N) (46) ] [ (O) (O) (47) ] % 45-47 [ (P) (P) (48) ] [ (Q) (Q) (49) ] [ (R) (R) (50) ] % 48-50 [ (S) (S) (51) ] [ (T) (T) (52) ] [ (U) (U) (53) ] % 51-53 [ (V) (V) (54) ] [ (W) (W) (55) ] [ (X) (X) (56) ] % 54-56 [ (Y) (Y) (57) ] [ (Z) (Z) (58) ] [ ([) ([) (59) ] % 57-59 [ 92 92 (60) ] [ (]) (]) (61) ] [ (^) (^) (62) ] % 60-62 [ (_) (_) (63) ] [ 0 (`) (64) ] [ 1 (a) (65) ] % 63-65 [ 2 (b) (66) ] [ 3 (c) (67) ] [ 4 (d) (68) ] % 66-68 [ 5 (e) (69) ] [ 6 (f) (70) ] [ 7 (g) (71) ] % 69-71 [ 8 (h) (72) ] [ 9 (i) (73) ] [ 10 (j) (74) ] % 72-74 [ 11 (k) (75) ] [ 12 (l) (76) ] [ 13 (m) (77) ] % 75-77 [ 14 (n) (78) ] [ 15 (o) (79) ] [ 16 (p) (80) ] % 78-80 [ 17 (q) (81) ] [ 18 (r) (82) ] [ 19 (s) (83) ] % 81-83 [ 20 (t) (84) ] [ 21 (u) (85) ] [ 22 (v) (86) ] % 84-86 [ 23 (w) (87) ] [ 24 (x) (88) ] [ 25 (y) (89) ] % 87-89 [ 26 (z) (90) ] [ 27 ({) (91) ] [ 28 (|) (92) ] % 90-92 [ 29 (}) (93) ] [ 30 (~) (94) ] [ 31 127 (95) ] % 93-95 [ fn3 fn3 (96) ] [ fn2 fn2 (97) ] [ sb1 sa1 (98) ] % 96-98 [ swc swc (99) ] [ swb fn4 swb ] [ fn4 swa swa ] % 99-101 [ fn1 fn1 fn1 ] [ pad pad pad ] [ sb2 sa2 sb1 ] % 102-104 [ sc2 sc2 sb2 ] [ sc3 sc3 sb3 ] % 105-106 ] def % Invert charmaps to give character to value maps for each state /charvals [ 109 dict 109 dict 109 dict ] def 0 1 charmaps length 1 sub { /i exch def /encs charmaps i get def 0 1 2 { /j exch def encs j get dup type /stringtype eq {0 get} if % convert string to ASCII if required charvals j get exch i put } for } for /seta charvals 0 get def /setb charvals 1 get def /setc charvals 2 get def raw {/encoding (raw) def} if encoding (raw) eq { /cws barlen array def /i 0 def /j 0 def { % loop i barlen eq {exit} if /cw barcode i 1 add 3 getinterval cvi def cws j cw put /i i 4 add def /j j 1 add def } loop /cws cws 0 j getinterval def /text () def } if encoding (auto) eq { /fncvals << (FNC1) fn1 (FNC2) fn2 (FNC3) fn3 (FNC4) fn4 >> def /msg barlen array def /i 0 def /j 0 def { i barlen eq {exit} if /char barcode i get def parsefnc char 94 eq and i barlen 4 sub lt and { barcode i 1 add get 94 ne { /char fncvals barcode i 1 add 4 getinterval get def /i i 4 add def } { /i i 1 add def } ifelse } if msg j char put /i i 1 add def /j j 1 add def } loop /msg msg 0 j getinterval def /msglen msg length def % Determine digit runlength and characters from given position /numsscr { /n 0 def /s 0 def /p exch def { p msglen ge {exit} if msg p get dup setc exch known not {pop exit} if fn1 eq { % FNC1 in odd position of run like two digits s 2 mod 0 eq {/s s 1 add def} {exit} ifelse } if /n n 1 add def /s s 1 add def /p p 1 add def } loop n s } bind def % Encoding for each alphabet /enca { seta exch get cws exch j exch put /j j 1 add def } bind def /encb { setb exch get cws exch j exch put /j j 1 add def } bind def /encc { dup type /arraytype ne { setc exch get } { aload pop 48 sub exch 48 sub 10 mul add } ifelse cws exch j exch put /j j 1 add def } bind def % Character exclusively in either alphabet A or B /anotb {dup seta exch known exch setb exch known not and} bind def /bnota {dup setb exch known exch seta exch known not and} bind def % Pre-compute relative position of next anotb and next bnota characters /nextanotb [ msg length {0} repeat 9999 ] def /nextbnota [ msg length {0} repeat 9999 ] def msg length 1 sub -1 0 { /i exch def msg i get anotb { nextanotb i 0 put } { nextanotb i nextanotb i 1 add get 1 add put } ifelse msg i get bnota { nextbnota i 0 put } { nextbnota i nextbnota i 1 add get 1 add put } ifelse } for % Does a-only come before b-only after given position and vice versa /abeforeb {dup nextanotb exch get exch nextbnota exch get lt} bind def /bbeforea {dup nextbnota exch get exch nextanotb exch get lt} bind def /cws barcode length 2 mul 3 add array def % Select mode and encode first characters /i 0 def /j 0 def { % common exit % extended data length pos -1 ne { % encode one and two cws 0 pos 10 idiv 1 sub put cws 1 pos 10 mod 1 sub put /j 2 def /cset (setb) def /mode 7 def exit } if % empty => b msglen 0 eq { /cset (setb) def /mode 1 def exit } if % FNC1 . 2+ nums => c fnc1 msglen 2 ge { msg 0 get fn1 eq 1 numsscr exch pop 2 ge and { /cset (setc) def /mode 4 def /i 1 def exit } if } if % FNC1 => b fnc1 msg 0 get fn1 eq { /cset (setb) def /mode 3 def /i 1 def exit } if msglen 2 ge { % 2+ even nums => c 0 numsscr exch pop dup 2 ge exch 2 mod 0 eq and { /cset (setc) def /mode 2 def exit } if % 3+ odd nums => c sb1 encode 0 numsscr exch pop dup 3 ge exch 2 mod 1 eq and { msg 0 get encb /cset (setc) def /mode 5 def /i 1 def exit } if % b . 2+ even nums => c sb1 encode setb msg 0 get known 1 numsscr exch pop dup 2 ge exch 2 mod 0 eq and and { msg 0 get encb /cset (setc) def /mode 5 def /i 1 def exit } if % b . 3+ odd nums => c sb2 encode setb msg 0 get known 1 numsscr exch pop dup 3 ge exch 2 mod 1 eq and and { msg 0 get encb msg 1 get encb /cset (setc) def /mode 6 def /i 2 def exit } if % b . b . 2+ even nums => c sb2 encode setb msg 0 get known setb msg 1 get known and 2 numsscr exch pop dup 2 ge exch 2 mod 0 eq and and { msg 0 get encb msg 1 get encb /cset (setc) def /mode 6 def /i 2 def exit } if } if % anotb before bnota => a 0 abeforeb { /cset (seta) def /mode 0 def exit } if % otherwise => b /cset (setb) def /mode 1 def exit } loop { % Encode remainder i msglen eq {exit} if i numsscr /nums exch def /nchars exch def % Determine switches and shifts { % common exit cset (seta) eq { % bnota . anotb before bnota => sb1 encode i msglen 1 sub lt { msg i get bnota i 1 add abeforeb and { sb1 enca msg i get encb /i i 1 add def exit } if } if % bnota . bnota . anotb before bnota => sb2 encode i msglen 2 sub lt { msg i get bnota msg i 1 add get bnota and i 2 add abeforeb and { sb2 enca msg i get encb msg i 1 add get encb /i i 2 add def exit } if } if % bnota => swb msg i get bnota { swb enca /cset (setb) def exit } if % 4 nums . a => sc2 encode i msglen 4 sub lt { nums 4 eq seta msg i 4 add get known and { sc2 enca 2 { msg i get fn1 eq { fn1 encc /i i 1 add def } { msg i 2 getinterval encc /i i 2 add def } ifelse } repeat exit } if } if % 6 nums . a => sc3 encode i msglen 6 sub lt { nums 6 eq seta msg i 6 add get known and { sc3 enca 3 { msg i get fn1 eq { fn1 encc /i i 1 add def } { msg i 2 getinterval encc /i i 2 add def } ifelse } repeat exit } if } if % 4+ even nums => swc nums 4 ge nums 2 mod 0 eq and { swc enca /cset (setc) def exit } if % otherwise => encode msg i get enca /i i 1 add def exit } if cset (setb) eq { % anotb . bnota before anotb => sa1 encode i msglen 1 sub lt { msg i get anotb i 1 add bbeforea and { sa1 encb msg i get enca /i i 1 add def exit } if } if % anotb . anotb . bnota before anotb => sa2 encode i msglen 2 sub lt { msg i get anotb msg i 1 add get anotb and i 2 add bbeforea and { sa2 encb msg i get enca msg i 1 add get enca /i i 2 add def exit } if } if % anotb => swa msg i get anotb { swa encb /cset (seta) def exit } if % 4 nums . b => sc2 encode i msglen 4 sub lt { nums 4 eq setb msg i 4 add get known and { sc2 encb 2 { msg i get fn1 eq { fn1 encc /i i 1 add def } { msg i 2 getinterval encc /i i 2 add def } ifelse } repeat exit } if } if % 6 nums . b => sc3 encode i msglen 6 sub lt { nums 6 eq setb msg i 6 add get known and { sc3 encb 3 { msg i get fn1 eq { fn1 encc /i i 1 add def } { msg i 2 getinterval encc /i i 2 add def } ifelse } repeat exit } if } if % 4+ even nums => swc nums 4 ge nums 2 mod 0 eq and { swc encb /cset (setc) def exit } if % otherwise => encode msg i get encb /i i 1 add def exit } if cset (setc) eq { % 2+ nums => encode nums 2 ge { msg i get fn1 eq { fn1 encc /i i 1 add def } { msg i 2 getinterval encc /i i 2 add def } ifelse exit } if % b . 2+ even nums => sb1 encode i msglen 1 sub lt { setb msg i get known i 1 add numsscr exch pop dup 2 ge exch 2 mod 0 eq and and { sb1 encc msg i get encb /i i 1 add def exit } if } if % b . 3+ odd nums => sb2 encode i msglen 1 sub lt { setb msg i get known i 1 add numsscr exch pop dup 3 ge exch 2 mod 1 eq and and { sb2 encc msg i get encb msg i 1 add get encb /i i 2 add def exit } if } if % b . b . 2+ even nums => sb2 encode i msglen 2 sub lt { setb msg i get known setb msg i 1 add get known and i 2 add numsscr exch pop dup 2 ge exch 2 mod 0 eq and and { sb2 encc msg i get encb msg i 1 add get encb /i i 2 add def exit } if } if % b . b . 3+ odd nums => sb3 encode i msglen 3 sub lt { setb msg i get known setb msg i 1 add get known and i 2 add numsscr exch pop dup 3 ge exch 2 mod 1 eq and and { sb3 encc msg i get encb msg i 1 add get encb msg i 2 add get encb /i i 3 add def exit } if } if % b . b . b . 2+ even nums => sb3 encode i msglen 3 sub lt { setb msg i get known setb msg i 1 add get known and setb msg i 2 add get known and i 3 add numsscr exch pop dup 2 ge exch 2 mod 0 eq and and { sb3 encc msg i get encb msg i 1 add get encb msg i 2 add get encb /i i 3 add def exit } if } if % anotb before bnota => swa i abeforeb { swa encc /cset (seta) def exit } if % otherwise => swb swb encc /cset (setb) def exit } if exit } loop } loop /cws cws 0 j getinterval def } if % auto encoding % Basic metrics for the each symbol % r dcws /metrics [ [ 2 7 ] [ 3 12 ] [ 4 17 ] [ 5 22 ] [ 6 27 ] [ 7 32 ] [ 8 37 ] [ 9 42 ] [ 10 47 ] [ 11 52 ] [ 12 57 ] [ 13 62 ] [ 14 67 ] [ 15 72 ] [ 16 77 ] ] def % Select metrics of an appropriate symbol /urows rows def /i 0 def { % loop /m metrics i get def /r m 0 get def % Columns in symbol /dcws m 1 get def % Data codewords in symbol /okay true def urows 0 ne urows r ne and {/okay false def} if cws length dcws gt {/okay false def} if okay {exit} if /i i 1 add def } loop % Extend cws to ncws codewords by addition of pad characters /cws [ cws aload pop dcws cws length sub {103} repeat ] def % Add the start character /cws [ r 2 sub 7 mul mode add cws aload pop ] def % Calculate the check characters 0 0 1 dcws {dup 2 add exch cws exch get mul add} for 107 mod /c1 exch def 0 0 1 dcws {dup 1 add exch cws exch get mul add} for c1 dcws 2 add mul add 107 mod /c2 exch def /cws [ cws aload pop c1 c2 ] def % Create an array containing the character mappings /encs [ (212222) (222122) (222221) (121223) (121322) (131222) (122213) (122312) (132212) (221213) (221312) (231212) (112232) (122132) (122231) (113222) (123122) (123221) (223211) (221132) (221231) (213212) (223112) (312131) (311222) (321122) (321221) (312212) (322112) (322211) (212123) (212321) (232121) (111323) (131123) (131321) (112313) (132113) (132311) (211313) (231113) (231311) (112133) (112331) (132131) (113123) (113321) (133121) (313121) (211331) (231131) (213113) (213311) (213131) (311123) (311321) (331121) (312113) (312311) (332111) (314111) (221411) (431111) (111224) (111422) (121124) (121421) (141122) (141221) (112214) (112412) (122114) (122411) (142112) (142211) (241211) (221114) (413111) (241112) (134111) (111242) (121142) (121241) (114212) (124112) (124211) (411212) (421112) (421211) (212141) (214121) (412121) (111143) (111341) (131141) (114113) (114311) (411113) (411311) (113141) (114131) (311141) (411131) (211412) (211214) (211232) (211133) ] def % Start/stop character encodings /startencs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (3112) (3211) (2221) (2122) (1411) (1132) (1231) (1114) (3112) ] def /stopencsodd [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (3112) (1132) (1231) (1114) (3112) (3211) (2221) (2122) (1411) ] def /stopencseven [ (2122) (1411) (1132) (1231) (1114) (3112) (1132) (1231) (1114) (3112) (3211) (2221) (2122) (1411) (3211) (2221) ] def pos -1 eq pos 10 idiv 2 mod 1 eq or { /stopencs stopencsodd def } { /stopencs stopencseven def } ifelse % Derive the bits for each row /rowbits r array def 0 1 r 1 sub { /i exch def /sbs [ 10 startencs i get {48 sub} forall 1 cws i 5 mul 5 getinterval { encs exch get {48 sub} forall } forall stopencs i get {48 sub} forall 1 ] def mark 1 sbs {1 index 0 eq {{1}} {{0}} ifelse repeat} forall counttomark 1 sub array astore exch pop exch pop rowbits i 3 -1 roll put } for % Populate the bitmap /pixs [ 81 sepheight mul {1} repeat 0 1 r 2 sub { /i exch def rowheight {rowbits i get aload pop} repeat sepheight {10 {0} repeat 70 {1} repeat 0} repeat } for rowheight {rowbits r 1 sub get aload pop} repeat 81 sepheight mul {1} repeat ] def % Return the arguments << /ren //renmatrix /pixs pixs /pixx 81 /pixy pixs length 81 idiv /height pixs length 81 idiv 72 div /width 81 72 div /opt options >> dontdraw not //renmatrix if end } bind def /code16k dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER code16k-- postscriptbarcode-2014-03-12/src/code2of5.ps000066400000000000000000000144011231007474100203740ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER code2of5-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Code 25 % --EXAM: 01234567 % --EXOP: version=iata includetext includecheck includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /code2of5 { 20 dict begin % Confine variable to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includecheck false def /validatecheck false def /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 1 def /version (industrial) def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Validate input barcode { dup 48 lt exch 57 gt or { /bwipp.code2of5badCharacter (Code 25 must contain only digits) //raiseerror exec } if } forall /barlen barcode length validatecheck {1 sub} if def /checksum 0 def 0 1 barlen 1 sub { /i exch def /checksum checksum barcode i get 48 sub barlen i sub 2 mod 0 ne {3 mul} if add def } for /checksum 10 checksum 10 mod sub 10 mod def validatecheck { barcode barlen get checksum 48 add ne { /bwipp.code2of5badCheckDigit (Incorrect Code 25 check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def /includecheck true def } if % Create an array containing the character mappings /versions << /industrial [ (1111313111) (3111111131) (1131111131) (3131111111) (1111311131) (3111311111) (1131311111) (1111113131) (3111113111) (1131113111) (313111) (31113) ] /iata [ (1111313111) (3111111131) (1131111131) (3131111111) (1111311131) (3111311111) (1131311111) (1111113131) (3111113111) (1131113111) (1111) (311) ] /matrix [ (113311) (311131) (131131) (331111) (113131) (313111) (133111) (111331) (311311) (131311) (311111) (31111) ] /coop [ (331111) (111331) (113131) (113311) (131131) (131311) (133111) (311131) (311311) (313111) (3131) (133) ] /datalogic [ (113311) (311131) (131131) (331111) (113131) (313111) (133111) (111331) (311311) (131311) (1111) (311) ] >> def versions version known not { /bwipp.code2of5badVersion (Unrecognised Code 25 version) //raiseerror exec } if /encs versions version get def /cs encs 0 get length def /cw 0 encs 0 get {48 sub add} forall def /ss encs dup length 2 sub get length def /sw 0 encs dup length 2 sub get {48 sub add} forall def % Create a string of the available characters /barchars (0123456789) def /sbs barlen includecheck {1 add} if cs mul ss add ss add string def /txt barlen includecheck {1 add} if array def % Put the start character sbs 0 encs 10 get putinterval 0 1 barlen 1 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i cs mul ss add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i cw mul sw add textyoffset textfont textsize] put } for % Put the checksum and end characters includecheck { sbs barlen cs mul ss add encs checksum get putinterval sbs barlen cs mul cs add ss add encs 11 get putinterval includecheckintext { txt barlen [barchars checksum 1 getinterval barlen cw mul sw add textyoffset textfont textsize] put } { txt barlen [( ) barlen cw mul sw add textyoffset textfont textsize] put } ifelse } { sbs barlen cs mul ss add encs 11 get putinterval } ifelse % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /code2of5 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER code2of5-- postscriptbarcode-2014-03-12/src/code32.ps000066400000000000000000000102001231007474100200360ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER code32-- % --REQUIRES preamble raiseerror renlinear code39-- % --DESC: Italian Pharmacode % --EXAM: 01234567 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /code39 dup /uk.co.terryburton.bwipp findresource put begin /code32 { 20 dict begin /options exch def % We are given an options string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable code32 text /textfont /Courier def /textsize 10 def /textyoffset -7 def /textxoffset 0 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Validate the input barcode length 8 ne barcode length 9 ne and { /bwipp.code32badLength (Italian Pharmacode must be 8 or 9 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.code32badCharacter (Italian Pharmacode must contain only digits) //raiseerror exec } if } forall % Calculate check digit /checksum 0 def 0 1 7 { /i exch def barcode i get 48 sub i 2 mod 0 ne {2 mul} if dup 9 gt {9 sub} if checksum add /checksum exch def } for /checksum checksum 10 mod def barcode length 9 eq { barcode 8 get checksum 48 add ne { /bwipp.code32badCheckDigit (Incorrect Italian Pharmacode check digit provided) //raiseerror exec } if } if 10 string dup 0 barcode putinterval dup 8 checksum 48 add put /text exch def % convert number from base10 to base32 /val text cvi 32 barcode cvrs def /barcode 6 string def 0 1 5 {barcode exch 48 put} for barcode 6 val length sub val putinterval % convert base32 number to specified character set 0 1 5 { dup barcode exch get dup (AEIO) {ge {1 add} if dup} forall pop barcode 3 1 roll put } for % format HRI text 1 text 0 9 getinterval putinterval text 0 65 put % Get the result of encoding with code39 options (dontdraw) true put /args barcode options //code39 exec def args (txt) [ [text textxoffset textyoffset textfont textsize] ] put args (textxalign) (center) put args (opt) options put args dontdraw not //renlinear if end } bind def /code32 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER code32-- postscriptbarcode-2014-03-12/src/code39.ps000066400000000000000000000141521231007474100200570ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER code39-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Code 39 % --EXAM: THIS IS CODE 39 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /code39 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includecheck false def /validatecheck false def /includetext false def /includecheckintext false def /hidestars false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%) def /charvals 43 dict def 0 1 42 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.code39badCharacter (Code 39 must contain only digits, capital letters, spaces and the symbols -.$/+%) //raiseerror exec } if } for /barlen barcode length validatecheck {1 sub} if def /checksum 0 def 0 1 barlen 1 sub { barcode exch 1 getinterval charvals exch get checksum add /checksum exch def } for /checksum checksum 43 mod def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.code39badCheckDigit (Incorrect Code 39 check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def /includecheck true def } if % Create an array containing the character mappings /encs [ (1113313111) (3113111131) (1133111131) (3133111111) (1113311131) (3113311111) (1133311111) (1113113131) (3113113111) (1133113111) (3111131131) (1131131131) (3131131111) (1111331131) (3111331111) (1131331111) (1111133131) (3111133111) (1131133111) (1111333111) (3111111331) (1131111331) (3131111311) (1111311331) (3111311311) (1131311311) (1111113331) (3111113311) (1131113311) (1111313311) (3311111131) (1331111131) (3331111111) (1311311131) (3311311111) (1331311111) (1311113131) (3311113111) (1331113111) (1313131111) (1313111311) (1311131311) (1113131311) (1311313111) ] def /sbs barlen includecheck {3} {2} ifelse add 10 mul string def /txt barlen includecheck {3} {2} ifelse add array def % Put the start character sbs 0 encs 43 get putinterval hidestars not { txt 0 [(*) 0 textyoffset textfont textsize] put } { txt 0 [() 0 textyoffset textfont textsize] put } ifelse 0 1 barlen 1 sub { /i exch def /indx charvals barcode i 1 getinterval get def sbs i 10 mul 10 add encs indx get putinterval txt i 1 add [barcode i 1 getinterval i 1 add 16 mul textyoffset textfont textsize] put } for % Put the checksum and end characters includecheck { sbs barlen 10 mul 10 add encs checksum get putinterval includecheckintext { txt barlen 1 add [barchars checksum 1 getinterval barlen 1 add 16 mul textyoffset textfont textsize] put } { txt barlen 1 add [() barlen 1 add 16 mul textyoffset textfont textsize] put } ifelse sbs barlen 10 mul 20 add encs 43 get putinterval hidestars not { txt barlen 2 add [(*) barlen 2 add 16 mul textyoffset textfont textsize] put } { txt barlen 2 add [() barlen 2 add 16 mul textyoffset textfont textsize] put } ifelse } { sbs barlen 10 mul 10 add encs 43 get putinterval hidestars not { txt barlen 1 add [(*) barlen 1 add 16 mul textyoffset textfont textsize] put } { txt barlen 1 add [() barlen 1 add 16 mul textyoffset textfont textsize] put } ifelse } ifelse % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /code39 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER code39-- postscriptbarcode-2014-03-12/src/code39ext.ps000066400000000000000000000116261231007474100206030ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER code39ext-- % --REQUIRES preamble raiseerror renlinear code39-- % --DESC: Code 39 Extended % --EXAM: Code39 Ext! % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /code39 dup /uk.co.terryburton.bwipp findresource put begin /code39ext { 20 dict begin /options exch def % We are given an options string /barcode exch def % We are given the code39extended text /dontdraw false def /includetext false def /parse false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if % Validate the input barcode 4 barcode length 4 sub getinterval { 128 ge { /bwipp.code39extBadCharacter (Code 39 Extended must contain only ASCII characters) //raiseerror exec } if } forall /barlen barcode length def % Extended alphabet to non-extended alphabet /extencs [ (%U) ($A) ($B) ($C) ($D) ($E) ($F) ($G) ($H) ($I) ($J) ($K) ($L) ($M) ($N) ($O) ($P) ($Q) ($R) ($S) ($T) ($U) ($V) ($W) ($X) ($Y) ($Z) (%A) (%B) (%C) (%D) (%E) ( ) (/A) (/B) (/C) (/D) (/E) (/F) (/G) (/H) (/I) (/J) (/K) (/L) (-) (.) (/O) (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (/Z) (%F) (%G) (%H) (%I) (%J) (%V) (A) (B) (C) (D) (E) (F) (G) (H) (I) (J) (K) (L) (M) (N) (O) (P) (Q) (R) (S) (T) (U) (V) (W) (X) (Y) (Z) (%K) (%L) (%M) (%N) (%O) (%W) (+A) (+B) (+C) (+D) (+E) (+F) (+G) (+H) (+I) (+J) (+K) (+L) (+M) (+N) (+O) (+P) (+Q) (+R) (+S) (+T) (+U) (+V) (+W) (+X) (+Y) (+Z) (%P) (%Q) (%R) (%S) (%T) ] def /newcode barlen 2 mul string def /newtext barlen 2 mul string def /j 0 def 0 1 barlen 1 sub { /i exch def /extchar extencs barcode i get get def newcode j extchar putinterval newtext j barcode i get put extchar length 1 ne {newtext j 1 add ( ) putinterval} if /j j extchar length add def } for /newcode newcode 0 j getinterval def /newtext newtext 0 j getinterval def % Get the result of encoding with code39 options (dontdraw) true put /args newcode options //code39 exec def % Replace chars in /txt with chars in newtext includetext { /txt args (txt) get def 0 1 newtext length 1 sub { /i exch def /txtentry txt i 1 add get def txtentry 0 newtext i 1 getinterval put txt i 1 add txtentry put } for args (txt) txt put } if args (opt) options put args dontdraw not //renlinear if end } bind def /code39ext dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER code39ext-- postscriptbarcode-2014-03-12/src/code49.ps000066400000000000000000002205721231007474100200650ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER code49-- % --REQUIRES preamble raiseerror renmatrix-- % --DESC: Code 49 % --EXAM: MULTIPLE ROWS IN CODE 49 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /code49 { 20 dict begin /options exch def /barcode exch def /dontdraw false def /mode -1 def /pos -1 def /rows 0 def /rowheight 8 def /sepheight 1 def /parse false def /parsefnc false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /mode mode cvi def /pos pos cvi def /rows rows cvi def /rowheight rowheight cvi def /sepheight sepheight cvi def % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if /barlen barcode length def % Convert input into bytes accounting for FNC characters /s1 -1 def /s2 -2 def /fn1 -3 def /fn2 -4 def /fn3 -5 def /ns -6 def /fncvals << (FNC1) fn1 (FNC2) fn2 (FNC3) fn3 >> def /msg barlen array def /i 0 def /j 0 def { i barlen eq {exit} if /char barcode i get def parsefnc char 94 eq and i barlen 4 sub lt and { barcode i 1 add get 94 ne { /char fncvals barcode i 1 add 4 getinterval get def /i i 4 add def } { /i i 1 add def } ifelse } if msg j char put /i i 1 add def /j j 1 add def } loop /msg msg 0 j getinterval def /msglen msg length def % Character encodings /charmap [ (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (A) (B) (C) (D) (E) (F) (G) (H) (I) (J) (K) (L) (M) (N) (O) (P) (Q) (R) (S) (T) (U) (V) (W) (X) (Y) (Z) (-) (.) ( ) ($) (/) (+) (%) s1 s2 fn1 fn2 fn3 ns ] def % Invert charmap to give character to value map /charvals 49 dict def 0 1 48 { /i exch def charmap i get dup type /stringtype eq {0 get} if % convert string to ASCII if required charvals exch i put } for % Shifted character encodings /combos [ (1 ) (1A) (1B) (1C) (1D) (1E) (1F) (1G) (1H) (1I) (1J) (1K) (1L) (1M) (1N) (1O) (1P) (1Q) (1R) (1S) (1T) (1U) (1V) (1W) (1X) (1Y) (1Z) (11) (12) (13) (14) (15) ( ) (16) (17) (18) ( $) ( %) (19) (10) (1-) (1.) (1$) ( +) (1/) ( -) ( .) ( /) ( 0) ( 1) ( 2) ( 3) ( 4) ( 5) ( 6) ( 7) ( 8) ( 9) (1+) (21) (22) (23) (24) (25) (26) ( A) ( B) ( C) ( D) ( E) ( F) ( G) ( H) ( I) ( J) ( K) ( L) ( M) ( N) ( O) ( P) ( Q) ( R) ( S) ( T) ( U) ( V) ( W) ( X) ( Y) ( Z) (27) (28) (29) (20) (2-) (2.) (2A) (2B) (2C) (2D) (2E) (2F) (2G) (2H) (2I) (2J) (2K) (2L) (2M) (2N) (2O) (2P) (2Q) (2R) (2S) (2T) (2U) (2V) (2W) (2X) (2Y) (2Z) (2$) (2/) (2+) (2%) (2 ) ] def 0 1 127 { /i exch def combos i get dup 0 get /c1 exch def 1 get /c2 exch def c1 49 eq { % s1 char charvals i [ charvals s1 get charvals c2 get ] put } if c1 50 eq { % s2 char charvals i [ charvals s2 get charvals c2 get ] put } if } for /encodealpha { charvals exch get dup type /arraytype ne {1 array astore} if dup cws exch j exch putinterval length j add /j exch def } bind def /base48 { 0 exch {48 sub exch 10 mul add} forall [ 3 1 roll exch 1 sub {dup 48 mod exch 48 idiv} repeat ] [ exch dup length 1 sub -1 0 {1 index exch get exch} for pop ] dup cws exch j exch putinterval length j add /j exch def } bind def /encodenumeric { /nums exch def /pre nums length dup 5 mod dup 2 ne {sub} {sub 5 sub} ifelse def 0 5 pre 1 sub {nums exch 5 getinterval 3 exch base48} for /nums nums pre nums length pre sub getinterval def nums length dup 1 eq {nums i get encodealpha} if dup 3 eq {2 nums base48} if dup 4 eq {3 [49 48 nums aload pop] base48} if 7 eq { 3 [49 48 nums 0 4 getinterval aload pop] base48 2 nums 4 3 getinterval base48 } if } bind def % Pre-compute alphanumeric and numeric runlengths /numericruns [ msglen {0} repeat 0 ] def msglen 1 sub -1 0 { /i exch def msg i get dup 48 ge exch 57 le and { numericruns i numericruns i 1 add get 1 add put } { numericruns i 0 put } ifelse } for % Autoselect mode mode -1 eq { { % common exit pos -1 ne {/mode 3 def exit} if numericruns 0 get 5 ge {/mode 2 def exit} if charvals msg 0 get get dup type /arraytype ne {pop /mode 0 def exit} if 0 get 43 eq {4} {5} ifelse /mode exch def exit } loop } if /cws msglen 2 mul 1 add array def /method (alpha) def /i -1 def /j -1 def % Handle start for each mode mode 0 eq mode 1 eq or {/method (alpha) def /i 0 def /j 0 def} if mode 2 eq {/method (numeric) def /i 0 def /j 0 def} if mode 3 eq { /posval [ 12 22 13 23 33 14 24 34 44 15 25 35 45 55 16 26 36 46 56 66 17 27 37 47 57 67 77 18 28 38 48 58 68 78 88 19 29 39 49 59 69 79 89 99 ] def cws 0 0 1 43 {dup posval exch get pos ne {pop} if} for 1 add put /method (alpha) def /i 0 def /j 1 def } if mode 4 eq mode 5 eq or { cws 0 charvals msg 0 get get 1 get put /method (alpha) def /i 1 def /j 1 def } if % Encode remainder { i msglen eq {exit} if { % not a loop but common exit point method (alpha) eq { numericruns i get 5 ge { ns encodealpha /method (numeric) def exit } if msg i get encodealpha /i i 1 add def exit } if method (numeric) eq { numericruns i get 5 lt { ns encodealpha /method (alpha) def exit } if msg i numericruns i get getinterval encodenumeric /i i numericruns i get add def exit } if } loop } loop /cws cws 0 j getinterval def % Basic metrics for the each symbol % r dcws /metrics [ [ 2 9 ] [ 3 16 ] [ 4 23 ] [ 5 30 ] [ 6 37 ] [ 7 42 ] [ 8 49 ] ] def % Select metrics of an appropriate symbol /urows rows def /i 0 def { % loop /m metrics i get def /r m 0 get def % Columns in symbol /dcws m 1 get def % Data codewords in symbol /okay true def urows 0 ne urows r ne and {/okay false def} if cws length dcws gt {/okay false def} if okay {exit} if /i i 1 add def } loop % Extend cws to ncws codewords by addition of pad characters /cws [ cws aload pop dcws cws length sub {48} repeat ] def % Populate code character array and add row check characters /ccs r 8 mul array def /j 0 def 0 1 r 2 sub { /i exch def /cc cws j 7 getinterval def ccs i 8 mul cc putinterval ccs i 8 mul 7 add 0 cc {add} forall 49 mod put /j j 7 add def } for j dcws lt { ccs ccs length 8 sub cws j dcws j sub getinterval putinterval } if % Place row count character /cr7 r 2 sub 7 mul mode add def ccs ccs length 2 sub cr7 put % Calculate the symbol check characters [ 1 9 31 26 2 12 17 23 37 18 22 6 27 44 15 43 39 11 13 5 41 33 36 8 4 32 3 19 40 25 29 10 24 30 ] dup [ exch 20 exch 0 32 getinterval aload pop ] /weightx exch def dup [ exch 16 exch 1 32 getinterval aload pop ] /weighty exch def [ exch 38 exch 2 32 getinterval aload pop ] /weightz exch def /calccheck { /weights exch def /score 0 def 0 1 r 1 sub 8 mul 2 idiv 1 sub { /i exch def ccs i 2 mul get 49 mul ccs i 2 mul 1 add get add weights i 1 add get mul /score exch score add def } for score } bind def /lastrow ccs ccs length 8 sub 8 getinterval def % wr1 check character r 7 ge { cr7 weightz 0 get mul weightz calccheck add 2401 mod dup 49 idiv exch 49 mod 2 array astore lastrow 0 3 -1 roll putinterval } if /wr1 lastrow 0 get 49 mul lastrow 1 get add def % wr2 check character cr7 weighty 0 get mul weighty calccheck add wr1 weighty r 4 mul 3 sub get mul add 2401 mod dup /wr2 exch def dup 49 idiv exch 49 mod 2 array astore lastrow 2 3 -1 roll putinterval % wr3 check character cr7 weightx 0 get mul weightx calccheck add wr1 weightx r 4 mul 3 sub get mul add wr2 weightx r 4 mul 2 sub get mul add 2401 mod dup 49 idiv exch 49 mod 2 array astore lastrow 4 3 -1 roll putinterval % Place last row check character ccs ccs length 8 sub 7 getinterval 0 exch {add} forall 49 mod ccs ccs length 1 sub 3 -1 roll put /patterns [ [ % Even parity (11521132) (25112131) (14212132) (25121221) (14221222) (12412132) (23321221) (12421222) (21521221) (15112222) (15121312) (13312222) (24221311) (13321312) (11512222) (22421311) (11521312) (25112311) (14212312) (23312311) (12412312) (21512311) (16121131) (14321131) (12521131) (15212131) (15221221) (13412131) (13421221) (11612131) (16112221) (16121311) (14312221) (14321311) (12512221) (12521311) (15212311) (13412311) (11612311) (11131135) (31131133) (51131131) (21122134) (41122132) (21131224) (41131222) (11113135) (31113133) (51113131) (11122225) (31122223) (51122221) (11131315) (31131313) (51131311) (21113224) (41113222) (21122314) (41122312) (11113315) (31113313) (51113311) (12131134) (32131132) (21231133) (41231131) (22122133) (42122131) (11222134) (22131223) (42131221) (11231224) (31231222) (12113134) (32113132) (12122224) (32122222) (12131314) (32131312) (21231313) (41231311) (22113223) (42113221) (11213224) (22122313) (42122311) (11222314) (31222312) (12113314) (32113312) (21213313) (41213311) (13131133) (33131131) (22231132) (11331133) (31331131) (23122132) (12222133) (23131222) (12231223) (32231221) (21331222) (13113133) (33113131) (13122223) (33122221) (11313133) (13131313) (33131311) (11322223) (22231312) (11331313) (31331311) (23113222) (12213223) (23122312) (12222313) (32222311) (21322312) (13113313) (33113311) (22213312) (11313313) (31313311) (14131132) (23231131) (12331132) (21431131) (24122131) (13222132) (24131221) (13231222) (11422132) (22331221) (11431222) (14113132) (14122222) (12313132) (14131312) (12322222) (23231311) (12331312) (21431311) (24113221) (13213222) (24122311) (13222312) (11413222) (22322311) (11422312) (14113312) (23213311) (12313312) (21413311) (15131131) (13331131) (14222131) (14231221) (12422131) (12431221) (15113131) (15122221) (13313131) (15131311) (13322221) (11513131) (13331311) (11522221) (14213221) (14222311) (12413221) (12422311) (15113311) (13313311) (11513311) (11141134) (31141132) (21132133) (41132131) (21141223) (41141221) (11123134) (31123132) (11132224) (31132222) (11141314) (31141312) (21114133) (41114131) (21123223) (41123221) (21132313) (41132311) (11114224) (31114222) (11123314) (31123312) (21114313) (41114311) (12141133) (32141131) (21241132) (22132132) (11232133) (22141222) (11241223) (31241221) (12123133) (32123131) (12132223) (32132221) (12141313) (32141311) (21241312) (22114132) (11214133) (22123222) (11223223) (22132312) (11232313) (31232311) (12114223) (32114221) (12123313) (32123311) (21223312) (22114312) (11214313) (31214311) (13141132) (22241131) (11341132) (23132131) (12232132) (23141221) (12241222) (21341221) (13123132) (13132222) (11323132) (13141312) (11332222) (22241311) (11341312) (23114131) (12214132) (23123221) (12223222) (23132311) (12232312) (21332311) (13114222) (13123312) (11314222) (22223311) (11323312) (23114311) (12214312) (21314311) (14141131) (12341131) (13232131) (13241221) (11432131) (14123131) (14132221) (12323131) (14141311) (12332221) (12341311) (13214131) (13223221) (11414131) (13232311) (11423221) (11432311) (14114221) (14123311) (12314221) (12323311) (13214311) (11414311) (11151133) (31151131) (21142132) (21151222) (11133133) (31133131) (11142223) (31142221) (11151313) (31151311) (21124132) (21133222) (21142312) (11115133) (31115131) (11124223) (31124221) (11133313) (31133311) (21115222) (21124312) (12151132) (21251131) (22142131) (11242132) (22151221) (11251222) (12133132) (12142222) (12151312) (21251311) (22124131) (11224132) (22133221) (11233222) (22142311) (11242312) (12115132) (12124222) (12133312) (21233311) (22115221) (11215222) (22124311) (11224312) (13151131) (12242131) (12251221) (13133131) (13142221) (11333131) (13151311) (11342221) (12224131) (12233221) (12242311) (13115131) (13124221) (11315131) (13133311) (11324221) (11333311) (12215221) (12224311) (11161132) (21152131) (21161221) (11143132) (11152222) (11161312) (21134131) (21143221) (21152311) (11125132) (11134222) (11143312) (21116131) (21125221) (21134311) (12161131) (11252131) (12143131) (12152221) (12161311) (11234131) (11243221) (11252311) (12125131) (12134221) (12143311) (11216131) (11225221) (11234311) (11111236) (31111234) (51111232) (21111325) (41111323) (61111321) (11111416) (31111414) (51111412) (31211143) (51211141) (12111235) (32111233) (52111231) (21211234) (41211232) (22111324) (42111322) (11211325) (31211323) (51211321) (12111415) (32111413) (52111411) (21211414) (41211412) (12211144) (32211142) (21311143) (41311141) (13111234) (33111232) (22211233) (42211231) (11311234) (31311232) (23111323) (43111321) (12211324) (32211322) (21311323) (41311321) (13111414) (33111412) (22211413) (42211411) (11311414) (31311412) (13211143) (33211141) (22311142) (11411143) (31411141) (14111233) (34111231) (23211232) (12311233) (32311231) (21411232) (24111322) (13211323) (33211321) (22311322) (11411323) (31411321) (14111413) (34111411) (23211412) (12311413) (32311411) (21411412) (14211142) (23311141) (12411142) (21511141) (15111232) (24211231) (13311232) (22411231) (11511232) (25111321) (14211322) (23311321) (12411322) (21511321) (15111412) (24211411) (13311412) (22411411) (11511412) (15211141) (13411141) (11611141) (16111231) (14311231) (12511231) (15211321) (13411321) (11611321) (16111411) (14311411) (12511411) (21121144) (41121142) (11112145) (31112143) (51112141) (11121235) (31121233) (51121231) (21112234) (41112232) (21121324) (41121322) (11112325) (31112323) (51112321) (11121415) (31121413) (51121411) (21112414) (41112412) (22121143) (42121141) (11221144) (31221142) (12112144) (32112142) (12121234) (32121232) (21221233) (41221231) (22112233) (42112231) (11212234) (22121323) (42121321) (11221324) (31221322) (12112324) (32112322) (12121414) (32121412) (21221413) (41221411) (22112413) (42112411) (11212414) (31212412) (23121142) (12221143) (32221141) (21321142) (13112143) (33112141) (13121233) (33121231) (11312143) (22221232) (11321233) (31321231) (23112232) (12212233) (23121322) (12221323) (32221321) (21321322) (13112323) (33112321) (13121413) (33121411) (11312323) (22221412) (11321413) (31321411) (23112412) (12212413) (32212411) (21312412) (24121141) (13221142) (22321141) (11421142) (14112142) (14121232) (12312142) (23221231) (12321232) (21421231) (24112231) (13212232) (24121321) (13221322) (11412232) (22321321) (11421322) (14112322) (14121412) (12312322) (23221411) (12321412) (21421411) (24112411) (13212412) (22312411) (11412412) (14221141) (12421141) (15112141) (15121231) (13312141) (13321231) (11512141) (11521231) (14212231) (14221321) (12412231) (12421321) (15112321) (15121411) (13312321) (13321411) (11512321) (11521411) (14212411) (12412411) (21131143) (41131141) (11122144) (31122142) (11131234) (31131232) (21113143) (41113141) (21122233) (41122231) (21131323) (41131321) (11113234) (31113232) (11122324) (31122322) (11131414) (31131412) (21113323) (41113321) (21122413) (41122411) (11113414) (31113412) (22131142) (11231143) (31231141) (12122143) (32122141) (12131233) (32131231) (21231232) (22113142) (11213143) (22122232) (11222233) (22131322) (11231323) (31231321) (12113233) (32113231) (12122323) (32122321) (12131413) (32131411) (21231412) (22113322) (11213323) (22122412) (11222413) (31222411) (12113413) (32113411) (21213412) (23131141) (12231142) (21331141) (13122142) (13131232) (11322142) (22231231) (11331232) (23113141) (12213142) (23122231) (12222232) (23131321) (12231322) (21331321) (13113232) (13122322) (11313232) (13131412) (11322322) (22231411) (11331412) (23113321) (12213322) (23122411) (12222412) (21322411) (13113412) (22213411) (11313412) (13231141) (11431141) (14122141) (14131231) (12322141) (12331231) (13213141) (13222231) (11413141) (13231321) (11422231) (11431321) (14113231) (14122321) (12313231) (14131411) (12322321) (12331411) (13213321) (13222411) (11413321) (11422411) (14113411) (12313411) (21141142) (11132143) (31132141) (11141233) (31141231) (21123142) (21132232) (21141322) (11114143) (31114141) (11123233) (31123231) (11132323) (31132321) (11141413) (31141411) (21114232) (21123322) (21132412) (11114323) (31114321) (11123413) (31123411) (22141141) (11241142) (12132142) (12141232) (21241231) (22123141) (11223142) (22132231) (11232232) (22141321) (11241322) (12114142) (12123232) (12132322) (12141412) (21241411) (22114231) (11214232) (22123321) (11223322) (22132411) (11232412) (12114322) (12123412) (21223411) (12241141) (13132141) (13141231) (11332141) (11341231) (12223141) (12232231) (12241321) (13114141) (13123231) (11314141) (13132321) (11323231) (13141411) (11332321) (11341411) (12214231) (12223321) (12232411) (13114321) (13123411) (11314321) (11323411) (21151141) (11142142) (11151232) (21133141) (21142231) (21151321) (11124142) (11133232) (11142322) (11151412) (21115141) (21124231) (21133321) (21142411) (11115232) (11124322) (11133412) (11251141) (12142141) (12151231) (11233141) (11242231) (11251321) (12124141) (12133231) (12142321) (12151411) (11215141) (11224231) (11233321) (11242411) (12115231) (12124321) (12133411) (11152141) (11161231) (11134141) (11143231) (11152321) (11161411) (11116141) (11125231) (11134321) (11143411) (21111244) (41111242) (11111335) (31111333) (51111331) (21111424) (41111422) (11111515) (31111513) (51111511) (21211153) (41211151) (22111243) (42111241) (11211244) (31211242) (12111334) (32111332) (21211333) (41211331) (22111423) (42111421) (11211424) (31211422) (12111514) (32111512) (21211513) (41211511) (22211152) (11311153) (31311151) (23111242) (12211243) (32211241) (21311242) (13111333) (33111331) (22211332) (11311333) (31311331) (23111422) (12211423) (32211421) (21311422) (13111513) (33111511) (22211512) (11311513) (31311511) (23211151) (12311152) (21411151) (24111241) (13211242) (22311241) (11411242) (14111332) (23211331) (12311332) (21411331) (24111421) (13211422) (22311421) (11411422) (14111512) (23211511) (12311512) (21411511) (13311151) (11511151) (14211241) (12411241) (15111331) (13311331) (11511331) (14211421) (12411421) (15111511) (13311511) (11511511) (31121152) (21112153) (41112151) (21121243) (41121241) (11112244) (31112242) (11121334) (31121332) (21112333) (41112331) (21121423) (41121421) (11112424) (31112422) (11121514) (31121512) (21112513) (41112511) (12121153) (32121151) (21221152) (22112152) (11212153) (22121242) (11221243) (31221241) (12112243) (32112241) (12121333) (32121331) (21221332) (22112332) (11212333) (22121422) (11221423) (31221421) (12112423) (32112421) (12121513) (32121511) (21221512) (22112512) (11212513) (31212511) (13121152) (22221151) (11321152) (23112151) (12212152) (23121241) (12221242) (21321241) (13112242) (13121332) (11312242) (22221331) (11321332) (23112331) (12212332) (23121421) (12221422) (21321421) (13112422) (13121512) (11312422) (22221511) (11321512) (23112511) (12212512) (21312511) (14121151) (12321151) (13212151) (13221241) (11412151) (11421241) (14112241) (14121331) (12312241) (12321331) (13212331) (13221421) (11412331) (11421421) (14112421) (14121511) (12312421) (12321511) (13212511) (11412511) (11131153) (31131151) (21122152) (21131242) (11113153) (31113151) (11122243) (31122241) (11131333) (31131331) (21113242) (21122332) (21131422) (11113333) (31113331) (11122423) (31122421) (11131513) (31131511) (21113422) (21122512) (12131152) (21231151) (22122151) (11222152) (22131241) (11231242) (12113152) (12122242) (12131332) (21231331) (22113241) (11213242) (22122331) (11222332) (22131421) (11231422) (12113332) (12122422) (12131512) (21231511) (22113421) (11213422) (22122511) (11222512) (13131151) (11331151) (12222151) (12231241) (13113151) (13122241) (11313151) (13131331) (11322241) (11331331) (12213241) (12222331) (12231421) (13113331) (13122421) (11313331) (13131511) (11322421) (11331511) (12213421) (12222511) (11141152) (21132151) (21141241) (11123152) (11132242) (11141332) (21114151) (21123241) (21132331) (21141421) (11114242) (11123332) (11132422) (11141512) (21114331) (21123421) (21132511) (12141151) (11232151) (11241241) (12123151) (12132241) (12141331) (11214151) (11223241) (11232331) (11241421) (12114241) (12123331) (12132421) (12141511) (11214331) (11223421) (11232511) (11151151) (11133151) (11142241) (11151331) (11115151) (11124241) (11133331) (11142421) (11151511) (11111254) (31111252) (21111343) (41111341) (11111434) (31111432) (21111523) (41111521) (11111614) (31111612) (31211161) (12111253) (32111251) (21211252) (22111342) (11211343) (31211341) (12111433) (32111431) (21211432) (22111522) (11211523) (31211521) (12111613) (32111611) (21211612) (12211162) (21311161) (13111252) (22211251) (11311252) (23111341) (12211342) (21311341) (13111432) (22211431) (11311432) (23111521) (12211522) (21311521) (13111612) (22211611) (11311612) (13211161) (11411161) (14111251) (12311251) (13211341) (11411341) (14111431) (12311431) (13211521) (11411521) (14111611) (12311611) (21121162) (11112163) (31112161) (11121253) (31121251) (21112252) (21121342) (11112343) (31112341) (11121433) (31121431) (21112432) (21121522) (11112523) (31112521) (11121613) (31121611) (22121161) (11221162) (12112162) (12121252) (21221251) (22112251) (11212252) (22121341) (11221342) (12112342) (12121432) (21221431) (22112431) (11212432) (22121521) (11221522) (12112522) (12121612) (21221611) (12221161) (13112161) (13121251) (11312161) (11321251) (32121115) (52121113) (21221116) (41221114) (61221112) (22112116) (42112114) (31212115) (51212113) (13121116) (33121114) (22221115) (42221113) (11321116) (31321114) (51321112) (23112115) (43112113) (12212116) (32212114) (52212112) (21312115) (41312113) (61312111) (14121115) (34121113) (23221114) (43221112) (12321115) (32321113) (52321111) (21421114) (41421112) (24112114) (13212115) (33212113) (22312114) (42312112) (11412115) (31412113) (51412111) (15121114) (24221113) (13321114) (33321112) (22421113) (42421111) (11521114) (31521112) (25112113) (14212114) (34212112) (23312113) (43312111) (12412114) (32412112) (21512113) (41512111) (16121113) (25221112) (14321113) (34321111) (23421112) (12521113) (32521111) (15212113) (24312112) (13412113) (33412111) (22512112) (11612113) (31612111) (31131115) (51131113) (21122116) (41122114) (61122112) (31113115) (51113113) (12131116) (32131114) (52131112) (21231115) (41231113) (61231111) (22122115) (42122113) (11222116) (31222114) (51222112) (12113116) (32113114) (52113112) (21213115) (41213113) (61213111) (13131115) (33131113) (22231114) (42231112) (11331115) (31331113) (51331111) (23122114) (43122112) (12222115) (32222113) (52222111) (21322114) (41322112) (13113115) (33113113) (22213114) (42213112) (11313115) (31313113) (51313111) (14131114) (34131112) (23231113) (43231111) (12331114) (32331112) (21431113) (41431111) (24122113) (13222114) (33222112) (22322113) (42322111) (11422114) (31422112) (14113114) (34113112) (23213113) (43213111) (12313114) (32313112) (21413113) (41413111) (15131113) (24231112) (13331113) (33331111) (22431112) (25122112) (14222113) (34222111) (23322112) (12422113) (32422111) (21522112) (15113113) (24213112) (13313113) (33313111) (22413112) (11513113) (31513111) (16131112) (25231111) (14331112) (23431111) (15222112) (24322111) (13422112) (22522111) (16113112) (25213111) (14313112) (23413111) (12513112) (21613111) (11141116) (31141114) (51141112) (21132115) (41132113) (61132111) (11123116) (31123114) (51123112) (21114115) (41114113) (61114111) (12141115) (32141113) (52141111) (21241114) (41241112) (22132114) (42132112) (11232115) (31232113) (51232111) (12123115) (32123113) (52123111) (21223114) (41223112) (22114114) (42114112) (11214115) (31214113) (51214111) (13141114) (33141112) (22241113) (42241111) (11341114) (31341112) (23132113) (43132111) (12232114) (32232112) (21332113) (41332111) (13123114) (33123112) (22223113) (42223111) (11323114) (31323112) (23114113) (43114111) (12214114) (32214112) (21314113) (41314111) (14141113) (34141111) (23241112) (12341113) (32341111) (24132112) (13232113) (33232111) (22332112) (11432113) (31432111) (14123113) (34123111) (23223112) (12323113) (32323111) (21423112) (24114112) (13214113) (33214111) (22314112) (11414113) (31414111) (15141112) (24241111) (13341112) (25132111) (14232112) (23332111) (12432112) (15123112) (24223111) (13323112) (22423111) (11523112) (25114111) (14214112) (23314111) (12414112) (21514111) (16141111) (14341111) (15232111) (13432111) (16123111) (14323111) (12523111) (15214111) (13414111) (11614111) (11151115) (31151113) (51151111) (21142114) (41142112) (11133115) (31133113) (51133111) (21124114) (41124112) (11115115) (31115113) (51115111) (12151114) (32151112) (21251113) (41251111) (22142113) (42142111) (11242114) (31242112) (12133114) (32133112) (21233113) (41233111) (22124113) (42124111) (11224114) (31224112) (12115114) (32115112) (21215113) (41215111) (13151113) (33151111) (22251112) (23142112) (12242113) (32242111) (21342112) (13133113) (33133111) (22233112) (11333113) (31333111) (23124112) (12224113) (32224111) (21324112) (13115113) (33115111) (22215112) (11315113) (31315111) (14151112) (23251111) (24142111) (13242112) (22342111) (14133112) (23233111) (12333112) (21433111) (24124111) (13224112) (22324111) (11424112) (14115112) (23215111) (12315112) (21415111) (15151111) (14242111) (15133111) (13333111) (14224111) (12424111) (15115111) (13315111) (11515111) (11161114) (31161112) (21152113) (41152111) (11143114) (31143112) (21134113) (41134111) (11125114) (31125112) (21116113) (41116111) (12161113) (32161111) (22152112) (11252113) (31252111) (12143113) (32143111) (21243112) (22134112) (11234113) (31234111) (12125113) (32125111) (21225112) (22116112) (11216113) (31216111) (13161112) (23152111) (12252112) (13143112) (22243111) (11343112) (23134111) (12234112) (21334111) (13125112) (22225111) (11325112) (23116111) (12216112) (21316111) (14161111) (13252111) (14143111) (12343111) (13234111) (11434111) (14125111) (12325111) (13216111) (11416111) (31111216) (51111214) (31211125) (51211123) (32111215) (52111213) (21211216) (41211214) (61211212) (12211126) (32211124) (52211122) (21311125) (41311123) (61311121) (13111216) (33111214) (22211215) (42211213) (11311216) (31311214) (51311212) (13211125) (33211123) (22311124) (42311122) (11411125) (31411123) (51411121) (14111215) (34111213) (23211214) (43211212) (12311215) (32311213) (52311211) (21411214) (41411212) (14211124) (34211122) (23311123) (43311121) (12411124) (32411122) (21511123) (41511121) (15111214) (24211213) (13311214) (33311212) (22411213) (42411211) (11511214) (31511212) (15211123) (24311122) (13411123) (33411121) (22511122) (11611123) (31611121) (16111213) (25211212) (14311213) (34311211) (23411212) (12511213) (32511211) (21611212) (21121126) (41121124) (61121122) (31112125) (51112123) (31121215) (51121213) (21112216) (41112214) (61112212) (22121125) (42121123) (11221126) (31221124) (51221122) (12112126) (32112124) (52112122) (12121216) (32121214) (52121212) (21221215) (41221213) (61221211) (22112215) (42112213) (11212216) (31212214) (51212212) (23121124) (43121122) (12221125) (32221123) (52221121) (21321124) (41321122) (13112125) (33112123) (13121215) (33121213) (11312125) (22221214) (42221212) (11321215) (31321213) (51321211) (23112214) (43112212) (12212215) (32212213) (52212211) (21312214) (41312212) (24121123) (13221124) (33221122) (22321123) (42321121) (11421124) (31421122) (14112124) (34112122) (14121214) (34121212) (12312124) (23221213) (43221211) (12321214) (32321212) (21421213) (41421211) (24112213) (13212214) (33212212) (22312213) (42312211) (11412214) (31412212) (25121122) (14221123) (34221121) (23321122) (12421123) (32421121) (21521122) (15112123) (15121213) (13312123) (24221212) (13321213) (33321211) (11512123) (22421212) (11521213) (31521211) (25112212) (14212213) (34212211) (23312212) (12412213) (32412211) (21512212) (15221122) (24321121) (13421122) (22521121) (16112122) (16121212) (14312122) (25221211) (14321212) (12512122) (23421211) (12521212) (15212212) (24312211) (13412212) (22512211) (11612212) (21131125) (41131123) (61131121) (11122126) (31122124) (51122122) (11131216) (31131214) (51131212) (21113125) (41113123) (61113121) (21122215) (41122213) (61122211) (11113216) (31113214) (51113212) (22131124) (42131122) (11231125) (31231123) (51231121) (12122125) (32122123) (52122121) (12131215) (32131213) (52131211) (21231214) (41231212) (22113124) (42113122) (11213125) (22122214) (42122212) (11222215) (31222213) (51222211) (12113215) (32113213) (52113211) (21213214) (41213212) (23131123) (43131121) (12231124) (32231122) (21331123) (41331121) (13122124) (33122122) (13131214) (33131212) (11322124) (22231213) (42231211) (11331214) (31331212) (23113123) (43113121) (12213124) (23122213) (43122211) (12222214) (32222212) (21322213) (41322211) (13113214) (33113212) (22213213) (42213211) (11313214) (31313212) (24131122) (13231123) (33231121) (22331122) (11431123) (31431121) (14122123) (34122121) (14131213) (34131211) (12322123) (23231212) (12331213) (32331211) (21431212) (24113122) (13213123) (24122212) (13222213) (33222211) (11413123) (22322212) (11422213) (31422211) (14113213) (34113211) (23213212) (12313213) (32313211) (21413212) (25131121) (14231122) (23331121) (12431122) (15122122) (15131212) (13322122) (24231211) (13331212) (11522122) (22431211) (25113121) (14213122) (25122211) (14222212) (12413122) (23322211) (12422212) (21522211) (15113212) (24213211) (13313212) (22413211) (11513212) (15231121) (13431121) (16122121) (16131211) (14322121) (14331211) (12522121) (15213121) (15222211) (13413121) (13422211) (11613121) (16113211) (14313211) (12513211) (21141124) (41141122) (11132125) (31132123) (51132121) (11141215) (31141213) (51141211) (21123124) (41123122) (21132214) (41132212) (11114125) (31114123) (51114121) (11123215) (31123213) (51123211) (21114214) (41114212) (22141123) (42141121) (11241124) (31241122) (12132124) (32132122) (12141214) (32141212) (21241213) (41241211) (22123123) (42123121) (11223124) (22132213) (42132211) (11232214) (31232212) (12114124) (32114122) (12123214) (32123212) (21223213) (41223211) (22114213) (42114211) (11214214) (31214212) (23141122) (12241123) (32241121) (21341122) (13132123) (33132121) (13141213) (33141211) (11332123) (22241212) (11341213) (31341211) (23123122) (12223123) (23132212) (12232213) (32232211) (21332212) (13114123) (33114121) (13123213) (33123211) (11314123) (22223212) (11323213) (31323211) (23114212) (12214213) (32214211) (21314212) (24141121) (13241122) (22341121) (14132122) (14141212) (12332122) (23241211) (12341212) (24123121) (13223122) (24132211) (13232212) (11423122) (22332211) (11432212) (14114122) (14123212) (12314122) (23223211) (12323212) (21423211) (24114211) (13214212) (22314211) (11414212) (14241121) (15132121) (15141211) (13332121) (13341211) (14223121) (14232211) (12423121) (12432211) (15114121) (15123211) (13314121) (13323211) (11514121) (11523211) (14214211) (12414211) (21151123) (41151121) (11142124) (31142122) (11151214) (31151212) (21133123) (41133121) (21142213) (41142211) (11124124) (31124122) (11133214) (31133212) (21115123) (41115121) (21124213) (41124211) (11115214) (31115212) (22151122) (11251123) (31251121) (12142123) (32142121) (12151213) (32151211) (21251212) (22133122) (11233123) (22142212) (11242213) (31242211) (12124123) (32124121) (12133213) (32133211) (21233212) (22115122) (11215123) (22124212) (11224213) (31224211) (12115213) (32115211) (21215212) (23151121) (12251122) (13142122) (13151212) (11342122) (22251211) (23133121) (12233122) (23142211) (12242212) (21342211) (13124122) (13133212) (11324122) (22233211) (11333212) (23115121) (12215122) (23124211) (12224212) (21324211) (13115212) (22215211) (11315212) (13251121) (14142121) (14151211) (12342121) (13233121) (13242211) (11433121) (14124121) (14133211) (12324121) (12333211) (13215121) (13224211) (11415121) (11424211) (14115211) (12315211) (21161122) (11152123) (31152121) (11161213) (31161211) (21143122) (21152212) (11134123) (31134121) (11143213) (31143211) (21125122) (21134212) (11116123) (31116121) (11125213) (31125211) (22161121) (12152122) (12161212) (22143121) (11243122) (22152211) (11252212) (12134122) (12143212) (21243211) (22125121) (11225122) (22134211) (11234212) (12116122) (12125212) (21225211) (13152121) (13161211) (12243121) (12252211) (13134121) (13143211) (11334121) (11343211) (12225121) (12234211) (13116121) (13125211) (11316121) (11325211) (21111226) (41111224) (61111222) (31111315) (51111313) (21211135) (41211133) (61211131) (22111225) (42111223) (11211226) (31211224) (51211222) (12111316) (32111314) (52111312) (21211315) (41211313) (61211311) (22211134) (42211132) (11311135) (31311133) (51311131) (23111224) (43111222) (12211225) (32211223) (52211221) (21311224) (41311222) (13111315) (33111313) (22211314) (42211312) (11311315) (31311313) (51311311) (23211133) (43211131) (12311134) (32311132) (21411133) (41411131) (24111223) (13211224) (33211222) (22311223) (42311221) (11411224) (31411222) (14111314) (34111312) (23211313) (43211311) (12311314) (32311312) (21411313) (41411311) (24211132) (13311133) (33311131) (22411132) (11511133) (31511131) (25111222) (14211223) (34211221) (23311222) (12411223) (32411221) (21511222) (15111313) (24211312) (13311313) (33311311) (22411312) (11511313) (31511311) (25211131) (14311132) (23411131) (12511132) (21611131) (15211222) (24311221) (13411222) (22511221) (11611222) (16111312) (25211311) (14311312) (23411311) (12511312) (21611311) (31121134) (51121132) (21112135) (41112133) (61112131) (21121225) (41121223) (61121221) (11112226) (31112224) (51112222) (11121316) (31121314) (51121312) (21112315) (41112313) (61112311) (12121135) (32121133) (52121131) (21221134) (41221132) (22112134) (42112132) (11212135) (22121224) (42121222) (11221225) (31221223) (51221221) (12112225) (32112223) (52112221) (12121315) (32121313) (52121311) (21221314) (41221312) (22112314) (42112312) (11212315) (31212313) (51212311) (13121134) (33121132) (22221133) (42221131) (11321134) (31321132) (23112133) (43112131) (12212134) (23121223) (43121221) (12221224) (32221222) (21321223) (41321221) (13112224) (33112222) (13121314) (33121312) (11312224) (22221313) (42221311) (11321314) (31321312) (23112313) (43112311) (12212314) (32212312) (21312313) (41312311) (14121133) (34121131) (23221132) (12321133) (32321131) (21421132) (24112132) (13212133) (24121222) (13221223) (33221221) (11412133) (22321222) (11421223) (31421221) (14112223) (34112221) (14121313) (34121311) (12312223) (23221312) (12321313) (32321311) (21421312) (24112312) (13212313) (33212311) (22312312) (11412313) (31412311) (15121132) (24221131) (13321132) (22421131) ] [ % Odd parity (22121116) (42121114) (31221115) (51221113) (32112115) (52112113) (21212116) (41212114) (61212112) (23121115) (43121113) (12221116) (32221114) (52221112) (21321115) (41321113) (61321111) (13112116) (33112114) (22212115) (42212113) (11312116) (31312114) (51312112) (24121114) (13221115) (33221113) (22321114) (42321112) (11421115) (31421113) (51421111) (14112115) (34112113) (23212114) (43212112) (12312115) (32312113) (52312111) (21412114) (41412112) (25121113) (14221114) (34221112) (23321113) (43321111) (12421114) (32421112) (21521113) (41521111) (15112114) (24212113) (13312114) (33312112) (22412113) (42412111) (11512114) (31512112) (15221113) (24321112) (13421113) (33421111) (22521112) (16112113) (25212112) (14312113) (34312111) (23412112) (12512113) (32512111) (21612112) (21131116) (41131114) (61131112) (31122115) (51122113) (21113116) (41113114) (61113112) (22131115) (42131113) (11231116) (31231114) (51231112) (12122116) (32122114) (52122112) (21222115) (41222113) (61222111) (22113115) (42113113) (11213116) (31213114) (51213112) (23131114) (43131112) (12231115) (32231113) (52231111) (21331114) (41331112) (13122115) (33122113) (22222114) (42222112) (11322115) (31322113) (51322111) (23113114) (43113112) (12213115) (32213113) (52213111) (21313114) (41313112) (24131113) (13231114) (33231112) (22331113) (42331111) (11431114) (31431112) (14122114) (34122112) (23222113) (43222111) (12322114) (32322112) (21422113) (41422111) (24113113) (13213114) (33213112) (22313113) (42313111) (11413114) (31413112) (25131112) (14231113) (34231111) (23331112) (12431113) (32431111) (15122113) (24222112) (13322113) (33322111) (22422112) (11522113) (31522111) (25113112) (14213113) (34213111) (23313112) (12413113) (32413111) (21513112) (15231112) (24331111) (13431112) (16122112) (25222111) (14322112) (23422111) (12522112) (15213112) (24313111) (13413112) (22513111) (11613112) (21141115) (41141113) (61141111) (11132116) (31132114) (51132112) (21123115) (41123113) (61123111) (11114116) (31114114) (51114112) (22141114) (42141112) (11241115) (31241113) (51241111) (12132115) (32132113) (52132111) (21232114) (41232112) (22123114) (42123112) (11223115) (31223113) (51223111) (12114115) (32114113) (52114111) (21214114) (41214112) (23141113) (43141111) (12241114) (32241112) (21341113) (41341111) (13132114) (33132112) (22232113) (42232111) (11332114) (31332112) (23123113) (43123111) (12223114) (32223112) (21323113) (41323111) (13114114) (33114112) (22214113) (42214111) (11314114) (31314112) (24141112) (13241113) (33241111) (22341112) (14132113) (34132111) (23232112) (12332113) (32332111) (21432112) (24123112) (13223113) (33223111) (22323112) (11423113) (31423111) (14114113) (34114111) (23214112) (12314113) (32314111) (21414112) (25141111) (14241112) (23341111) (15132112) (24232111) (13332112) (22432111) (25123111) (14223112) (23323111) (12423112) (21523111) (15114112) (24214111) (13314112) (22414111) (11514112) (15241111) (16132111) (14332111) (15223111) (13423111) (16114111) (14314111) (12514111) (21151114) (41151112) (11142115) (31142113) (51142111) (21133114) (41133112) (11124115) (31124113) (51124111) (21115114) (41115112) (22151113) (42151111) (11251114) (31251112) (12142114) (32142112) (21242113) (41242111) (22133113) (42133111) (11233114) (31233112) (12124114) (32124112) (21224113) (41224111) (22115113) (42115111) (11215114) (31215112) (23151112) (12251113) (32251111) (13142113) (33142111) (22242112) (11342113) (31342111) (23133112) (12233113) (32233111) (21333112) (13124113) (33124111) (22224112) (11324113) (31324111) (23115112) (12215113) (32215111) (21315112) (24151111) (13251112) (14142112) (23242111) (12342112) (24133111) (13233112) (22333111) (11433112) (14124112) (23224111) (12324112) (21424111) (24115111) (13215112) (22315111) (11415112) (14251111) (15142111) (13342111) (14233111) (12433111) (15124111) (13324111) (11524111) (14215111) (12415111) (21161113) (41161111) (11152114) (31152112) (21143113) (41143111) (11134114) (31134112) (21125113) (41125111) (11116114) (31116112) (22161112) (12152113) (32152111) (21252112) (22143112) (11243113) (31243111) (12134113) (32134111) (21234112) (22125112) (11225113) (31225111) (12116113) (32116111) (21216112) (23161111) (13152112) (22252111) (23143111) (12243112) (21343111) (13134112) (22234111) (11334112) (23125111) (12225112) (21325111) (13116112) (22216111) (11316112) (14152111) (13243111) (14134111) (12334111) (13225111) (11425111) (14116111) (12316111) (41111215) (61111213) (21211126) (41211124) (61211122) (22111216) (42111214) (31211215) (51211213) (22211125) (42211123) (11311126) (31311124) (51311122) (23111215) (43111213) (12211216) (32211214) (52211212) (21311215) (41311213) (61311211) (23211124) (43211122) (12311125) (32311123) (52311121) (21411124) (41411122) (24111214) (13211215) (33211213) (22311214) (42311212) (11411215) (31411213) (51411211) (24211123) (13311124) (33311122) (22411123) (42411121) (11511124) (31511122) (25111213) (14211214) (34211212) (23311213) (43311211) (12411214) (32411212) (21511213) (41511211) (25211122) (14311123) (34311121) (23411122) (12511123) (32511121) (21611122) (15211213) (24311212) (13411213) (33411211) (22511212) (11611213) (31611211) (31121125) (51121123) (21112126) (41112124) (61112122) (21121216) (41121214) (61121212) (31112215) (51112213) (12121126) (32121124) (52121122) (21221125) (41221123) (61221121) (22112125) (42112123) (11212126) (22121215) (42121213) (11221216) (31221214) (51221212) (12112216) (32112214) (52112212) (21212215) (41212213) (61212211) (13121125) (33121123) (22221124) (42221122) (11321125) (31321123) (51321121) (23112124) (43112122) (12212125) (23121214) (43121212) (12221215) (32221213) (52221211) (21321214) (41321212) (13112215) (33112213) (22212214) (42212212) (11312215) (31312213) (51312211) (14121124) (34121122) (23221123) (43221121) (12321124) (32321122) (21421123) (41421121) (24112123) (13212124) (24121213) (13221214) (33221212) (11412124) (22321213) (42321211) (11421214) (31421212) (14112214) (34112212) (23212213) (43212211) (12312214) (32312212) (21412213) (41412211) (15121123) (24221122) (13321123) (33321121) (22421122) (11521123) (31521121) (25112122) (14212123) (25121212) (14221213) (34221211) (12412123) (23321212) (12421213) (32421211) (21521212) (15112213) (24212212) (13312213) (33312211) (22412212) (11512213) (31512211) (16121122) (25221121) (14321122) (23421121) (12521122) (15212122) (15221212) (13412122) (24321211) (13421212) (11612122) (22521211) (16112212) (25212211) (14312212) (23412211) (12512212) (21612211) (11131126) (31131124) (51131122) (21122125) (41122123) (61122121) (21131215) (41131213) (61131211) (11113126) (31113124) (51113122) (11122216) (31122214) (51122212) (21113215) (41113213) (61113211) (12131125) (32131123) (52131121) (21231124) (41231122) (22122124) (42122122) (11222125) (22131214) (42131212) (11231215) (31231213) (51231211) (12113125) (32113123) (52113121) (12122215) (32122213) (52122211) (21222214) (41222212) (22113214) (42113212) (11213215) (31213213) (51213211) (13131124) (33131122) (22231123) (42231121) (11331124) (31331122) (23122123) (43122121) (12222124) (23131213) (43131211) (12231214) (32231212) (21331213) (41331211) (13113124) (33113122) (13122214) (33122212) (11313124) (22222213) (42222211) (11322214) (31322212) (23113213) (43113211) (12213214) (32213212) (21313213) (41313211) (14131123) (34131121) (23231122) (12331123) (32331121) (21431122) (24122122) (13222123) (24131212) (13231213) (33231211) (11422123) (22331212) (11431213) (31431211) (14113123) (34113121) (14122213) (34122211) (12313123) (23222212) (12322213) (32322211) (21422212) (24113212) (13213213) (33213211) (22313212) (11413213) (31413211) (15131122) (24231121) (13331122) (22431121) (25122121) (14222122) (25131211) (14231212) (12422122) (23331211) (12431212) (15113122) (15122212) (13313122) (24222211) (13322212) (11513122) (22422211) (11522212) (25113211) (14213212) (23313211) (12413212) (21513211) (16131121) (14331121) (15222121) (15231211) (13422121) (13431211) (16113121) (16122211) (14313121) (14322211) (12513121) (12522211) (15213211) (13413211) (11613211) (11141125) (31141123) (51141121) (21132124) (41132122) (21141214) (41141212) (11123125) (31123123) (51123121) (11132215) (31132213) (51132211) (21114124) (41114122) (21123214) (41123212) (11114215) (31114213) (51114211) (12141124) (32141122) (21241123) (41241121) (22132123) (42132121) (11232124) (22141213) (42141211) (11241214) (31241212) (12123124) (32123122) (12132214) (32132212) (21232213) (41232211) (22114123) (42114121) (11214124) (22123213) (42123211) (11223214) (31223212) (12114214) (32114212) (21214213) (41214211) (13141123) (33141121) (22241122) (11341123) (31341121) (23132122) (12232123) (23141212) (12241213) (32241211) (21341212) (13123123) (33123121) (13132213) (33132211) (11323123) (22232212) (11332213) (31332211) (23114122) (12214123) (23123212) (12223213) (32223211) (21323212) (13114213) (33114211) (22214212) (11314213) (31314211) (14141122) (23241121) (12341122) (24132121) (13232122) (24141211) (13241212) (11432122) (22341211) (14123122) (14132212) (12323122) (23232211) (12332212) (21432211) (24114121) (13214122) (24123211) (13223212) (11414122) (22323211) (11423212) (14114212) (23214211) (12314212) (21414211) (15141121) (13341121) (14232121) (14241211) (12432121) (15123121) (15132211) (13323121) (13332211) (11523121) (14214121) (14223211) (12414121) (12423211) (15114211) (13314211) (11514211) (11151124) (31151122) (21142123) (41142121) (21151213) (41151211) (11133124) (31133122) (11142214) (31142212) (21124123) (41124121) (21133213) (41133211) (11115124) (31115122) (11124214) (31124212) (21115213) (41115211) (12151123) (32151121) (21251122) (22142122) (11242123) (22151212) (11251213) (31251211) (12133123) (32133121) (12142213) (32142211) (21242212) (22124122) (11224123) (22133212) (11233213) (31233211) (12115123) (32115121) (12124213) (32124211) (21224212) (22115212) (11215213) (31215211) (13151122) (22251121) (23142121) (12242122) (23151211) (12251212) (13133122) (13142212) (11333122) (22242211) (11342212) (23124121) (12224122) (23133211) (12233212) (21333211) (13115122) (13124212) (11315122) (22224211) (11324212) (23115211) (12215212) (21315211) (14151121) (13242121) (13251211) (14133121) (14142211) (12333121) (12342211) (13224121) (13233211) (11424121) (11433211) (14115121) (14124211) (12315121) (12324211) (13215211) (11415211) (11161123) (31161121) (21152122) (21161212) (11143123) (31143121) (11152213) (31152211) (21134122) (21143212) (11125123) (31125121) (11134213) (31134211) (21116122) (21125212) (12161122) (22152121) (11252122) (22161211) (12143122) (12152212) (21252211) (22134121) (11234122) (22143211) (11243212) (12125122) (12134212) (21234211) (22116121) (11216122) (22125211) (11225212) (13161121) (12252121) (13143121) (13152211) (11343121) (12234121) (12243211) (13125121) (13134211) (11325121) (11334211) (12216121) (12225211) (31111225) (51111223) (21111316) (41111314) (61111312) (31211134) (51211132) (12111226) (32111224) (52111222) (21211225) (41211223) (61211221) (22111315) (42111313) (11211316) (31211314) (51211312) (12211135) (32211133) (52211131) (21311134) (41311132) (13111225) (33111223) (22211224) (42211222) (11311225) (31311223) (51311221) (23111314) (43111312) (12211315) (32211313) (52211311) (21311314) (41311312) (13211134) (33211132) (22311133) (42311131) (11411134) (31411132) (14111224) (34111222) (23211223) (43211221) (12311224) (32311222) (21411223) (41411221) (24111313) (13211314) (33211312) (22311313) (42311311) (11411314) (31411312) (14211133) (34211131) (23311132) (12411133) (32411131) (21511132) (15111223) (24211222) (13311223) (33311221) (22411222) (11511223) (31511221) (25111312) (14211313) (34211311) (23311312) (12411313) (32411311) (21511312) (15211132) (24311131) (13411132) (22511131) (11611132) (16111222) (25211221) (14311222) (23411221) (12511222) (21611221) (15211312) (24311311) (13411312) (22511311) (11611312) (21121135) (41121133) (61121131) (11112136) (31112134) (51112132) (11121226) (31121224) (51121222) (21112225) (41112223) (61112221) (21121315) (41121313) (61121311) (11112316) (31112314) (51112312) (22121134) (42121132) (11221135) (31221133) (51221131) (12112135) (32112133) (52112131) (12121225) (32121223) (52121221) (21221224) (41221222) (22112224) (42112222) (11212225) (22121314) (42121312) (11221315) (31221313) (51221311) (12112315) (32112313) (52112311) (21212314) (41212312) (23121133) (43121131) (12221134) (32221132) (21321133) (41321131) (13112134) (33112132) (13121224) (33121222) (11312134) (22221223) (42221221) (11321224) (31321222) (23112223) (43112221) (12212224) (23121313) (43121311) (12221314) (32221312) (21321313) (41321311) (13112314) (33112312) (22212313) (42212311) (11312314) (31312312) (24121132) (13221133) (33221131) (22321132) (11421133) (31421131) (14112133) (34112131) (14121223) (34121221) (12312133) (23221222) (12321223) (32321221) (21421222) (24112222) (13212223) (24121312) (13221313) (33221311) (11412223) (22321312) (11421313) (31421311) (14112313) (34112311) (23212312) (12312313) (32312311) (21412312) (25121131) (14221132) (23321131) (12421132) (21521131) (15112132) (15121222) (13312132) (24221221) (13321222) (11512132) (22421221) (11521222) (25112221) (14212222) (25121311) (14221312) (12412222) (23321311) (12421312) (21521311) (15112312) (24212311) (13312312) (22412311) (11512312) (15221131) (13421131) (16112131) (16121221) (14312131) (14321221) (12512131) (12521221) (15212221) (15221311) (13412221) (13421311) (11612221) (16112311) (14312311) (12512311) (21131134) (41131132) (11122135) (31122133) (51122131) (11131225) (31131223) (51131221) (21113134) (41113132) (21122224) (41122222) (21131314) (41131312) (11113225) (31113223) (51113221) (11122315) (31122313) (51122311) (21113314) (41113312) (22131133) (42131131) (11231134) (31231132) (12122134) (32122132) (12131224) (32131222) (21231223) (41231221) (22113133) (42113131) (11213134) (22122223) (42122221) (11222224) (22131313) (42131311) (11231314) (31231312) (12113224) (32113222) (12122314) (32122312) (21222313) (41222311) (22113313) (42113311) (11213314) (31213312) (23131132) (12231133) (32231131) (21331132) (13122133) (33122131) (13131223) (33131221) (11322133) (22231222) (11331223) (31331221) (23113132) (12213133) (23122222) (12222223) (23131312) (12231313) (32231311) (21331312) (13113223) (33113221) (13122313) (33122311) (11313223) (22222312) (11322313) (31322311) (23113312) (12213313) (32213311) (21313312) (24131131) (13231132) (22331131) (11431132) (14122132) (14131222) (12322132) (23231221) (12331222) (21431221) (24113131) (13213132) (24122221) (13222222) (24131311) (11413132) (13231312) (11422222) (22331311) (11431312) (14113222) (14122312) (12313222) (23222311) (12322312) (21422311) (24113311) (13213312) (22313311) (11413312) (14231131) (12431131) (15122131) (15131221) (13322131) (13331221) (11522131) (14213131) (14222221) (12413131) (14231311) (12422221) (12431311) (15113221) (15122311) (13313221) (13322311) (11513221) (11522311) (14213311) (12413311) (21141133) (41141131) (11132134) (31132132) (11141224) (31141222) (21123133) (41123131) (21132223) (41132221) (21141313) (41141311) (11114134) (31114132) (11123224) (31123222) (11132314) (31132312) (21114223) (41114221) (21123313) (41123311) (11114314) (31114312) (22141132) (11241133) (31241131) (12132133) (32132131) (12141223) (32141221) (21241222) (22123132) (11223133) (22132222) (11232223) (22141312) (11241313) (31241311) (12114133) (32114131) (12123223) (32123221) (12132313) (32132311) (21232312) (22114222) (11214223) (22123312) (11223313) (31223311) (12114313) (32114311) (21214312) (23141131) (12241132) (21341131) (13132132) (13141222) (11332132) (22241221) (11341222) (23123131) (12223132) (23132221) (12232222) (23141311) (12241312) (21341311) (13114132) (13123222) (11314132) (13132312) (11323222) (22232311) (11332312) (23114221) (12214222) (23123311) (12223312) (21323311) (13114312) (22214311) (11314312) (13241131) (14132131) (14141221) (12332131) (12341221) (13223131) (13232221) (11423131) (13241311) (11432221) (14114131) (14123221) (12314131) (14132311) (12323221) (12332311) (13214221) (13223311) (11414221) (11423311) (14114311) (12314311) (21151132) (11142133) (31142131) (11151223) (31151221) (21133132) (21142222) (21151312) (11124133) (31124131) (11133223) (31133221) (11142313) (31142311) (21115132) (21124222) (21133312) (11115223) (31115221) (11124313) (31124311) (22151131) (11251132) (12142132) (12151222) (21251221) (22133131) (11233132) (22142221) (11242222) (22151311) (11251312) (12124132) (12133222) (12142312) (21242311) (22115131) (11215132) (22124221) (11224222) (22133311) (11233312) (12115222) (12124312) (21224311) (12251131) (13142131) (13151221) (11342131) (12233131) (12242221) (12251311) (13124131) (13133221) (11324131) (13142311) (11333221) (11342311) (12215131) (12224221) (12233311) (13115221) (13124311) (11315221) (11324311) (21161131) (11152132) (11161222) (21143131) (21152221) (21161311) (11134132) (11143222) (11152312) (21125131) (21134221) (21143311) (11116132) (11125222) (11134312) (12152131) (12161221) (11243131) (11252221) (12134131) (12143221) (12152311) (11225131) (11234221) (11243311) (12116131) (12125221) (12134311) (21111235) (41111233) (61111231) (11111326) (31111324) (51111322) (21111415) (41111413) (61111411) (21211144) (41211142) (22111234) (42111232) (11211235) (31211233) (51211231) (12111325) (32111323) (52111321) (21211324) (41211322) (22111414) (42111412) (11211415) (31211413) (51211411) (22211143) (42211141) (11311144) (31311142) (23111233) (43111231) (12211234) (32211232) (21311233) (41311231) (13111324) (33111322) (22211323) (42211321) (11311324) (31311322) (23111413) (43111411) (12211414) (32211412) (21311413) (41311411) (23211142) (12311143) (32311141) (21411142) (24111232) (13211233) (33211231) (22311232) (11411233) (31411231) (14111323) (34111321) (23211322) (12311323) (32311321) (21411322) (24111412) (13211413) (33211411) (22311412) (11411413) (31411411) (24211141) (13311142) (22411141) (11511142) (25111231) (14211232) (23311231) (12411232) (21511231) (15111322) (24211321) (13311322) (22411321) (11511322) (25111411) (14211412) (23311411) (12411412) (21511411) (14311141) (12511141) (15211231) (13411231) (11611231) (16111321) (14311321) (12511321) (15211411) (13411411) (11611411) (31121143) (51121141) (21112144) (41112142) (21121234) (41121232) (11112235) (31112233) (51112231) (11121325) (31121323) (51121321) (21112324) (41112322) (21121414) (41121412) (11112415) (31112413) (51112411) (12121144) (32121142) (21221143) (41221141) (22112143) (42112141) (11212144) (22121233) (42121231) (11221234) (31221232) (12112234) (32112232) (12121324) (32121322) (21221323) (41221321) (22112323) (42112321) (11212324) (22121413) (42121411) (11221414) (31221412) (12112414) (32112412) (21212413) (41212411) (13121143) (33121141) (22221142) (11321143) (31321141) (23112142) (12212143) (23121232) (12221233) (32221231) (21321232) (13112233) (33112231) (13121323) (33121321) (11312233) (22221322) (11321323) (31321321) (23112322) (12212323) (23121412) (12221413) (32221411) (21321412) (13112413) (33112411) (22212412) (11312413) (31312411) (14121142) (23221141) (12321142) (21421141) (24112141) (13212142) (24121231) (13221232) (11412142) (22321231) (11421232) (14112232) (14121322) (12312232) (23221321) (12321322) (21421321) (24112321) (13212322) (24121411) (13221412) (11412322) (22321411) (11421412) (14112412) (23212411) (12312412) (21412411) (15121141) (13321141) (11521141) (14212141) (14221231) (12412141) (12421231) (15112231) (15121321) (13312231) (13321321) (11512231) (11521321) (14212321) (14221411) (12412321) (12421411) (15112411) (13312411) (11512411) (11131144) (31131142) (21122143) (41122141) (21131233) (41131231) (11113144) (31113142) (11122234) (31122232) (11131324) (31131322) (21113233) (41113231) (21122323) (41122321) (21131413) (41131411) (11113324) (31113322) (11122414) (31122412) (21113413) (41113411) (12131143) (32131141) (21231142) (22122142) (11222143) (22131232) (11231233) (31231231) (12113143) (32113141) (12122233) (32122231) (12131323) (32131321) (21231322) (22113232) (11213233) (22122322) (11222323) (22131412) (11231413) (31231411) (12113323) (32113321) (12122413) (32122411) (21222412) (22113412) (11213413) (31213411) (13131142) (22231141) (11331142) (23122141) (12222142) (23131231) (12231232) (21331231) (13113142) (13122232) (11313142) (13131322) (11322232) (22231321) (11331322) (23113231) (12213232) (23122321) (12222322) (23131411) (12231412) (21331411) (13113322) (13122412) (11313322) (22222411) (11322412) (23113411) (12213412) (21313411) (14131141) (12331141) (13222141) (13231231) (11422141) (11431231) (14113141) (14122231) (12313141) (14131321) (12322231) (12331321) (13213231) (13222321) (11413231) (13231411) (11422321) (11431411) (14113321) (14122411) (12313321) (12322411) (13213411) (11413411) (11141143) (31141141) (21132142) (21141232) (11123143) (31123141) (11132233) (31132231) (11141323) (31141321) (21114142) (21123232) (21132322) (21141412) (11114233) (31114231) (11123323) (31123321) (11132413) (31132411) (21114322) (21123412) (12141142) (21241141) (22132141) (11232142) (22141231) (11241232) (12123142) (12132232) (12141322) (21241321) (22114141) (11214142) (22123231) (11223232) (22132321) (11232322) (22141411) (11241412) (12114232) (12123322) (12132412) (21232411) (22114321) (11214322) (22123411) (11223412) (13141141) (11341141) (12232141) (12241231) (13123141) (13132231) (11323141) (13141321) (11332231) (11341321) (12214141) (12223231) (12232321) (12241411) (13114231) (13123321) (11314231) (13132411) (11323321) (11332411) (12214321) (12223411) (11151142) (21142141) (21151231) (11133142) (11142232) (11151322) (21124141) (21133231) (21142321) (21151411) (11115142) (11124232) (11133322) (11142412) (21115231) (21124321) (21133411) (12151141) (11242141) (11251231) (12133141) (12142231) (12151321) (11224141) (11233231) (11242321) (11251411) (12115141) (12124231) (12133321) (12142411) (11215231) (11224321) (11233411) (11161141) (11143141) (11152231) (11161321) (11125141) (11134231) (11143321) (11152411) (11111245) (31111243) (51111241) (21111334) (41111332) (11111425) (31111423) (51111421) (21111514) (41111512) (31211152) (12111244) (32111242) (21211243) (41211241) (22111333) (42111331) (11211334) (31211332) (12111424) (32111422) (21211423) (41211421) (22111513) (42111511) (11211514) (31211512) (12211153) (32211151) (21311152) (13111243) (33111241) (22211242) (11311243) (31311241) (23111332) (12211333) (32211331) (21311332) (13111423) (33111421) (22211422) (11311423) (31311421) (23111512) (12211513) (32211511) (21311512) (13211152) (22311151) (11411152) (14111242) (23211241) (12311242) (21411241) (24111331) (13211332) (22311331) (11411332) (14111422) (23211421) (12311422) (21411421) (24111511) (13211512) (22311511) (11411512) (14211151) (12411151) (15111241) (13311241) (11511241) (14211331) (12411331) (15111421) (13311421) (11511421) (14211511) (12411511) (21121153) (41121151) (11112154) (31112152) (11121244) (31121242) (21112243) (41112241) (21121333) (41121331) (11112334) (31112332) (11121424) (31121422) (21112423) (41112421) (21121513) (41121511) (11112514) (31112512) (22121152) (11221153) (31221151) (12112153) (32112151) (12121243) (32121241) (21221242) (22112242) (11212243) (22121332) (11221333) (31221331) (12112333) (32112331) (12121423) (32121421) (21221422) (22112422) (11212423) (22121512) (11221513) (31221511) (12112513) (32112511) (21212512) (23121151) (12221152) (21321151) (13112152) (13121242) (11312152) (22221241) (11321242) (23112241) (12212242) (23121331) (12221332) (21321331) (13112332) (13121422) (11312332) (22221421) (11321422) (23112421) (12212422) (23121511) (12221512) (21321511) (13112512) (22212511) (11312512) (13221151) (11421151) (14112151) (14121241) (12312151) (12321241) (13212241) (13221331) (11412241) (11421331) (14112331) (14121421) (12312331) (12321421) (13212421) (13221511) (11412421) (11421511) (14112511) (12312511) (21131152) (11122153) (31122151) (11131243) (31131241) (21113152) (21122242) (21131332) (11113243) (31113241) (11122333) (31122331) (11131423) (31131421) (21113332) (21122422) (21131512) (11113423) (31113421) (11122513) (31122511) (22131151) (11231152) (12122152) (12131242) (21231241) (22113151) (11213152) (22122241) (11222242) (22131331) (11231332) (12113242) (12122332) (12131422) (21231421) (22113331) (11213332) (22122421) (11222422) (22131511) (11231512) (12113422) (12122512) (21222511) (12231151) (13122151) (13131241) (11322151) (11331241) (12213151) (12222241) (12231331) (13113241) (13122331) (11313241) (13131421) (11322331) (11331421) (12213331) (12222421) (12231511) (13113421) (13122511) (11313421) (11322511) (21141151) (11132152) (11141242) (21123151) (21132241) (21141331) (11114152) (11123242) (11132332) (11141422) (21114241) (21123331) (21132421) (21141511) (11114332) (11123422) (11132512) (11241151) (12132151) (12141241) (11223151) (11232241) (11241331) (12114151) (12123241) (12132331) (12141421) (11214241) (11223331) (11232421) (11241511) (12114331) (12123421) (12132511) (11142151) (11151241) (11124151) (11133241) (11142331) (11151421) (11115241) (11124331) (11133421) (11142511) (21111253) (41111251) (11111344) (31111342) (21111433) (41111431) (11111524) (31111522) (21111613) (41111611) (21211162) (22111252) (11211253) (31211251) (12111343) (32111341) (21211342) (22111432) (11211433) (31211431) (12111523) (32111521) (21211522) (22111612) (11211613) (31211611) (22211161) (11311162) (23111251) (12211252) (21311251) (13111342) (22211341) (11311342) (23111431) (12211432) (21311431) (13111522) (22211521) (11311522) (23111611) (12211612) (21311611) (12311161) (13211251) (11411251) (14111341) (12311341) (13211431) (11411431) (14111521) (12311521) (13211611) (11411611) (31121161) (21112162) (21121252) (11112253) (31112251) (11121343) (31121341) (21112342) (21121432) (11112433) (31112431) (11121523) (31121521) (21112522) (21121612) (12121162) (21221161) (22112161) (11212162) (22121251) (11221252) (12112252) (12121342) (21221341) (22112341) (11212342) (22121431) (11221432) (12112432) (12121522) (21221521) (22112521) (11212522) (22121611) (11221612) (13121161) (11321161) (12212161) (12221251) (13112251) (13121341) (11312251) (11321341) (12212341) (12221431) (13112431) (13121521) (11312431) (11321521) (12212521) (12221611) (11131162) (21122161) (21131251) (11113162) ] ] def /parity [ (1001) (0101) (1100) (0011) (1010) (0110) (1111) (0000) ] def % Derive the bits for each row /rowbits r array def 0 1 r 1 sub { /i exch def /p i r 1 sub ne {parity i get} {(0000)} ifelse def /ccrow ccs i 8 mul 8 getinterval def /scrow [ 0 2 7 {ccrow exch 2 getinterval aload pop exch 49 mul add} for ] def /sbs [ 10 1 1 0 1 3 { /j exch def patterns p j get 48 sub get scrow j get get {48 sub} forall } for 4 1 ] def mark 1 sbs {1 index 0 eq {{1}} {{0}} ifelse repeat} forall counttomark 1 sub array astore exch pop exch pop rowbits i 3 -1 roll put } for % Populate the bitmap /pixs [ 81 sepheight mul {1} repeat 0 1 r 2 sub { /i exch def rowheight {rowbits i get aload pop} repeat sepheight {10 {0} repeat 70 {1} repeat 0} repeat } for rowheight {rowbits r 1 sub get aload pop} repeat 81 sepheight mul {1} repeat ] def % Return the arguments << /ren //renmatrix /pixs pixs /pixx 81 /pixy pixs length 81 idiv /height pixs length 81 idiv 72 div /width 81 72 div /opt options >> dontdraw not //renmatrix if end } bind def /code49 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER code49-- postscriptbarcode-2014-03-12/src/code93.ps000066400000000000000000000136601231007474100200620ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER code93-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Code 93 % --EXAM: THIS IS CODE 93 % --EXOP: includetext includecheck % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /code93 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includecheck false def % Enable/disable checkdigit /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 1 def /parsefnc false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def /encs [ (131112) (111213) (111312) (111411) (121113) (121212) (121311) (111114) (131211) (141111) (211113) (211212) (211311) (221112) (221211) (231111) (112113) (112212) (112311) (122112) (132111) (111123) (111222) (111321) (121122) (131121) (212112) (212211) (211122) (211221) (221121) (222111) (112122) (112221) (122121) (123111) (121131) (311112) (311211) (321111) (112131) (113121) (211131) (121221) (312111) (311121) (122211) (111141) (1111411) ] def % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%) def /barlen barcode length def % Special function characters /sft1 -1 def /sft2 -2 def /sft3 -3 def /sft4 -4 def /fncvals << (SFT$) sft1 (SFT%) sft2 (SFT/) sft3 (SFT+) sft4 >> def % Convert input into bytes accounting for shift characters /msg barlen array def /i 0 def /j 0 def { i barlen eq {exit} if /char barcode i get def parsefnc char 94 eq and i barlen 4 sub lt and { barcode i 1 add get 94 ne { /char fncvals barcode i 1 add 4 getinterval get def /i i 4 add def } { /i i 1 add def } ifelse } if msg j char put /i i 1 add def /j j 1 add def } loop /msg msg 0 j getinterval def /msglen msg length def includecheck { /sbs msglen 6 mul 25 add string def } { /sbs msglen 6 mul 13 add string def } ifelse /txt msglen array def % Put the start character sbs 0 encs 47 get putinterval /checksum1 0 def /checksum2 0 def 0 1 msglen 1 sub { /i exch def % Lookup the encoding for the each barcode character msg i get dup 0 lt { 42 exch sub /indx exch def /char ( ) def } { 1 string dup 0 4 -1 roll put /char exch def barchars char search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post } ifelse /enc encs indx get def % Get the indxth encoding sbs i 6 mul 6 add enc putinterval % Put encoded digit into sbs txt i [char i 9 mul 9 add textyoffset textfont textsize] put /checksum1 checksum1 msglen i sub 1 sub 20 mod 1 add indx mul add def /checksum2 checksum2 msglen i sub 15 mod 1 add indx mul add def } for includecheck { % Put the first checksum character /checksum1 checksum1 47 mod def /checksum2 checksum2 checksum1 add 47 mod def sbs msglen 6 mul 6 add encs checksum1 get putinterval sbs msglen 6 mul 12 add encs checksum2 get putinterval % Put the end character sbs msglen 6 mul 18 add encs 48 get putinterval } { % Put the end character sbs msglen 6 mul 6 add encs 48 get putinterval } ifelse % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /code93 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER code93-- postscriptbarcode-2014-03-12/src/code93ext.ps000066400000000000000000000124321231007474100205770ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER code93ext-- % --REQUIRES preamble raiseerror renlinear code93-- % --DESC: Code 93 Extended % --EXAM: Code93 Ext! % --EXOP: includetext includecheck % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /code93 dup /uk.co.terryburton.bwipp findresource put begin /code93ext { 20 dict begin /options exch def % We are given an options string /barcode exch def % We are given the code39extended text /dontdraw false def /includetext false def /parse false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if /barlen barcode length def % Extended alphabet to non-extended alphabet /extencs [ (^SFT%U) (^SFT$A) (^SFT$B) (^SFT$C) (^SFT$D) (^SFT$E) (^SFT$F) (^SFT$G) (^SFT$H) (^SFT$I) (^SFT$J) (^SFT$K) (^SFT$L) (^SFT$M) (^SFT$N) (^SFT$O) (^SFT$P) (^SFT$Q) (^SFT$R) (^SFT$S) (^SFT$T) (^SFT$U) (^SFT$V) (^SFT$W) (^SFT$X) (^SFT$Y) (^SFT$Z) (^SFT%A) (^SFT%B) (^SFT%C) (^SFT%D) (^SFT%E) ( ) (^SFT/A) (^SFT/B) (^SFT/C) (^SFT/D) (^SFT/E) (^SFT/F) (^SFT/G) (^SFT/H) (^SFT/I) (^SFT/J) (^SFT/K) (^SFT/L) (-) (.) (^SFT/O) (0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (^SFT/Z) (^SFT%F) (^SFT%G) (^SFT%H) (^SFT%I) (^SFT%J) (^SFT%V) (A) (B) (C) (D) (E) (F) (G) (H) (I) (J) (K) (L) (M) (N) (O) (P) (Q) (R) (S) (T) (U) (V) (W) (X) (Y) (Z) (^SFT%K) (^SFT%L) (^SFT%M) (^SFT%N) (^SFT%O) (^SFT%W) (^SFT+A) (^SFT+B) (^SFT+C) (^SFT+D) (^SFT+E) (^SFT+F) (^SFT+G) (^SFT+H) (^SFT+I) (^SFT+J) (^SFT+K) (^SFT+L) (^SFT+M) (^SFT+N) (^SFT+O) (^SFT+P) (^SFT+Q) (^SFT+R) (^SFT+S) (^SFT+T) (^SFT+U) (^SFT+V) (^SFT+W) (^SFT+X) (^SFT+Y) (^SFT+Z) (^SFT%P) (^SFT%Q) (^SFT%R) (^SFT%S) (^SFT%T) ] def /newcode barlen 6 mul string def /newtext barlen 6 mul string def /j 0 def /k 0 def 0 1 barlen 1 sub { /i exch def /extchar extencs barcode i get get def /extlen extchar length def newcode j extchar putinterval newtext k barcode i get put extlen 1 ne {newtext k 1 add ( ) putinterval} if /j j extlen add def /k k extlen 1 eq {1} {2} ifelse add def } for /newcode newcode 0 j getinterval def /newtext newtext 0 k getinterval def % Get the result of encoding with code93 options (dontdraw) true put options (parsefnc) true put /args newcode options //code93 exec def % Replace chars in /txt with chars in newtext includetext { /txt args (txt) get def 0 1 newtext length 1 sub { /i exch def /txtentry txt i get def txtentry 0 newtext i 1 getinterval put txt i txtentry put } for args (txt) txt put } if args (opt) options put args dontdraw not //renlinear if end } bind def /code93ext dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER code93ext-- postscriptbarcode-2014-03-12/src/codeone.ps000066400000000000000000000274151231007474100204130ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER codeone-- % --REQUIRES preamble raiseerror renmatrix-- % --DESC: Code One % --EXAM: Code One % --EXOP: version=B % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /codeone { 20 dict begin /options exch def /barcode exch def /dontdraw false def /version (unset) def /encoding (ascii) def /raw false def /parse false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /stype version 0 1 getinterval (S) eq def stype {/raw true def} if % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if /barlen barcode length def raw {/encoding (raw) def} if encoding (raw) eq { /cws barlen array def /i 0 def /j 0 def { % loop i barlen eq {exit} if /cw barcode i 1 add 3 getinterval cvi def cws j cw put /i i 4 add def /j j 1 add def } loop /cws cws 0 j getinterval def } if encoding (ascii) eq { /cws barlen 2 mul array def /i 0 def /j 0 def { % loop i barlen eq {exit} if /char barcode i get def char 48 ge char 57 le and i barlen 1 sub lt and { barcode i 1 add get dup 48 ge exch 57 le and { % Digit pair cws j barcode i 2 getinterval cvi 130 add put /i i 2 add def /j j 1 add def } { % Singular digit cws j char 1 add put /i i 1 add def /j j 1 add def } ifelse } { char 127 le { % ASCII cws j char 1 add put /i i 1 add def /j j 1 add def } { % Extended ASCII cws j 235 put cws j 1 add char 127 sub put /i i 1 add def /j j 2 add def } ifelse } ifelse } loop /cws cws 0 j getinterval def } if % Basic metrics for the each symbol % ver row col dcol dcws rscw rsbl ro ri rl /metrics [ [ (A) 16 18 16 10 10 1 4 99 6 ] [ (B) 22 22 20 19 16 1 4 99 8 ] [ (C) 28 32 28 44 26 1 4 22 11 ] [ (D) 40 42 36 91 44 1 4 16 16 ] [ (E) 52 54 48 182 70 1 4 22 22 ] [ (F) 70 76 68 370 140 2 4 22 31 ] [ (G) 104 98 88 732 280 4 6 21 47 ] [ (H) 148 134 120 1480 560 8 6 20 69 ] [ (S-10) 8 11 10 4 4 1 99 99 99 ] [ (S-20) 8 21 20 8 8 1 99 99 99 ] [ (S-30) 8 31 30 12 12 1 99 99 99 ] [ (T-16) 16 17 16 10 10 1 99 99 99 ] [ (T-32) 16 33 32 24 16 1 99 99 99 ] [ (T-48) 16 49 48 38 22 1 99 99 99 ] ] def % Select metrics of an appropriate symbol /i 0 def { % loop /m metrics i get def /vers m 0 get def % Version of symbol /rows m 1 get def % Rows in symbol /cols m 2 get def % Columns in symbol /dcol m 3 get def % Data columns in symbol /dcws m 4 get def % Data codewords in symbol /rscw m 5 get def % Error correction codewords /rsbl m 6 get def % Error correction blocks /riso m 7 get def % Riser offset /risi m 8 get def % Riser interval /risl m 9 get def % Riser length /dcpb dcws rsbl idiv def % Data codewords per block /ecpb rscw rsbl idiv def % Error codewords per block /okay true def version (unset) ne version vers ne and {/okay false def} if % The version must match that supplied cws length dcws gt {/okay false def} if okay {exit} if /i i 1 add def } loop % Extend cws to ncws codewords by addition of pad characters stype not { /cws [ cws aload pop dcws cws length sub {129} repeat ] def } if % De-interleave the codewords into blocks /cwbs rsbl array def % Array of data codeword blocks /ecbs rsbl array def % Array of error correction blocks 0 1 rsbl 1 sub { /i exch def /cwb dcpb array def 0 1 dcpb 1 sub { /j exch def cwb j cws j rsbl mul i add get put } for cwbs i cwb put } for % Log and anti-log tables and function to calculate product in the field /gf stype {32} {256} ifelse def /gf-1 gf 1 sub def /pm stype {37} {301} ifelse def /rsalog [ 1 gf-1 { dup 2 mul dup gf ge {pm xor} if } repeat ] def /rslog gf array def 1 1 gf-1 {dup rsalog exch get exch rslog 3 1 roll put} for /rsprod { 2 copy 0 ne exch 0 ne and { rslog exch get exch rslog exch get add gf-1 mod rsalog exch get } { pop pop 0 } ifelse } bind def % Generate the coefficients for the Reed-Solomon algorithm /coeffs [ 1 ecpb {0} repeat ] def 0 1 ecpb 1 sub { /i exch def coeffs i 1 add coeffs i get put i -1 1 { /j exch def coeffs j coeffs j 1 sub get coeffs j get rsalog i get rsprod xor put } for coeffs 0 coeffs 0 get rsalog i get rsprod put } for /coeffs coeffs 0 coeffs length 1 sub getinterval def % Reed-Solomon algorithm to derive the error correction codewords 0 1 cwbs length 1 sub { /i exch def /rscws [ cwbs i get aload pop ecpb {0} repeat ] def 0 1 dcpb 1 sub { /m exch def /k rscws m get def 0 1 ecpb 1 sub { /j exch def rscws m j add 1 add coeffs ecpb j sub 1 sub get k rsprod rscws m j add 1 add get xor put } for } for ecbs i rscws dcpb ecpb getinterval put } for % Extend codewords with the interleaved error correction codes /cws [ cws aload pop rscw {0} repeat ] def 0 1 rscw 1 sub { /i exch def cws dcws i add ecbs i rsbl mod get i rsbl idiv get put } for % Module matrix for layout of the codewords /mmat dcws rscw add stype {5} {8} ifelse mul array def /r 0 def /c 0 def 0 stype {2} {1} ifelse cws length 1 sub { /i exch def stype not { (00000000) 8 string copy dup cws i get 2 8 string cvrs dup length 8 exch sub exch putinterval [ exch {48 sub} forall ] dup 0 4 getinterval /top exch def 4 4 getinterval /bot exch def } { (00000) 5 string copy dup cws i get 2 5 string cvrs dup length 5 exch sub exch putinterval [ exch {48 sub} forall ] /c1 exch def (00000) 5 string copy dup cws i 1 add get 2 5 string cvrs dup length 5 exch sub exch putinterval [ exch {48 sub} forall ] /c2 exch def /top [ c1 0 3 getinterval aload pop c2 0 2 getinterval aload pop ] def /bot [ c1 3 2 getinterval aload pop c2 2 3 getinterval aload pop ] def } ifelse mmat r dcol mul c add top putinterval mmat r 1 add dcol mul c add bot putinterval /c c top length add def c dcol eq {/c 0 def /r r 2 add def} if } for % Create bitmap and add finder patterns /mmv {cols mul add} bind def /pixs [ rows cols mul {-1} repeat ] def % Centre pattern /artifact [ {cols {0} repeat} bind {cols {1} repeat} bind {0 cols 2 sub {1} repeat 0} bind {0 1 cols 4 sub {0} repeat 1 0} bind {cols 1 sub 2 idiv {-1} repeat 1 cols 1 sub 2 idiv {-1} repeat} bind {cols 1 sub 2 idiv {-1} repeat 0 cols 1 sub 2 idiv {-1} repeat} bind {1 cols 2 sub {0} repeat 1} bind {1 0 cols 4 sub {1} repeat 0 1} bind ] def /cpat << /A (121343) /B (12134343) /C (12121343) /D (1213434343) /E (1212134343) /F (1212121343) /G (121213434343) /H (121212134343) /S (56661278) /T (5666666666127878) >> vers 0 1 getinterval get def pixs 0 rows cpat length sub 2 idiv mmv [ cpat {artifact exch 49 sub get exec} forall ] putinterval % Risers 0 1 risl 1 sub { /i exch def riso risi cols 1 sub { /j exch def [ 1 i 12 mod 0 eq {1} {0} ifelse ] dup pixs j i mmv 3 -1 roll putinterval i risl 1 sub ne { pixs cols j sub 2 sub rows i sub 1 sub mmv 3 -1 roll putinterval } {pop} ifelse } for } for % Black dots << /A [ [12 5] ] /B [ [16 7] ] /C [ [26 12] ] /D [] /E [ [26 23] ] /F [ [26 32] [70 32] [26 34] [70 34] ] /G [ [27 48] [69 48] ] /H [ [26 70] [66 70] [106 70] [26 72] [66 72] [106 72] ] /S-10 [] /S-20 [ [10 4] ] /S-30 [ [15 4] [15 6] ] /T-16 [ [8 10] ] /T-32 [ [16 10] [16 12] ] /T-48 [ [24 10] [24 12] [24 14] ] >> vers get {pixs exch aload pop mmv 1 put} forall % Place the modules onto a pixel map between alignment patterns /j 0 def 0 1 pixs length 1 sub { /i exch def pixs i get -1 eq { pixs i mmat j get put /j j 1 add def } if } for % Return the arguments << /ren //renmatrix /pixs pixs /pixx cols /pixy rows /height rows 72 div 2 mul /width cols 72 div 2 mul /opt options >> dontdraw not //renmatrix if end } bind def /codeone dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER codeone-- postscriptbarcode-2014-03-12/src/daft.ps000066400000000000000000000064001231007474100177040ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER daft-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Custom 4 state symbology % --EXAM: FATDAFTDAD % --EXOP: % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /daft { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /height 0.175 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /height height cvr def barcode { dup 68 ne exch dup 65 ne exch dup 70 ne exch 84 ne and and and { /bwipp.daftBadCharacter (DAFT must contain only characters D, A, F and T) //raiseerror exec } if } forall /barlen barcode length def /bbs barlen array def /bhs barlen array def 0 1 barlen 1 sub { /i exch def /enc barcode i 1 getinterval def enc (D) eq { bbs i 0 height mul 8 div put bhs i 5 height mul 8 div put } if enc (A) eq { bbs i 3 height mul 8 div put bhs i 5 height mul 8 div put } if enc (F) eq { bbs i 0 height mul 8 div put bhs i 8 height mul 8 div put } if enc (T) eq { bbs i 3 height mul 8 div put bhs i 2 height mul 8 div put } if } for % Return the arguments << /ren //renlinear /bbs bbs /bhs bhs /sbs [bhs length 1 sub {1.44 1.872} repeat 1.44] /opt options >> dontdraw not //renlinear if end } bind def /daft dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER daft-- postscriptbarcode-2014-03-12/src/databarexpanded.ps000066400000000000000000000721531231007474100221050ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databarexpanded-- % --REQUIRES preamble raiseerror renlinear renmatrix-- % --DESC: GS1 DataBar Expanded % --EXAM: (01)95012345678903(3103)000123 % --EXOP: % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /databarexpanded { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /height 34 72 div def /format (expanded) def /segments -1 def /linkage false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /height height cvr def /segments segments cvi def segments -1 eq { /segments format (expandedstacked) eq {4} {22} ifelse def } if % Expand ordinals of the form ^NNN to ASCII /expand { /in exch def /out in length string def /j 0 def in { % loop (^) search { dup out exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi out exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup out exch j exch putinterval length j add /j exch def out 0 j getinterval exit } ifelse } loop } bind def % Parse out AIs /ais [] def /aival 2 dict def barcode dup length 1 sub 1 exch getinterval { % loop dup () eq {exit} if (\)) search pop exch pop exch (\() search { exch pop exch 3 1 roll } { () 3 1 roll } ifelse [ ais aload pop counttomark 2 add index ] /ais exch def aival 3 1 roll expand put } loop pop % Method selection { % common exit % (01)9...(3103)... ais length 2 eq { ais 0 get (01) eq ais 1 get (3103) eq and { aival (01) get 0 1 getinterval (9) eq aival (3103) get cvi 32767 le and { (0100) false exit } if } if } if % (01)9...(3202)... ais length 2 eq { ais 0 get (01) eq ais 1 get (3202) eq and { aival (01) get 0 1 getinterval (9) eq aival (3202) get cvi 9999 le and { (0101) false exit } if } if } if % (01)9...(3203)... ais length 2 eq { ais 0 get (01) eq ais 1 get (3203) eq and { aival (01) get 0 1 getinterval (9) eq aival (3203) get cvi 22767 le and { (0101) false exit } if } if } if % (01)9...(310x/320x)...[(11/13/15/17)...] ais length dup 2 eq exch 3 eq or { /ai310x false 3100 1 3109 {10 4 string cvrs ais 1 get eq or} for def /ai320x false 3200 1 3209 {10 4 string cvrs ais 1 get eq or} for def ais length 3 eq { /aibad true [ (11) (13) (15) (17) ] {ais 2 get ne and} forall def } { /aibad false def } ifelse ais 0 get (01) eq ai310x ai320x or and aibad not and { ais length 3 eq { aival (01) get 0 1 getinterval (9) eq aival ais 1 get get cvi 99999 le and aival ais 2 get get cvi 999999 le and { ai310x ais 2 get (11) eq and { (0111000) false exit } if ai320x ais 2 get (11) eq and { (0111001) false exit } if ai310x ais 2 get (13) eq and { (0111010) false exit } if ai320x ais 2 get (13) eq and { (0111011) false exit } if ai310x ais 2 get (15) eq and { (0111100) false exit } if ai320x ais 2 get (15) eq and { (0111101) false exit } if ai310x ais 2 get (17) eq and { (0111110) false exit } if ai320x ais 2 get (17) eq and { (0111111) false exit } if } if } { aival (01) get 0 1 getinterval (9) eq aival ais 1 get get cvi 99999 le and { ai310x { (0111000) false exit } if ai320x { (0111001) false exit } if } if } ifelse } if } if % (01)9...(392x)... ais length 2 ge { /ai392x false 3920 1 3923 {10 4 string cvrs ais 1 get eq or} for def ais 0 get (01) eq ai392x and { aival (01) get 0 1 getinterval (9) eq { (01100) true exit } if } if } if % (01)9...(393x)... ais length 2 ge { /ai393x false 3930 1 3933 {10 4 string cvrs ais 1 get eq or} for def ais 0 get (01) eq ai393x and { aival (01) get 0 1 getinterval (9) eq { (01101) true exit } if } if } if % (01)... ais 0 get (01) eq { (1) true exit } if % Freeform (00) true exit } loop /gpfallow exch def /method exch def /conv12to40 { (0000000000000000000000000000000000000000) 40 string copy 2 copy 0 10 getinterval exch 0 3 getinterval cvi 2 10 string cvrs dup length 10 exch sub exch putinterval 2 copy 10 10 getinterval exch 3 3 getinterval cvi 2 10 string cvrs dup length 10 exch sub exch putinterval 2 copy 20 10 getinterval exch 6 3 getinterval cvi 2 10 string cvrs dup length 10 exch sub exch putinterval 2 copy 30 10 getinterval exch 9 3 getinterval cvi 2 10 string cvrs dup length 10 exch sub exch putinterval exch pop } bind def /conv13to44 { (00000000000000000000000000000000000000000000) 44 string copy 2 copy 0 4 getinterval exch 0 1 getinterval cvi 2 4 string cvrs dup length 4 exch sub exch putinterval dup 3 -1 roll 1 12 getinterval conv12to40 4 exch putinterval } bind def /tobin { string dup length 1 sub 0 exch 1 exch {1 index exch 48 put} for dup 3 -1 roll 2 2 index length string cvrs dup length 2 index length exch sub exch putinterval } bind def method (00) eq { /cdf [] def /gpf [] def } if method (1) eq { /cdf aival (01) get 0 13 getinterval conv13to44 def /cdf [ cdf {48 sub} forall ] def /gpf [] def /ais ais 1 ais length 1 sub getinterval def } if method (0100) eq { /cdf 55 string def cdf 0 aival (01) get 1 12 getinterval conv12to40 putinterval cdf 40 aival (3103) get cvi 15 tobin putinterval /cdf [ cdf {48 sub} forall ] def /gpf [] def /ais [] def } if method (0101) eq { /cdf 55 string def cdf 0 aival (01) get 1 12 getinterval conv12to40 putinterval ais 1 get (3202) eq { aival (3202) get cvi 15 tobin } { aival (3203) get cvi 10000 add 15 tobin } ifelse cdf exch 40 exch putinterval /cdf [ cdf {48 sub} forall ] def /gpf [] def /ais [] def } if method length 7 eq { /cdf 76 string def cdf 0 aival (01) get 1 12 getinterval conv12to40 putinterval 6 string dup 0 ais 1 get 3 1 getinterval putinterval dup aival ais 1 get get 1 5 getinterval 1 exch putinterval cvi 20 tobin cdf exch 40 exch putinterval ais length 3 eq { aival ais 2 get get dup 0 2 getinterval cvi 384 mul exch dup 2 2 getinterval cvi 1 sub 32 mul exch 4 2 getinterval cvi add add } { 38400 } ifelse 16 tobin cdf exch 60 exch putinterval /cdf [ cdf {48 sub} forall ] def /gpf [] def /ais [] def } if method (01100) eq { /cdf 42 string def cdf 0 aival (01) get 1 12 getinterval conv12to40 putinterval cdf 40 ais 1 get 3 1 getinterval cvi 2 tobin putinterval /cdf [ cdf {48 sub} forall ] def /gpf [ aival ais 1 get get {} forall ] def /ais ais 2 ais length 2 sub getinterval def } if method (01101) eq { /cdf 52 string def cdf 0 aival (01) get 1 12 getinterval conv12to40 putinterval cdf 40 ais 1 get 3 1 getinterval cvi 2 tobin putinterval cdf 42 aival ais 1 get get 0 3 getinterval cvi 10 tobin putinterval /cdf [ cdf {48 sub} forall ] def /gpf [ aival ais 1 get get dup length 3 sub 3 exch getinterval {} forall ] def /ais ais 2 ais length 2 sub getinterval def } if % Variable length symbol field gpfallow { /vlf 2 array def } { /vlf [] def } ifelse % Pre-defined fixed length data field AIs % any AI whose prefix is not included in this table must be % terminated with "FNC1", even if it's fixed length /aifixed 23 dict def [ 0 1 4 {} for ] { (00) 2 string copy dup dup 1 5 -1 roll 48 add put aifixed 3 1 roll put } forall [ 11 1 20 {} for 23 31 1 36 {} for 41 ] { 10 2 string cvrs dup aifixed 3 1 roll put } forall /fnc1 -1 def /lnumeric -2 def /lalphanumeric -3 def /liso646 -4 def /numeric << 0 1 119 { dup (00) 2 string copy dup 3 -1 roll 11 2 string cvrs dup length 2 exch sub exch putinterval dup 0 get 65 eq {dup 0 94 put} if dup 1 get 65 eq {dup 1 94 put} if exch 8 add (0000000) 7 string copy dup 3 -1 roll 2 7 string cvrs dup length 7 exch sub exch putinterval } for lalphanumeric (0000) >> def /alphanumeric << 48 1 57 {dup 43 sub 5 tobin} for fnc1 (01111) 65 1 90 {dup 33 sub 6 tobin} for 42 (111010) 44 1 47 {dup 15 add 6 tobin} for lnumeric (000) liso646 (00100) >> def /iso646 << 48 1 57 {dup 43 sub 5 tobin} for fnc1 (01111) 65 1 90 {dup 1 sub 7 tobin} for 97 1 122 {dup 7 sub 7 tobin} for 33 (11101000) 34 (11101001) 37 1 47 {dup 197 add 8 tobin} for 58 1 63 {dup 187 add 8 tobin} for 95 (11111011) 32 (11111100) lnumeric (000) lalphanumeric (00100) >> def % Append the remaining AI data 0 1 ais length 1 sub { /i exch def /ai ais i get def /val aival ai get def gpf length ai length add val length add array dup 0 gpf putinterval dup gpf length ai [ exch {} forall ] putinterval dup gpf length ai length add val [ exch {} forall ] putinterval /gpf exch def i ais length 1 sub ne aifixed ai 0 2 getinterval known not and { % Append FNC1 gpf length 1 add array dup 0 gpf putinterval dup gpf length fnc1 put /gpf exch def } if } for % Calculate the number of bits remaining to the next valid symbol size /rembits { dup 12 div ceiling cvi 12 mul % Round up to multiple of 12 48 2 copy lt {exch} if pop % At least 4 symbols dup 12 idiv dup segments mod 1 eq { % At least 2 symbols on last row of stacked symbol 1 add 12 mul exch pop } { pop } ifelse exch sub } bind def /encode { dup /raw ne {exch get} {pop} ifelse [ exch {48 sub} forall ] dup length exch gpfenc exch j exch putinterval /j exch j add def } bind def % Pre-compute alphanumeric and numeric runlengths and position of next ISO646-only characters /numericruns [ gpf length {0} repeat 0 -1 ] def /alphanumericruns [ gpf length {0} repeat 0 ] def /nextiso646only [ gpf length {0} repeat 9999 ] def gpf length 1 sub -1 0 { /i exch def gpf i get (00) 2 string copy dup 0 gpf i get dup fnc1 eq {pop 94} if put i gpf length 1 sub lt {dup 1 gpf i 1 add get dup fnc1 eq {pop 94} if put} if numeric exch known { numericruns i numericruns i 2 add get 2 add put } { numericruns i 0 put } ifelse dup alphanumeric exch known { alphanumericruns i alphanumericruns i 1 add get 1 add put } { alphanumericruns i 0 put } ifelse dup iso646 exch known exch alphanumeric exch known not and { nextiso646only i 0 put } { nextiso646only i nextiso646only i 1 add get 1 add put } ifelse } for % Encode the general purpose field /gpfenc 252 array def /i 0 def /j 0 def /mode (numeric) def { % loop i gpf length eq {exit} if { % not a loop but common exit point mode (numeric) eq { i gpf length 2 sub le { 2 string dup 0 gpf i get dup fnc1 eq {pop 94} if put dup 1 gpf i 1 add get dup fnc1 eq {pop 94} if put dup numeric exch known { numeric encode /i i 2 add def exit } if pop lalphanumeric numeric encode /mode (alphanumeric) def exit } { gpf i get dup 48 lt exch 57 gt or { lalphanumeric numeric encode /mode (alphanumeric) def exit } if /rem 12 1 add method length add vlf length add cdf length add j add rembits def rem 4 ge rem 6 le and { % C1 + 1 into 4 to 6 bits (000000) 6 string copy 0 rem getinterval dup gpf i get 47 sub 2 4 string cvrs dup length 4 exch sub exch putinterval /raw encode /i i 1 add def exit } { % C1.FNC1 2 string dup 0 gpf i get put dup 1 94 put numeric encode /i i 1 add def exit } ifelse } ifelse } if mode (alphanumeric) eq { gpf i get fnc1 eq { fnc1 alphanumeric encode /mode (numeric) def /i i 1 add def exit } if gpf i get dup iso646 exch known exch alphanumeric exch known not and { liso646 alphanumeric encode /mode (iso646) def exit } if numericruns i get 6 ge { lnumeric alphanumeric encode /mode (numeric) def exit } if numericruns i get dup 4 ge exch i add gpf length eq and { lnumeric alphanumeric encode /mode (numeric) def exit } if gpf i get alphanumeric encode /i i 1 add def exit } if mode (iso646) eq { gpf i get fnc1 eq { fnc1 iso646 encode /mode (numeric) def /i i 1 add def exit } if numericruns i get 4 ge nextiso646only i get 10 ge and { lnumeric iso646 encode /mode (numeric) def exit } if alphanumericruns i get 5 ge nextiso646only i get 10 ge and { lalphanumeric iso646 encode /mode (alphanumeric) def exit } if gpf i get iso646 encode /i i 1 add def exit } if } loop } loop /gpf gpfenc 0 j getinterval def % Complete the variable length field and create pad 1 12 add method length add vlf length add cdf length add gpf length add dup rembits dup array /pad exch def vlf length 0 ne { add 12 idiv dup 2 mod vlf exch 0 exch put 14 le {0} {1} ifelse vlf exch 1 exch put } { pop pop } ifelse pad length 0 gt { 0 5 pad length 1 sub { % Fill with 00100 /i exch def pad i [ 0 0 1 0 0 ] 0 pad length i sub 5 2 copy gt {exch} if pop getinterval putinterval } for mode (numeric) eq { % Prefix shift from numeric to ASCII /pad [ 0 0 0 0 pad aload pop ] 0 pad length getinterval def } if } if % Concatinate fields /binval [ linkage {1} {0} ifelse method {48 sub} forall vlf aload pop cdf aload pop gpf aload pop pad aload pop ] def /datalen binval length 12 idiv def /ncr { % n r 2 copy sub 2 copy lt {exch} if % n r maxd mind 1 1 5 3 roll % mind j=1 v=1 n maxd 1 add -1 exch { % mind j v n -1 maxd+1 mul % mind j v*i 1 index 3 index le { 1 index idiv exch 1 add exch } if } for { % mind j v 1 index 3 index gt {exit} if 1 index idiv exch 1 add exch } loop exch pop exch pop } bind def /getRSSwidths { /oe exch def /el exch def /mw exch def /nm exch def /val exch def /out el array def /mask 0 def 0 1 el 2 sub { /bar exch def /ew 1 def /mask mask 1 bar bitshift or def { /sval nm ew sub 1 sub el bar sub 2 sub ncr def oe mask 0 eq and nm ew sub el 2 mul sub bar 2 mul add -2 ge and { /sval sval nm ew sub el sub bar add el bar sub 2 sub ncr sub def } if el bar sub 2 gt { /lval 0 def nm ew sub el sub bar add 2 add -1 mw 1 add { nm exch sub ew sub 1 sub el bar sub 3 sub ncr /lval exch lval add def } for /sval sval lval el bar sub 1 sub mul sub def } { nm ew sub mw gt {/sval sval 1 sub def} if } ifelse /val val sval sub def val 0 lt {exit} if /ew ew 1 add def /mask mask 1 bar bitshift not and def } loop /val val sval add def /nm nm ew sub def out bar ew put } for out el 1 sub nm put out } bind def /tab174 [ 347 0 12 5 7 2 87 4 1387 348 10 7 5 4 52 20 2947 1388 8 9 4 5 30 52 3987 2948 6 11 3 6 10 104 4191 3988 4 13 1 8 1 204 ] def /dxw datalen array def 0 1 datalen 1 sub { /x exch def /d binval x 12 mul 12 getinterval def /d 0 0 1 11 {/j exch def 2 11 j sub exp cvi d j get mul add} for def /j 0 def { d tab174 j get le { tab174 j 1 add 7 getinterval {} forall /dte exch def /dto exch def /dmwe exch def /dmwo exch def /dele exch def /delo exch def /dgs exch def exit } if /j j 8 add def } loop /dwo d dgs sub dte idiv delo dmwo 4 true getRSSwidths def /dwe d dgs sub dte mod dele dmwe 4 false getRSSwidths def /dw 8 array def x 2 mod 0 eq { 0 1 3 { /j exch def dw 7 j 2 mul sub dwo j get put dw 6 j 2 mul sub dwe j get put } for } { 0 1 3 { /j exch def dw j 2 mul dwo j get put dw j 2 mul 1 add dwe j get put } for } ifelse dxw x dw put } for /finderwidths [ 1 8 4 1 1 1 1 4 8 1 3 6 4 1 1 1 1 4 6 3 3 4 6 1 1 1 1 6 4 3 3 2 8 1 1 1 1 8 2 3 2 6 5 1 1 1 1 5 6 2 2 2 9 1 1 1 1 9 2 2 ] def /finderseq [ [0 1] [0 3 2] [0 5 2 7] [0 9 2 7 4] [0 9 2 7 6 11] [0 9 2 7 8 11 10] [0 1 2 3 4 5 6 7] [0 1 2 3 4 5 6 9 8] [0 1 2 3 4 5 6 9 10 11] [0 1 2 3 4 7 6 9 8 11 10] ] def /seq finderseq datalen 2 sub 2 idiv get def /fxw seq length array def 0 1 seq length 1 sub { /x exch def fxw x finderwidths seq x get 5 mul 5 getinterval put } for /checkweights [ -1 -1 -1 -1 -1 -1 -1 -1 % A1L 77 96 32 81 27 9 3 1 % A1R 20 60 180 118 143 7 21 63 % A2L 205 209 140 117 39 13 145 189 % A2R 193 157 49 147 19 57 171 91 % B1L 132 44 85 169 197 136 186 62 % B1R 185 133 188 142 4 12 36 108 % B2L 50 87 29 80 97 173 128 113 % B2R 150 28 84 41 123 158 52 156 % C1L 166 196 206 139 187 203 138 46 % C1R 76 17 51 153 37 111 122 155 % C2L 146 119 110 107 106 176 129 43 % C2R 16 48 144 10 30 90 59 177 % D1L 164 125 112 178 200 137 116 109 % D1R 70 210 208 202 184 130 179 115 % D2L 190 204 68 93 31 151 191 134 % D2R 148 22 66 198 172 94 71 2 % E1L 40 154 192 64 162 54 18 6 % E1R 120 149 25 75 14 42 126 167 % E2L 175 199 207 69 23 78 26 79 % E2R 103 98 83 38 114 131 182 124 % F1L 159 53 88 170 127 183 61 161 % F1R 55 165 73 8 24 72 5 15 % F2L 89 100 174 58 160 194 135 45 % F2R ] def /checkweightseq [ seq {16 mul checkweights exch 16 getinterval aload pop} forall ] dup length 8 sub 8 exch getinterval def /widths [ dxw {{} forall} forall ] def /checksum 0 def 0 1 widths length 1 sub { /i exch def /checksum checksum widths i get checkweightseq i get mul add def } for /checksum checksum 211 mod datalen 3 sub 211 mul add def /i 0 def { checksum tab174 i get le { tab174 i 1 add 7 getinterval {} forall /cte exch def /cto exch def /cmwe exch def /cmwo exch def /cele exch def /celo exch def /cgs exch def exit } if /i i 8 add def } loop /cwo checksum cgs sub cte idiv celo cmwo 4 true getRSSwidths def /cwe checksum cgs sub cte mod cele cmwe 4 false getRSSwidths def /cw 8 array def 0 1 3 { /i exch def cw i 2 mul cwo i get put cw i 2 mul 1 add cwe i get put } for 22 array dup dup 0 cw put 1 dxw putinterval 0 datalen 1 add getinterval /dxw exch def /datalen dxw length def % Encode row runlengths /rows datalen segments div ceiling cvi array def /numrows rows length def 0 1 numrows 1 sub { /r exch def mark segments 4 mod 0 ne r 2 mod 1 eq and {0} if 1 1 0 1 segments 1 sub { /pos exch r segments mul add def pos datalen lt { dxw pos get {} forall pos 2 mod 0 eq {fxw pos 2 idiv get {} forall} if } if } for 1 1 counttomark array astore rows exch r exch put pop } for format (expandedstacked) ne { % Linear % Remove leading space /sbs rows 0 get dup length 1 sub 1 exch getinterval def /sbs [ 1 0 1 datalen 1 sub { /i exch def dxw i get {} forall i 2 mod 0 eq {fxw i 2 idiv get {} forall} if } for 1 1 ] def << /ren //renlinear /sbs sbs /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] /opt options >> dontdraw not //renlinear if } { % expandedstacked /seps numrows array def 0 1 numrows 1 sub { /r exch def /row rows r get def % Sample runlengths into bitmap mark 0 2 row length 1 sub { /i exch def row i get {0} repeat i row length 1 sub lt {row i 1 add get {1} repeat} if } for counttomark array astore /row exch def pop % Derive the separator pattern /sep [ row {1 exch sub} forall ] def sep 0 [ 0 0 0 0 ] putinterval sep row length 4 sub [ 0 0 0 0 ] putinterval /finderpos [ % Finder pattern module positions 19 98 row length 13 sub {} for 68 98 row length 13 sub {} for ] def finderpos { dup 14 add 1 exch { /i exch def row i get 0 eq { row i 1 sub get 1 eq { 1 } { sep i 1 sub get 0 eq {1} {0} ifelse } ifelse } { 0 } ifelse sep exch i exch put } for } forall % For even segment-pair symbols reverse alternate rows segments 4 mod 0 eq r 2 mod 1 eq and { rows r get length rows 0 get length ne % Except partial width last row finderpos length 2 mod 1 eq and { % with odd finders /row [ 0 row aload pop ] def /sep [ 0 sep aload pop ] def } { row length 1 sub -1 0 {row exch get} for row astore pop sep length 1 sub -1 0 {sep exch get} for sep astore pop } ifelse } if rows r row put seps r sep put } for % Extend last row and separator to fill width of symbol /pixx rows 0 get length def [ pixx {0} repeat ] dup 0 rows numrows 1 sub get putinterval rows exch numrows 1 sub exch put [ pixx {0} repeat ] dup 0 seps numrows 1 sub get putinterval seps exch numrows 1 sub exch put % Middle separator pattern /sep [ pixx 2 idiv 1 add { 0 1 } repeat ] 0 pixx getinterval def sep 0 [0 0 0 0] putinterval sep pixx 4 sub [0 0 0 0] putinterval % Compose the symbol /pixs [ 0 1 numrows 1 sub { /r exch def r 0 ne { seps r get aload pop } if 34 {rows r get aload pop} repeat r numrows 1 sub ne { seps r get aload pop sep aload pop } if } for ] def << /ren //renmatrix /pixs pixs /pixx pixx /pixy pixs length pixx idiv /height pixs length pixx idiv 72 div /width pixx 72 div /opt options >> dontdraw not //renmatrix if } ifelse end } bind def /databarexpanded dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databarexpanded-- postscriptbarcode-2014-03-12/src/databarexpandedcomposite.ps000066400000000000000000000101031231007474100240130ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databarexpandedcomposite-- % --REQUIRES preamble raiseerror renlinear renmatrix databarexpanded micropdf417 pdf417 gs1-cc-- % --DESC: GS1 DataBar Expanded Composite % --EXAM: (01)93712345678904(3103)001234|(91)1A2B3C4D5E % --EXOP: % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 2 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /databarexpanded dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /databarexpandedcomposite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse gsave options (lintype) (databarexpanded) put options (linkage) true put options (inkspread) (0) put options (dontdraw) true put % Plot the linear part linear options //databarexpanded exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def //renlinear exec % Plot the separator /sepfinder { /fp exch def fp 1 fp 12 add { /i exch def bot i get 0 eq { bot i 1 sub get 1 eq { 1 } { sep i 1 sub get 0 eq {1} {0} ifelse } ifelse } { 0 } ifelse sep exch i exch put } for } bind def mark 0 linsbs {1 index 1 eq {{0}} {{1}} ifelse repeat} forall counttomark 1 sub array astore /bot exch def pop pop /sep [ bot {1 exch sub} forall ] def sep 0 [0 0 0] putinterval sep sep length 4 sub [0 0 0 0] putinterval [ % Finder pattern module positions 18 98 bot length 13 sub {} for 69 98 bot length 13 sub {} for ] {sepfinder} forall 0 linheight rmoveto << /ren //renmatrix /pixs sep /pixx sep length /pixy 1 /height 1 72 div /width sep length 72 div /opt options >> //renmatrix exec % Plot the 2D part 1 1 rmoveto comp options //gs1-cc exec //renmatrix exec grestore end } bind def /databarexpandedcomposite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databarexpandedcomposite-- postscriptbarcode-2014-03-12/src/databarexpandedstacked.ps000066400000000000000000000053031231007474100234350ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databarexpandedstacked-- % --REQUIRES preamble raiseerror renlinear renmatrix databarexpanded-- % --DESC: GS1 DataBar Expanded Stacked % --EXAM: (01)95012345678903(3103)000123 % --EXOP: segments=4 % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put dup /databarexpanded dup /uk.co.terryburton.bwipp findresource put begin /databarexpandedstacked { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Get the result of encoding with databarexpanded with format=expandedstacked options (dontdraw) true put options (format) (expandedstacked) put /args barcode options //databarexpanded exec def args (opt) options put args dontdraw not //renmatrix if end } bind def /databarexpandedstacked dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databarexpandedstacked-- postscriptbarcode-2014-03-12/src/databarexpandedstackedcomposite.ps000066400000000000000000000100261231007474100253560ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databarexpandedstackedcomposite-- % --REQUIRES preamble raiseerror renlinear renmatrix databarexpanded databarexpandedstacked micropdf417 pdf417 gs1-cc-- % --DESC: GS1 DataBar Expanded Stacked Composite % --EXAM: (01)00012345678905(10)ABCDEF|(21)12345678 % --EXOP: segments=4 % --RNDR: renmatrix renlinear /setpacking where {pop currentpacking true setpacking} if 2 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /databarexpandedstacked dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /databarexpandedstackedcomposite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse gsave options (lintype) (databarexpandedstacked) put options (linkage) true put options (inkspread) (0) put options (dontdraw) true put % Plot the linear part linear options //databarexpandedstacked exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def //renmatrix exec % Plot the separator /sepfinder { /fp exch def fp 1 fp 12 add { /i exch def bot i get 0 eq { bot i 1 sub get 1 eq { 1 } { sep i 1 sub get 0 eq {1} {0} ifelse } ifelse } { 0 } ifelse sep exch i exch put } for } bind def /sep [ bot {1 exch sub} forall ] def sep 0 [ 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval [ % Finder pattern module positions 19 98 bot length 13 sub {} for 70 98 bot length 13 sub {} for ] {sepfinder} forall 0 linheight rmoveto << /ren //renmatrix /pixs sep /pixx sep length /pixy 1 /height 1 72 div /width sep length 72 div /opt options >> //renmatrix exec % Plot the 2D part bot 0 get 0 eq {2} {0} ifelse 1 rmoveto comp options //gs1-cc exec //renmatrix exec grestore end } bind def /databarexpandedstackedcomposite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databarexpandedstackedcomposite-- postscriptbarcode-2014-03-12/src/databarlimited.ps000066400000000000000000000222601231007474100217360ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databarlimited-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: GS1 DataBar Limited % --EXAM: (01)15012345678907 % --EXOP: % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /databarlimited { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /height 10 72 div def /linkage false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /height height cvr def % Validate the input barcode 0 4 getinterval (\(01\)) ne { /bwipp.databarlimitedBadAI (GS1 DataBar Limited must begin with (01) application identifier) //raiseerror exec } if barcode length 17 ne barcode length 18 ne and { /bwipp.databarlimitedBadLength (GS1 DataBar Limited must be 13 or 14 digits) //raiseerror exec } if barcode 4 get dup 48 lt exch 49 gt or { /bwipp.databarlimitedBadStartDigit (GS1 DataBar Limited must begin with 0 or 1) //raiseerror exec } if barcode 5 barcode length 5 sub getinterval { dup 48 lt exch 57 gt or { /bwipp.databarlimitedBadCharacter (GS1 DataBar Limited must contain only digits) //raiseerror exec } if } forall % Calculate checksum and add to end of barcode /checksum 0 def 0 1 12 { /i exch def /checksum checksum barcode i 4 add get 48 sub i 2 mod 0 eq {3 mul} if add def } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 18 eq { barcode 17 get checksum 48 add ne { /bwipp.databaromniBadCheckDigit (Incorrect GS1 DataBar Limited check digit provided) //raiseerror exec } if } if 18 string dup 0 barcode putinterval dup 17 checksum 48 add put /barcode exch def % Strip the AI and optional check digit /binval [ barcode 4 13 getinterval {48 sub} forall ] def linkage { /linkval [ 2 0 1 5 1 3 3 5 3 1 0 9 6 ] def 0 1 binval length 1 sub { /i exch def binval i binval i get linkval i get add put } for } if % Create the human readable text /txt barcode length array def 0 1 barcode length 1 sub { /i exch def txt i [barcode i 1 getinterval 0 0 () 0] put } for /ncr { % n r 2 copy sub 2 copy lt {exch} if % n r maxd mind 1 1 5 3 roll % mind j=1 v=1 n maxd 1 add -1 exch { % mind j v n -1 maxd+1 mul % mind j v*i 1 index 3 index le { 1 index idiv exch 1 add exch } if } for { % mind j v 1 index 3 index gt {exit} if 1 index idiv exch 1 add exch } loop exch pop exch pop } bind def /getRSSwidths { /oe exch def /el exch def /mw exch def /nm exch def /val exch def /out el array def /mask 0 def 0 1 el 2 sub { /bar exch def /ew 1 def /mask mask 1 bar bitshift or def { /sval nm ew sub 1 sub el bar sub 2 sub ncr def oe mask 0 eq and nm ew sub el 2 mul sub bar 2 mul add -2 ge and { /sval sval nm ew sub el sub bar add el bar sub 2 sub ncr sub def } if el bar sub 2 gt { /lval 0 def nm ew sub el sub bar add 2 add -1 mw 1 add { nm exch sub ew sub 1 sub el bar sub 3 sub ncr /lval exch lval add def } for /sval sval lval el bar sub 1 sub mul sub def } { nm ew sub mw gt {/sval sval 1 sub def} if } ifelse /val val sval sub def val 0 lt {exit} if /ew ew 1 add def /mask mask 1 bar bitshift not and def } loop /val val sval add def /nm nm ew sub def out bar ew put } for out el 1 sub nm put out } bind def 0 1 11 { /i exch def binval i 1 add 2 copy get binval i get 2013571 mod 10 mul add put binval i binval i get 2013571 idiv put } for /d2 binval 12 get 2013571 mod def binval 12 2 copy get 2013571 idiv put /d1 0 def /i true def 0 1 12 { /j exch def binval j get dup 0 eq i and { pop } { /i false def /d1 d1 3 -1 roll 10 12 j sub exp cvi mul add def } ifelse } for /tab267 [ 183063 0 17 9 6 3 6538 28 820063 183064 13 13 5 4 875 728 1000775 820064 9 17 3 6 28 6454 1491020 1000776 15 11 5 4 2415 203 1979844 1491021 11 15 4 5 203 2408 1996938 1979845 19 7 8 1 17094 1 2013570 1996939 7 19 1 8 1 16632 ] def /i 0 def { d1 tab267 i get le { tab267 i 1 add 7 getinterval {} forall /d1te exch def /d1to exch def /d1mwe exch def /d1mwo exch def /d1ele exch def /d1elo exch def /d1gs exch def exit } if /i i 8 add def } loop /i 0 def { d2 tab267 i get le { tab267 i 1 add 7 getinterval {} forall /d2te exch def /d2to exch def /d2mwe exch def /d2mwo exch def /d2ele exch def /d2elo exch def /d2gs exch def exit } if /i i 8 add def } loop /d1wo d1 d1gs sub d1te idiv d1elo d1mwo 7 false getRSSwidths def /d1we d1 d1gs sub d1te mod d1ele d1mwe 7 true getRSSwidths def /d2wo d2 d2gs sub d2te idiv d2elo d2mwo 7 false getRSSwidths def /d2we d2 d2gs sub d2te mod d2ele d2mwe 7 true getRSSwidths def /d1w 14 array def 0 1 6 { /i exch def d1w i 2 mul d1wo i get put d1w i 2 mul 1 add d1we i get put } for /d2w 14 array def 0 1 6 { /i exch def d2w i 2 mul d2wo i get put d2w i 2 mul 1 add d2we i get put } for /widths [ d1w {} forall d2w {} forall ] def /checkweights [ 1 3 9 27 81 65 17 51 64 14 42 37 22 66 20 60 2 6 18 54 73 41 34 13 39 28 84 74 ] def /checkseq [ 0 1 43 {} for 45 52 57 63 1 66 {} for 73 1 79 {} for 82 126 1 130 {} for 132 141 1 146 {} for 210 1 217 {} for 220 316 1 320 {} for 322 323 326 337 ] def /checksum 0 def 0 1 27 { /i exch def /checksum checksum widths i get checkweights i get mul add def } for /checksum checksum 89 mod def /seq checkseq checksum get def /swidths seq 21 idiv 8 3 6 false getRSSwidths def /bwidths seq 21 mod 8 3 6 false getRSSwidths def /checkwidths [0 0 0 0 0 0 0 0 0 0 0 0 1 1] def 0 1 5 { /i exch def checkwidths i 2 mul swidths i get put checkwidths i 2 mul 1 add bwidths i get put } for /sbs [ 1 d1w {} forall checkwidths {} forall d2w {} forall 1 1 ] def % Return the arguments << /ren //renlinear /sbs sbs /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] /txt txt /textxalign (center) /opt options >> dontdraw not //renlinear if end } bind def /databarlimited dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databarlimited-- postscriptbarcode-2014-03-12/src/databarlimitedcomposite.ps000066400000000000000000000070311231007474100236600ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databarlimitedcomposite-- % --REQUIRES preamble raiseerror renlinear renmatrix databarlimited micropdf417 pdf417 gs1-cc-- % --DESC: GS1 DataBar Limited Composite % --EXAM: (01)03512345678907|(21)abcdefghijklmnopqrstuv % --EXOP: % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 2 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /databarlimited dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /databarlimitedcomposite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse gsave options (lintype) (databarlimited) put options (linkage) true put options (inkspread) (0) put options (dontdraw) true put % Plot the linear part linear options //databarlimited exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def //renlinear exec % Plot the separator mark 1 linsbs {1 index 0 eq {{1}} {{0}} ifelse repeat} forall counttomark 1 sub array astore /sep exch def pop pop sep 0 [0 0 0] putinterval sep sep length 4 sub [0 0 0 0] putinterval 0 linheight rmoveto << /ren //renmatrix /pixs sep /pixx sep length /pixy 1 /height 1 72 div /width sep length 72 div /opt options >> //renmatrix exec % Plot the 2D part comp options //gs1-cc exec dup (pixx) get 72 exch sub 1 rmoveto //renmatrix exec grestore end } bind def /databarlimitedcomposite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databarlimitedcomposite-- postscriptbarcode-2014-03-12/src/databaromni.ps000066400000000000000000000327331231007474100212570ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databaromni-- % --REQUIRES preamble raiseerror renlinear renmatrix-- % --DESC: GS1 DataBar Omnidirectional % --EXAM: (01)24012345678905 % --EXOP: % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /databaromni { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /height 33 72 div def /linkage false def /format (omni) def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall format (truncated) eq {/height 13 72 div def} if /height height cvr def % Validate the input barcode 0 4 getinterval (\(01\)) ne { /bwipp.databaromniBadAI (GS1 DataBar Omnidirectional must begin with (01) application identifier) //raiseerror exec } if barcode length 17 ne barcode length 18 ne and { /bwipp.databaromniBadLength (GS1 DataBar Omnidirectional must be 13 or 14 digits) //raiseerror exec } if barcode 4 barcode length 4 sub getinterval { dup 48 lt exch 57 gt or { /bwipp.databaromniBadCharacter (GS1 DataBar Omnidirectional must contain only digits) //raiseerror exec } if } forall % Calculate checksum and add to end of barcode /checksum 0 def 0 1 12 { /i exch def /checksum checksum barcode i 4 add get 48 sub i 2 mod 0 eq {3 mul} if add def } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 18 eq { barcode 17 get checksum 48 add ne { /bwipp.databaromniBadCheckDigit (Incorrect GS1 DataBar Omnidirectional check digit provided) //raiseerror exec } if } if 18 string dup 0 barcode putinterval dup 17 checksum 48 add put /barcode exch def % Create the human readable text /txt barcode length array def 0 1 barcode length 1 sub { /i exch def txt i [barcode i 1 getinterval 0 0 () 0] put } for /ncr { % n r 2 copy sub 2 copy lt {exch} if % n r maxd mind 1 1 5 3 roll % mind j=1 v=1 n maxd 1 add -1 exch { % mind j v n -1 maxd+1 mul % mind j v*i 1 index 3 index le { 1 index idiv exch 1 add exch } if } for { % mind j v 1 index 3 index gt {exit} if 1 index idiv exch 1 add exch } loop exch pop exch pop } bind def /getRSSwidths { /oe exch def /el exch def /mw exch def /nm exch def /val exch def /out el array def /mask 0 def 0 1 el 2 sub { /bar exch def /ew 1 def /mask mask 1 bar bitshift or def { /sval nm ew sub 1 sub el bar sub 2 sub ncr def oe mask 0 eq and nm ew sub el 2 mul sub bar 2 mul add -2 ge and { /sval sval nm ew sub el sub bar add el bar sub 2 sub ncr sub def } if el bar sub 2 gt { /lval 0 def nm ew sub el sub bar add 2 add -1 mw 1 add { nm exch sub ew sub 1 sub el bar sub 3 sub ncr /lval exch lval add def } for /sval sval lval el bar sub 1 sub mul sub def } { nm ew sub mw gt {/sval sval 1 sub def} if } ifelse /val val sval sub def val 0 lt {exit} if /ew ew 1 add def /mask mask 1 bar bitshift not and def } loop /val val sval add def /nm nm ew sub def out bar ew put } for out el 1 sub nm put out } bind def /binval [ linkage {1} {0} ifelse barcode 4 13 getinterval {48 sub} forall ] def 0 1 12 { /i exch def binval i 1 add 2 copy get binval i get 4537077 mod 10 mul add put binval i binval i get 4537077 idiv put } for /right binval 13 get 4537077 mod def binval 13 2 copy get 4537077 idiv put /left 0 def /i true def 0 1 13 { /j exch def binval j get dup 0 eq i and { pop } { /i false def /left left 3 -1 roll 10 13 j sub exp cvi mul add def } ifelse } for /d1 left 1597 idiv def /d2 left 1597 mod def /d3 right 1597 idiv def /d4 right 1597 mod def /tab164 [ 160 0 12 4 8 1 161 1 960 161 10 6 6 3 80 10 2014 961 8 8 4 5 31 34 2714 2015 6 10 3 6 10 70 2840 2715 4 12 1 8 1 126 ] def /tab154 [ 335 0 5 10 2 7 4 84 1035 336 7 8 4 5 20 35 1515 1036 9 6 6 3 48 10 1596 1516 11 4 8 1 81 1 ] def /i 0 def { d1 tab164 i get le { tab164 i 1 add 7 getinterval {} forall /d1te exch def /d1to exch def /d1mwe exch def /d1mwo exch def /d1ele exch def /d1elo exch def /d1gs exch def exit } if /i i 8 add def } loop /i 0 def { d2 tab154 i get le { tab154 i 1 add 7 getinterval {} forall /d2te exch def /d2to exch def /d2mwe exch def /d2mwo exch def /d2ele exch def /d2elo exch def /d2gs exch def exit } if /i i 8 add def } loop /i 0 def { d3 tab164 i get le { tab164 i 1 add 7 getinterval {} forall /d3te exch def /d3to exch def /d3mwe exch def /d3mwo exch def /d3ele exch def /d3elo exch def /d3gs exch def exit } if /i i 8 add def } loop /i 0 def { d4 tab154 i get le { tab154 i 1 add 7 getinterval {} forall /d4te exch def /d4to exch def /d4mwe exch def /d4mwo exch def /d4ele exch def /d4elo exch def /d4gs exch def exit } if /i i 8 add def } loop /d1wo d1 d1gs sub d1te idiv d1elo d1mwo 4 false getRSSwidths def /d1we d1 d1gs sub d1te mod d1ele d1mwe 4 true getRSSwidths def /d2wo d2 d2gs sub d2to mod d2elo d2mwo 4 true getRSSwidths def /d2we d2 d2gs sub d2to idiv d2ele d2mwe 4 false getRSSwidths def /d3wo d3 d3gs sub d3te idiv d3elo d3mwo 4 false getRSSwidths def /d3we d3 d3gs sub d3te mod d3ele d3mwe 4 true getRSSwidths def /d4wo d4 d4gs sub d4to mod d4elo d4mwo 4 true getRSSwidths def /d4we d4 d4gs sub d4to idiv d4ele d4mwe 4 false getRSSwidths def /d1w 8 array def 0 1 3 { /i exch def d1w i 2 mul d1wo i get put d1w i 2 mul 1 add d1we i get put } for /d2w 8 array def 0 1 3 { /i exch def d2w 7 i 2 mul sub d2wo i get put d2w 6 i 2 mul sub d2we i get put } for /d3w 8 array def 0 1 3 { /i exch def d3w 7 i 2 mul sub d3wo i get put d3w 6 i 2 mul sub d3we i get put } for /d4w 8 array def 0 1 3 { /i exch def d4w i 2 mul d4wo i get put d4w i 2 mul 1 add d4we i get put } for /widths [ d1w {} forall d2w {} forall d3w {} forall d4w {} forall ] def /checkweights [ 1 3 9 27 2 6 18 54 58 72 24 8 29 36 12 4 74 51 17 32 37 65 48 16 64 34 23 69 49 68 46 59 ] def /checkwidths [ 3 8 2 1 1 3 5 5 1 1 3 3 7 1 1 3 1 9 1 1 2 7 4 1 1 2 5 6 1 1 2 3 8 1 1 1 5 7 1 1 1 3 9 1 1 ] def /checksum 0 def 0 1 31 { /i exch def /checksum checksum widths i get checkweights i get mul add def } for /checksum checksum 79 mod def checksum 8 ge {/checksum checksum 1 add def} if checksum 72 ge {/checksum checksum 1 add def} if /checklt checkwidths checksum 9 idiv 5 mul 5 getinterval def /checkrtrev checkwidths checksum 9 mod 5 mul 5 getinterval def /checkrt 5 array def 0 1 4 { /i exch def checkrt i checkrtrev 4 i sub get put } for % Stacked format format (omni) eq format (truncated) eq or { % linear /sbs [ 1 d1w {} forall checklt {} forall d2w {} forall d4w {} forall checkrt {} forall d3w {} forall 1 1 ] def << /ren //renlinear /sbs sbs /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] /txt txt /textxalign (center) /opt options >> dontdraw not //renlinear if } { % 2D - stacked or stackedomni /top [ 1 1 d1w {} forall checklt {} forall d2w {} forall 1 1 0 ] def /bot [ 1 1 d4w {} forall checkrt {} forall d3w {} forall 1 1 0 ] def 0 2 24 { /i exch def top i get {0} repeat top i 1 add get {1} repeat } for 50 array astore /top exch def 0 2 24 { /i exch def bot i get {1} repeat bot i 1 add get {0} repeat } for 50 array astore /bot exch def % Stacked format (stacked) eq { /sep [ 50 {0} repeat ] def 4 1 45 { /i exch def top i get bot i get eq { sep i 1 top i get sub put } { sep i 1 sep i 1 sub get sub put } ifelse } for /pixs [ 5 {top aload pop} repeat sep aload pop 7 {bot aload pop} repeat ] def /pixy pixs length 50 idiv def } if % Stacked omnidirectional format (stackedomni) eq { /sep1 [ top {1 exch sub} forall ] def sep1 0 [ 0 0 0 0 ] putinterval sep1 46 [ 0 0 0 0 ] putinterval 18 1 30 { /i exch def top i get 0 eq { top i 1 sub get 1 eq { 1 } { sep1 i 1 sub get 0 eq {1} {0} ifelse } ifelse } { 0 } ifelse sep1 exch i exch put } for /sep2 [ 0 0 0 0 21 { 0 1 } repeat 0 0 0 0 ] def /sep3 [ bot {1 exch sub} forall ] def sep3 0 [ 0 0 0 0 ] putinterval sep3 46 [ 0 0 0 0 ] putinterval 19 1 31 { /i exch def bot i get 0 eq { bot i 1 sub get 1 eq { 1 } { sep3 i 1 sub get 0 eq {1} {0} ifelse } ifelse } { 0 } ifelse sep3 exch i exch put } for /f3 [1 1 1 1 1 1 1 1 1 0 1 1 1] def true 0 1 12 {dup bot exch 19 add get exch f3 exch get eq and} for { % Right shifted module for value 3 finder sep3 19 [ 0 0 0 0 0 0 0 0 0 0 1 0 0 ] putinterval } if /pixs [ 33 {top aload pop} repeat sep1 aload pop sep2 aload pop sep3 aload pop 33 {bot aload pop} repeat ] def /pixy pixs length 50 idiv def } if % Return the arguments << /ren //renmatrix /pixs pixs /pixx 50 /pixy pixy /height pixy 72 div /width 50 72 div /opt options >> dontdraw not //renmatrix if } ifelse end } bind def /databaromni dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databaromni-- postscriptbarcode-2014-03-12/src/databaromnicomposite.ps000066400000000000000000000102401231007474100231670ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databaromnicomposite-- % --REQUIRES preamble raiseerror renlinear renmatrix databaromni micropdf417 pdf417 gs1-cc-- % --DESC: GS1 DataBar Omnidirectional Composite % --EXAM: (01)03612345678904|(11)990102 % --EXOP: % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 2 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /databaromni dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /databaromnicomposite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse gsave options (lintype) (databaromni) put options (linkage) true put options (inkspread) (0) put options (dontdraw) true put % Plot the linear part linear options //databaromni exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def //renlinear exec % Plot the separator /sepfinder { /fp exch def fp 1 fp 12 add { /i exch def bot i get 0 eq { bot i 1 sub get 1 eq { 1 } { sep i 1 sub get 0 eq {1} {0} ifelse } ifelse } { 0 } ifelse sep exch i exch put } for /f3 [1 1 1 1 1 1 1 1 1 0 1 1 1] def true 0 1 12 {dup bot exch fp add get exch f3 exch get eq and} for { % Right shifted module for value 3 finder sep fp [ 0 0 0 0 0 0 0 0 0 0 1 0 0 ] putinterval } if } bind def mark 0 linsbs {1 index 1 eq {{0}} {{1}} ifelse repeat} forall counttomark 1 sub array astore /bot exch def pop pop /sep [ bot {1 exch sub} forall ] def sep 0 [0 0 0] putinterval sep sep length 4 sub [0 0 0 0] putinterval 18 sepfinder 64 sepfinder 0 linheight rmoveto << /ren //renmatrix /pixs sep /pixx sep length /pixy 1 /height 1 72 div /width sep length 72 div /opt options >> //renmatrix exec % Plot the 2D part -5 1 rmoveto comp options //gs1-cc exec //renmatrix exec grestore end } bind def /databaromnicomposite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databaromnicomposite-- postscriptbarcode-2014-03-12/src/databarstacked.ps000066400000000000000000000073121231007474100217260ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databarstacked-- % --REQUIRES preamble raiseerror renlinear renmatrix databaromni-- % --DESC: GS1 DataBar Stacked % --EXAM: (01)24012345678905 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put dup /databaromni dup /uk.co.terryburton.bwipp findresource put begin /databarstacked { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Validate the input barcode 0 4 getinterval (\(01\)) ne { /bwipp.databarstackedBadAI (GS1 DataBar Stacked must begin with (01) application identifier) //raiseerror exec } if barcode length 17 ne barcode length 18 ne and { /bwipp.databarstackedBadLength (GS1 DataBar Stacked must be 13 or 14 digits) //raiseerror exec } if barcode 4 barcode length 4 sub getinterval { dup 48 lt exch 57 gt or { /bwipp.databarstackedBadCharacter (GS1 DataBar Stacked must contain only digits) //raiseerror exec } if } forall % Calculate checksum and add to end of barcode /checksum 0 def 0 1 12 { /i exch def /checksum checksum barcode i 4 add get 48 sub i 2 mod 0 eq {3 mul} if add def } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 18 eq { barcode 17 get checksum 48 add ne { /bwipp.databarstackedBadCheckDigit (Incorrect GS1 DataBar Stacked check digit provided) //raiseerror exec } if } if 18 string dup 0 barcode putinterval dup 17 checksum 48 add put /barcode exch def % Get the result of encoding with databaromni with format=stacked options (dontdraw) true put options (format) (stacked) put /args barcode options //databaromni exec def args (opt) options put args dontdraw not //renmatrix if end } bind def /databarstacked dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databarstacked-- postscriptbarcode-2014-03-12/src/databarstackedcomposite.ps000066400000000000000000000100131231007474100236410ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databarstackedcomposite-- % --REQUIRES preamble raiseerror renlinear renmatrix databaromni databarstacked micropdf417 pdf417 gs1-cc-- % --DESC: GS1 DataBar Stacked Composite % --EXAM: (01)03412345678900|(17)010200 % --EXOP: % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 2 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /databarstacked dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /databarstackedcomposite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse gsave options (lintype) (databarstacked) put options (linkage) true put options (inkspread) (0) put options (dontdraw) true put % Plot the linear part linear options //databarstacked exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def //renmatrix exec % Plot the separator /sepfinder { /fp exch def fp 1 fp 12 add { /i exch def bot i get 0 eq { bot i 1 sub get 1 eq { 1 } { sep i 1 sub get 0 eq {1} {0} ifelse } ifelse } { 0 } ifelse sep exch i exch put } for /f3 [1 1 1 1 1 1 1 1 1 0 1 1 1] def true 0 1 12 {dup bot exch fp add get exch f3 exch get eq and} for { % Right shifted module for value 3 finder sep fp [ 0 0 0 0 0 0 0 0 0 0 1 0 0 ] putinterval } if } bind def /sep [ bot {1 exch sub} forall ] def sep 0 [ 0 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval 18 sepfinder 0 linheight rmoveto << /ren //renmatrix /pixs sep /pixx sep length /pixy 1 /height 1 72 div /width sep length 72 div /opt options >> //renmatrix exec % Plot the 2D part 1 1 rmoveto comp options //gs1-cc exec //renmatrix exec grestore end } bind def /databarstackedcomposite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databarstackedcomposite-- postscriptbarcode-2014-03-12/src/databarstackedomni.ps000066400000000000000000000075021231007474100226120ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databarstackedomni-- % --REQUIRES preamble raiseerror renlinear renmatrix databaromni-- % --DESC: GS1 DataBar Stacked Omnidirectional % --EXAM: (01)24012345678905 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put dup /databaromni dup /uk.co.terryburton.bwipp findresource put begin /databarstackedomni { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Validate the input barcode 0 4 getinterval (\(01\)) ne { /bwipp.databarstackedomniBadAI (GS1 DataBar Stacked Omnidirectional must begin with (01) application identifier) //raiseerror exec } if barcode length 17 ne barcode length 18 ne and { /bwipp.databarstackedomniBadLength (GS1 DataBar Stacked Omnidirectional must be 13 or 14 digits) //raiseerror exec } if barcode 4 barcode length 4 sub getinterval { dup 48 lt exch 57 gt or { /bwipp.databarstackedomniBadCharacter (GS1 DataBar Stacked Omnidirectional must contain only digits) //raiseerror exec } if } forall % Calculate checksum and add to end of barcode /checksum 0 def 0 1 12 { /i exch def /checksum checksum barcode i 4 add get 48 sub i 2 mod 0 eq {3 mul} if add def } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 18 eq { barcode 17 get checksum 48 add ne { /bwipp.databarstackedomniBadCheckDigit (Incorrect GS1 DataBar Stacked Omnidirectional check digit provided) //raiseerror exec } if } if 18 string dup 0 barcode putinterval dup 17 checksum 48 add put /barcode exch def % Get the result of encoding with databaromni with format=stackedomni options (dontdraw) true put options (format) (stackedomni) put /args barcode options //databaromni exec def args (opt) options put args dontdraw not //renmatrix if end } bind def /databarstackedomni dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databarstackedomni-- postscriptbarcode-2014-03-12/src/databarstackedomnicomposite.ps000066400000000000000000000100711231007474100245300ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databarstackedomnicomposite-- % --REQUIRES preamble raiseerror renlinear renmatrix databaromni databarstackedomni micropdf417 pdf417 gs1-cc-- % --DESC: GS1 DataBar Stacked Omnidirectional Composite % --EXAM: (01)03612345678904|(11)990102 % --EXOP: % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 2 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /databarstackedomni dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /databarstackedomnicomposite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse gsave options (lintype) (databarstackedomni) put options (linkage) true put options (inkspread) (0) put options (dontdraw) true put % Plot the linear part linear options //databarstackedomni exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def //renmatrix exec % Plot the separator /sepfinder { /fp exch def fp 1 fp 12 add { /i exch def bot i get 0 eq { bot i 1 sub get 1 eq { 1 } { sep i 1 sub get 0 eq {1} {0} ifelse } ifelse } { 0 } ifelse sep exch i exch put } for /f3 [1 1 1 1 1 1 1 1 1 0 1 1 1] def true 0 1 12 {dup bot exch fp add get exch f3 exch get eq and} for { % Right shifted module for value 3 finder sep fp [ 0 0 0 0 0 0 0 0 0 0 1 0 0 ] putinterval } if } bind def /sep [ bot {1 exch sub} forall ] def sep 0 [ 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval 18 sepfinder 0 linheight rmoveto << /ren //renmatrix /pixs sep /pixx sep length /pixy 1 /height 1 72 div /width sep length 72 div /opt options >> //renmatrix exec % Plot the 2D part 1 1 rmoveto comp options //gs1-cc exec //renmatrix exec grestore end } bind def /databarstackedomnicomposite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databarstackedomnicomposite-- postscriptbarcode-2014-03-12/src/databartruncated.ps000066400000000000000000000073621231007474100223060ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databartruncated-- % --REQUIRES preamble raiseerror renlinear renmatrix databaromni-- % --DESC: GS1 DataBar Truncated % --EXAM: (01)24012345678905 % --EXOP: % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /databaromni dup /uk.co.terryburton.bwipp findresource put begin /databartruncated { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Validate the input barcode 0 4 getinterval (\(01\)) ne { /bwipp.databartruncatedBadAI (GS1 DataBar Truncated must begin with (01) application identifier) //raiseerror exec } if barcode length 17 ne barcode length 18 ne and { /bwipp.databartruncatedBadLength (GS1 DataBar Truncated must be 13 or 14 digits) //raiseerror exec } if barcode 4 barcode length 4 sub getinterval { dup 48 lt exch 57 gt or { /bwipp.databartruncatedBadCharacter (GS1 DataBar Truncated must contain only digits) //raiseerror exec } if } forall % Calculate checksum and add to end of barcode /checksum 0 def 0 1 12 { /i exch def /checksum checksum barcode i 4 add get 48 sub i 2 mod 0 eq {3 mul} if add def } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 18 eq { barcode 17 get checksum 48 add ne { /bwipp.databartruncatedBadCheckDigit (Incorrect GS1 DataBar Truncated check digit provided) //raiseerror exec } if } if 18 string dup 0 barcode putinterval dup 17 checksum 48 add put /barcode exch def % Get the result of encoding with databaromni with format=truncated options (dontdraw) true put options (format) (truncated) put /args barcode options //databaromni exec def args (opt) options put args dontdraw not //renlinear if end } bind def /databartruncated dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databartruncated-- postscriptbarcode-2014-03-12/src/databartruncatedcomposite.ps000066400000000000000000000103161231007474100242220ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER databartruncatedcomposite-- % --REQUIRES preamble raiseerror renlinear renmatrix databaromni databartruncated micropdf417 pdf417 gs1-cc-- % --DESC: GS1 DataBar Truncated Composite % --EXAM: (01)03612345678904|(11)990102 % --EXOP: % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 2 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /databartruncated dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /databartruncatedcomposite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse gsave options (lintype) (databartruncated) put options (linkage) true put options (inkspread) (0) put options (dontdraw) true put % Plot the linear part linear options //databartruncated exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def //renlinear exec % Plot the separator /sepfinder { /fp exch def fp 1 fp 12 add { /i exch def bot i get 0 eq { bot i 1 sub get 1 eq { 1 } { sep i 1 sub get 0 eq {1} {0} ifelse } ifelse } { 0 } ifelse sep exch i exch put } for /f3 [1 1 1 1 1 1 1 1 1 0 1 1 1] def true 0 1 12 {dup bot exch fp add get exch f3 exch get eq and} for { % Right shifted module for value 3 finder sep fp [ 0 0 0 0 0 0 0 0 0 0 1 0 0 ] putinterval } if } bind def mark 0 linsbs {1 index 1 eq {{0}} {{1}} ifelse repeat} forall counttomark 1 sub array astore /bot exch def pop pop /sep [ bot {1 exch sub} forall ] def sep 0 [0 0 0] putinterval sep sep length 4 sub [0 0 0 0] putinterval 18 sepfinder 64 sepfinder 0 linheight rmoveto << /ren //renmatrix /pixs sep /pixx sep length /pixy 1 /height 1 72 div /width sep length 72 div /opt options >> //renmatrix exec % Plot the 2D part -5 1 rmoveto comp options //gs1-cc exec //renmatrix exec grestore end } bind def /databartruncatedcomposite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER databartruncatedcomposite-- postscriptbarcode-2014-03-12/src/datamatrix.ps000066400000000000000000000475441231007474100211420ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER datamatrix-- % --REQUIRES preamble raiseerror renmatrix-- % --DESC: Data Matrix % --EXAM: This is Data Matrix! % --EXOP: rows=32 columns=32 % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /datamatrix { 20 dict begin /options exch def /barcode exch def /dontdraw false def /columns 0 def /rows 0 def /prefix () def /encoding (ascii) def /raw false def /parse false def /parsefnc false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /columns columns cvi def /rows rows cvi def % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if /premaps << /FNC1 [ 232 ] /PROG [ 234 ] /MAC5 [ 236 ] /MAC6 [ 237 ] () [] >> def premaps prefix known { /precws premaps prefix get def } { /bwipp.datamatrixBadPrefix (The prefix for Data Matrix must be FNC1, PROG, MAC5 or MAC6) //raiseerror exec } ifelse /prelen precws length def /barlen barcode length def raw {/encoding (raw) def} if encoding (raw) eq { /cws barlen prelen add array def cws 0 precws putinterval /i 0 def /j prelen def { % loop i barlen eq {exit} if /cw barcode i 1 add 3 getinterval cvi def cws j cw put /i i 4 add def /j j 1 add def } loop /cws cws 0 j getinterval def } if % Special function characters /fn1 -1 def encoding (ascii) eq { /fncvals << (FNC1) fn1 >> def /msg barlen array def /i 0 def /j 0 def { i barlen eq {exit} if /char barcode i get def parsefnc char 94 eq and i barlen 4 sub lt and { barcode i 1 add get 94 ne { /char fncvals barcode i 1 add 4 getinterval get def /i i 4 add def } { /i i 1 add def } ifelse } if msg j char put /i i 1 add def /j j 1 add def } loop /msg msg 0 j getinterval def /msglen msg length def /cws msglen 2 mul prelen add array def cws 0 precws putinterval /i 0 def /j prelen def { % loop i msglen eq {exit} if /char msg i get def char fn1 eq { % FNC1 cws j 232 put /i i 1 add def /j j 1 add def } { char 48 ge char 57 le and i msglen 1 sub lt and { msg i 1 add get dup 48 ge exch 57 le and { % Digit pair cws j msg i get 48 sub 10 mul msg i 1 add get 48 sub add 130 add put /i i 2 add def /j j 1 add def } { % Singular digit cws j char 1 add put /i i 1 add def /j j 1 add def } ifelse } { char 127 le { % ASCII cws j char 1 add put /i i 1 add def /j j 1 add def } { % Extended ASCII cws j 235 put cws j 1 add char 127 sub put /i i 1 add def /j j 2 add def } ifelse } ifelse } ifelse } loop /cws cws 0 j getinterval def } if /base40 false def % Used for size optimization encoding (c40) eq encoding (text) eq encoding (x12) eq or or { % Pathological case : 8-bit chars encode to 4 base-40 values % plus extra 2 for possible nul-pading /b40 barlen 4 mul 2 add array def /base40 true def % Maps are encoded as static strings with the base-40 value in % the right 6-bits and the shift-state in the two left bits. % The value 255 indicates an invalid mapping (x12 only). encoding (c40) eq { /mode 230 def /8bit true def /charmap < 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f 03808182838485868788898a8b8c8d8e0405060708090a0b0c0d8f9091929394 950e0f101112131415161718191a1b1c1d1e1f2021222324252627969798999a c0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf > def } if encoding (text) eq { /mode 239 def /8bit true def /charmap < 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f 03808182838485868788898a8b8c8d8e0405060708090a0b0c0d8f9091929394 95c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9da969798999a c00e0f101112131415161718191a1b1c1d1e1f2021222324252627dbdcdddedf > def } if encoding (x12) eq { /mode 238 def /8bit false def /parsefnc false def /charmap < ffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffff 03ffffffffffffffffff01ffffffffff0405060708090a0b0c0dffffffff02ff ff0e0f101112131415161718191a1b1c1d1e1f2021222324252627ffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff > def } if /i 0 def /j 0 def { % loop i barlen ge {exit} if /char barcode i get def % ^FNC1 parsefnc char 94 eq and i barlen 4 sub lt and { barcode i 5 getinterval (^FNC1) eq { b40 j [ 1 27 ] putinterval % set-2, FNC1 /char -1 def /i i 5 add def /j j 2 add def } if } if % Replace ^^ with ^ parsefnc char 94 eq and i barlen 1 sub lt and { barcode i 1 add get 94 eq { /i i 1 add def } if } if 8bit char 127 gt and { /char char 127 and def b40 j [ 1 30 ] putinterval % set-2, high-bit /j j 2 add def } if char 0 ge char 127 le and { charmap char get dup 255 ne { dup -6 bitshift 1 sub dup 0 ge { b40 j 3 -1 roll put /j j 1 add def } { pop } ifelse 63 and b40 j 3 -1 roll put /j j 1 add def } { /bwipp.datamatrixBadX12character (Invalid character for Data Matrix X12 encoding) //raiseerror exec } ifelse /i i 1 add def } if } loop % Nul-pad to full triples { % loop j 3 mod 0 eq { exit } if b40 j 0 put /j j 1 add def } loop % Convert triples to 2 bytes /b40len j def /cws b40len 3 div 2 mul prelen add 1 add cvi array def cws 0 precws putinterval cws prelen mode put /i 0 def /j prelen 1 add def { % loop i b40len eq { exit } if cws j [ b40 i get 1600 mul b40 i 1 add get 40 mul add b40 i 2 add get add 1 add dup -8 bitshift exch 255 and ] putinterval /i i 3 add def /j j 2 add def } loop } if % Basic metrics for the each symbol % rows cols regh regv rscw rsbl /metrics [ % Standard square symbols [ 10 10 1 1 5 1 ] [ 12 12 1 1 7 1 ] [ 14 14 1 1 10 1 ] [ 16 16 1 1 12 1 ] [ 18 18 1 1 14 1 ] [ 20 20 1 1 18 1 ] [ 22 22 1 1 20 1 ] [ 24 24 1 1 24 1 ] [ 26 26 1 1 28 1 ] [ 32 32 2 2 36 1 ] [ 36 36 2 2 42 1 ] [ 40 40 2 2 48 1 ] [ 44 44 2 2 56 1 ] [ 48 48 2 2 68 1 ] [ 52 52 2 2 84 2 ] [ 64 64 4 4 112 2 ] [ 72 72 4 4 144 4 ] [ 80 80 4 4 192 4 ] [ 88 88 4 4 224 4 ] [ 96 96 4 4 272 4 ] [ 104 104 4 4 336 6 ] [ 120 120 6 6 408 6 ] [ 132 132 6 6 496 8 ] [ 144 144 6 6 620 10 ] % Optional rectangular symbols [ 8 18 1 1 7 1 ] [ 8 32 1 2 11 1 ] [ 12 26 1 1 14 1 ] [ 12 36 1 2 18 1 ] [ 16 36 1 2 24 1 ] [ 16 48 1 2 28 1 ] ] def % Select metrics of an appropriate symbol /urows rows def /ucols columns def /i 0 def { % loop /m metrics i get def /rows m 0 get def % Rows in symbol /cols m 1 get def % Columns in symbol /regh m 2 get def % Horizontal regions /regv m 3 get def % Vertical regions /rscw m 4 get def % Error correction codewords /rsbl m 5 get def % Error correction blocks /mrows rows 2 regh mul sub def % Rows in the mapping matrix /mcols cols 2 regv mul sub def % Columns in the mapping matrix /rrows mrows regh idiv def % Rows per region /rcols mcols regv idiv def % Columns per region /ncws mrows mcols mul 8 idiv rscw sub def % Data codewords /okay true def cws length ncws gt {/okay false def} if urows 0 ne urows rows ne and {/okay false def} if ucols 0 ne ucols cols ne and {/okay false def} if okay {exit} if /i i 1 add def } loop % C40/TEXT/X12 size optimization - do not emit the unlatch unless we pad base40 cws length ncws lt and { /cws [ cws {} forall 254 ] def } if % Extend cws to ncws codewords by addition of pseudo-randomised pad characters cws length ncws lt { /datlen cws length def /cws [ cws {} forall ncws datlen sub {129} repeat ] def datlen 1 add 1 ncws 1 sub { /i exch def i 1 add 149 mul 253 mod 1 add 129 add dup 254 gt {254 sub} if cws exch i exch put } for } if % De-interleave the codewords into blocks /cwbs rsbl array def % Array of data codeword blocks /ecbs rsbl array def % Array of error correction blocks 0 1 rsbl 1 sub { /i exch def cws length 1558 ne { /cwbsize cws length rsbl idiv def } { i 7 le {/cwbsize 156 def} {/cwbsize 155 def} ifelse } ifelse /cwb cwbsize array def 0 1 cwbsize 1 sub { /j exch def cwb j cws j rsbl mul i add get put } for cwbs i cwb put ecbs i [ rscw rsbl idiv {0} repeat ] put } for % Calculate the log and anti-log tables /rsalog [ 1 255 { dup 2 mul dup 256 ge {301 xor} if } repeat ] def /rslog 256 array def 1 1 255 {dup rsalog exch get exch rslog 3 1 roll put} for % Function to calculate the product in the field /rsprod { 2 copy 0 ne exch 0 ne and { rslog exch get exch rslog exch get add 255 mod rsalog exch get } { pop pop 0 } ifelse } bind def % Generate the coefficients /coeffs [ 1 rscw rsbl idiv {0} repeat ] def 1 1 rscw rsbl idiv { /i exch def coeffs i coeffs i 1 sub get put i 1 sub -1 1 { /j exch def coeffs j coeffs j 1 sub get coeffs j get rsalog i get rsprod xor put } for coeffs 0 coeffs 0 get rsalog i get rsprod put } for /coeffs coeffs 0 coeffs length 1 sub getinterval def % Calculate the error correction codewords for each block 0 1 cwbs length 1 sub { /i exch def /cwb cwbs i get def /ecb ecbs i get def 0 1 cwb length 1 sub { /t exch cwb exch get ecb 0 get xor def ecb length 1 sub -1 0 { /j exch def /p ecb length j sub 1 sub def ecb p t coeffs j get rsprod put j 0 gt { ecb p ecb p 1 add get ecb p get xor put } if } for } for } for % Strange fixup for 144x144 symbols ncws 1558 eq { /ecbs [ ecbs 8 2 getinterval {} forall ecbs 0 8 getinterval {} forall ] def } if % Extend codewords with the interleaved error correction codes /cws [ cws {} forall rscw {0} repeat ] def 0 1 rscw 1 sub { /i exch def cws ncws i add ecbs i rsbl mod get i rsbl idiv get put } for % Place the codewords into the matrix /module { % cw row col shape 4 -1 roll (00000000) 8 string copy dup 3 -1 roll 2 8 string cvrs dup length 8 exch sub exch putinterval 7 -1 0 {1 index exch get 48 sub exch} for pop 11 -3 roll % 1 2 4 8 16 32 64 128 row col shape { % Place each bit of the codeword in the shape, MSB first exec 1 index 0 lt { exch mrows add exch 4 mrows 4 add 8 mod sub add } if dup 0 lt { mcols add exch 4 mcols 4 add 8 mod sub add exch } if exch mcols mul add mmat exch 5 -1 roll put } forall } bind def % Placement patterns /dmn [ { 2 copy 2 sub exch 2 sub exch } bind { 2 copy 1 sub exch 2 sub exch } bind { 2 copy 2 sub exch 1 sub exch } bind { 2 copy 1 sub exch 1 sub exch } bind { 2 copy exch 1 sub exch } bind { 2 copy 2 sub } bind { 2 copy 1 sub } bind { 2 copy } bind ] def /dmc1 [ { mrows 1 sub 0 } bind { mrows 1 sub 1 } bind { mrows 1 sub 2 } bind { 0 mcols 2 sub } bind { 0 mcols 1 sub } bind { 1 mcols 1 sub } bind { 2 mcols 1 sub } bind { 3 mcols 1 sub } bind ] def /dmc2 [ { mrows 3 sub 0 } bind { mrows 2 sub 0 } bind { mrows 1 sub 0 } bind { 0 mcols 4 sub } bind { 0 mcols 3 sub } bind { 0 mcols 2 sub } bind { 0 mcols 1 sub } bind { 1 mcols 1 sub } bind ] def /dmc3 [ { mrows 3 sub 0 } bind { mrows 2 sub 0 } bind { mrows 1 sub 0 } bind { 0 mcols 2 sub } bind { 0 mcols 1 sub } bind { 1 mcols 1 sub } bind { 2 mcols 1 sub } bind { 3 mcols 1 sub } bind ] def /dmc4 [ { mrows 1 sub 0 } bind { mrows 1 sub mcols 1 sub } bind { 0 mcols 3 sub } bind { 0 mcols 2 sub } bind { 0 mcols 1 sub } bind { 1 mcols 3 sub } bind { 1 mcols 2 sub } bind { 1 mcols 1 sub } bind ] def /mmat [ mrows mcols mul {-1} repeat ] def cws length 1 sub -1 0 {cws exch get} for % Reverse cws onto stack 4 0 % Starting row and column { % loop 2 copy 0 eq exch mrows eq and { dmc1 module } if 2 copy 0 eq exch mrows 2 sub eq and mcols 4 mod 0 ne and { dmc2 module } if 2 copy 0 eq exch mrows 2 sub eq and mcols 8 mod 4 eq and { dmc3 module } if 2 copy 2 eq exch mrows 4 add eq and mcols 8 mod 0 eq and { dmc4 module } if { % loop for sweeping upwards 2 copy 0 ge exch mrows lt and { 2 copy exch mcols mul add mmat exch get -1 eq { dmn module } if } if 2 add exch 2 sub exch 2 copy mcols lt exch 0 ge and not {exit} if } loop 3 add exch 1 add exch { % loop for sweeping downwards 2 copy mcols lt exch 0 ge and { 2 copy exch mcols mul add mmat exch get -1 eq { dmn module } if } if 2 sub exch 2 add exch 2 copy 0 ge exch mrows lt and not {exit} if } loop 1 add exch 3 add exch 2 copy mcols lt exch mrows lt or not {pop pop exit} if } loop % Set checker pattern if required mmat mrows mcols mul 1 sub get -1 eq { mmat mrows mcols 1 sub mul 2 sub [1 0] putinterval mmat mrows mcols mul 2 sub [0 1] putinterval } if % Place the modules onto a pixel map between alignment patterns /pixs rows cols mul array def /cwpos 0 def 0 1 rows 1 sub { /i exch def i rrows 2 add mod 0 eq { pixs i cols mul [ cols 2 idiv {1 0} repeat ] putinterval } if i rrows 2 add mod rrows 1 add eq { pixs i cols mul [ cols {1} repeat ] putinterval } if i rrows 2 add mod 0 ne i rrows 2 add mod rrows 1 add ne and { 0 1 cols 1 sub { /j exch def j rcols 2 add mod 0 eq { pixs i cols mul j add 1 put } if j rcols 2 add mod rcols 1 add eq { pixs i cols mul j add i 2 mod put } if j rcols 2 add mod 0 ne j rcols 2 add mod rcols 1 add ne and { pixs i cols mul j add mmat cwpos get put /cwpos cwpos 1 add def } if } for } if } for % Return the arguments << /ren //renmatrix /pixs pixs /pixx cols /pixy rows /height rows 2 mul 72 div /width cols 2 mul 72 div /opt options >> dontdraw not //renmatrix if end } bind def /datamatrix dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER datamatrix-- postscriptbarcode-2014-03-12/src/ean13.ps000066400000000000000000000210421231007474100176740ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER ean13-- % --REQUIRES preamble raiseerror renlinear ean5 ean2-- % --DESC: EAN-13 % --EXAM: 2112345678900 % --EXOP: includetext guardwhitespace % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /ean2 dup /uk.co.terryburton.bwipp findresource put dup /ean5 dup /uk.co.terryburton.bwipp findresource put begin /ean13 { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textxoffset -10 def /textyoffset -4 def /height 1 def /addongap 12 def /addontextfont (unset) def /addontextsize (unset) def /addontextxoffset (unset) def /addontextyoffset (unset) def % Parse the input options, either a string or a dict options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /height height cvr def /addongap addongap cvr def addontextfont (unset) ne {/addontextfont addontextfont cvlit def} if addontextsize (unset) ne {/addontextsize addontextsize cvr def} if addontextxoffset (unset) ne {/addontextxoffset addontextxoffset cvr def} if addontextyoffset (unset) ne {/addontextyoffset addontextyoffset cvr def} if % Split off the addon barcode ( ) search { /barcode exch def pop /addon exch def } { pop /addon () def } ifelse % Validate the input barcode length 12 ne barcode length 13 ne and { /bwipp.ean13badLength (EAN-13 must be 12 or 13 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.ean13badCharacter (EAN-13 must contain only digits) //raiseerror exec } if } forall addon length 0 ne addon length 2 ne and addon length 5 ne and { /bwipp.ean13badAddOnLength (Add-on for EAN-13 must be 2 or 5 digits) //raiseerror exec } if % Add checksum digit /pad 13 string def /checksum 0 def 0 1 11 { /i exch def /barchar barcode i get 48 sub def i 2 mod 0 eq { /checksum barchar checksum add def } { /checksum barchar 3 mul checksum add def } ifelse } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 13 eq { barcode 12 get checksum 48 add ne { /bwipp.ean13badCheckDigit (Incorrect EAN-13 check digit provided) //raiseerror exec } if } if pad 0 barcode putinterval % Add barcode to the start of the pad pad 12 checksum 48 add put % Put ascii for checksum at end of pad /barcode pad def % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (111) (11111) (111) ] def % Create a string of the available characters /barchars (0123456789) def % Digits to mirror on left side /mirrormaps [ (000000) (001011) (001101) (001110) (010011) (011001) (011100) (010101) (010110) (011010) ] def /sbs 59 string def /txt 13 array def % Put the start character sbs 0 encs 10 get putinterval % First digit - determine mirrormap by this and show before guard bars /mirrormap mirrormaps barcode 0 get 48 sub get def txt 0 [barcode 0 1 getinterval textxoffset textyoffset textfont textsize] put % Left side - performs mirroring 1 1 6 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding mirrormap i 1 sub get 49 eq { % Reverse enc if 1 in this position in mirrormap /enclen enc length def /revenc enclen string def 0 1 enclen 1 sub { /j exch def /char enc j get def revenc enclen j sub 1 sub char put } for /enc revenc def } if sbs i 1 sub 4 mul 3 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 1 sub 7 mul 14 add textxoffset add textyoffset textfont textsize] put } for % Put the middle character sbs 7 1 sub 4 mul 3 add encs 11 get putinterval % Right side 7 1 12 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 1 sub 4 mul 8 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 1 sub 7 mul 18 add textxoffset add textyoffset textfont textsize] put } for % Put the end character sbs 56 encs 12 get putinterval /sbs [sbs {48 sub} forall] def includetext { /bhs [height height 12{height .075 sub}repeat height height 12{height .075 sub}repeat height height] def /bbs [0 0 12{.075}repeat 0 0 12{.075}repeat 0 0] def } { /bhs [30{height}repeat] def /bbs [30{0}repeat] def /txt [] def } ifelse /guardrightypos 0 def % Append the addon addon () ne { /addopts << /dontdraw true /includetext true /height height 0.15 sub /textxoffset addontextxoffset (unset) ne {addontextxoffset} {95 addongap add} ifelse addontextyoffset (unset) ne {/textyoffset addontextyoffset} if /textsize addontextsize (unset) ne {addontextsize} {textsize} ifelse /textfont addontextfont (unset) ne {addontextfont} {textfont} ifelse >> def addon length 2 eq {addon addopts //ean2 exec} if addon length 5 eq {addon addopts //ean5 exec} if /addcode exch def /sbs [sbs aload pop addongap addcode (sbs) get aload pop] def /bhs [bhs aload pop addcode (bhs) get {.075 sub} forall] def /bbs [bbs aload pop addcode (bbs) get {.075 add} forall] def /txt [txt aload pop addcode (txt) get aload pop] def /guardrightypos height 72 mul 6 sub def } if % Return the arguments << /ren //renlinear /sbs sbs /bhs bhs /bbs bbs /txt txt /opt options /guardrightpos 10 /guardrightypos guardrightypos /borderbottom 5 >> dontdraw not //renlinear if end } bind def /ean13 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER ean13-- postscriptbarcode-2014-03-12/src/ean13composite.ps000066400000000000000000000062771231007474100216340ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER ean13composite-- % --REQUIRES preamble raiseerror renlinear renmatrix ean5 ean2 ean13 micropdf417 pdf417 gs1-cc-- % --DESC: EAN-13 Composite % --EXAM: 2112345678900|(99)1234-abcd % --EXOP: includetext % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /ean13 dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /ean13composite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse gsave options (lintype) (ean13) put options (inkspread) (0) put options (dontdraw) true put % Plot the linear part linear options //ean13 exec //renlinear exec % Plot the separator -1 72 rmoveto << /ren //renmatrix /pixs [ 0 1 93 {0} repeat 1 0 1 0 93 {0} repeat 0 1 0 1 93 {0} repeat 1 0 ] /pixx 97 /pixy 3 /height 6 72 div /width 97 72 div /opt options >> //renmatrix exec % Plot the 2D part -2 6 rmoveto comp options //gs1-cc exec //renmatrix exec grestore end } bind def /ean13composite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER ean13composite-- postscriptbarcode-2014-03-12/src/ean14.ps000066400000000000000000000102011231007474100176700ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER ean14-- % --REQUIRES preamble raiseerror renlinear code128-- % --DESC: GS1-14 % --EXAM: (01)04601234567893 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /code128 dup /uk.co.terryburton.bwipp findresource put begin /ean14 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textxoffset 0 def /textyoffset -7 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /height height cvr def % Validate the input barcode 0 4 getinterval (\(01\)) ne { /bwipp.ean14badAI (GS1-14 must begin with (01) application identifier) //raiseerror exec } if barcode length 17 ne barcode length 18 ne and { /bwipp.ean14badLength (GS1-14 must be 13 or 14 digits) //raiseerror exec } if barcode 4 barcode length 4 sub getinterval { dup 48 lt exch 57 gt or { /bwipp.ean14badCharacter (GS1-14 must contain only digits) //raiseerror exec } if } forall % Calculate checksum and add to end of barcode /checksum 0 def 0 1 12 { /i exch def /checksum checksum barcode i 4 add get 48 sub i 2 mod 0 eq {3 mul} if add def } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 18 eq { barcode 17 get checksum 48 add ne { /bwipp.ean14badCheckDigit (Incorrect GS1-14 check digit provided) //raiseerror exec } if } if 18 string dup 0 barcode putinterval dup 17 checksum 48 add put /barcode exch def /gtin barcode 4 14 getinterval def % Compose input to code128 /text barcode def /barcode 21 string def barcode 0 (^FNC101) putinterval barcode 7 gtin putinterval % Get the result of encoding with code128 options (dontdraw) true put options (parsefnc) true put /args barcode options //code128 exec def args (txt) [ [text textxoffset textyoffset textfont textsize] ] put args (textxalign) (center) put args (opt) options put args dontdraw not //renlinear if end } bind def /ean14 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER ean14-- postscriptbarcode-2014-03-12/src/ean2.ps000066400000000000000000000114751231007474100176230ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER ean2-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: EAN-2 (2 digit addon) % --EXAM: 05 % --EXOP: includetext guardwhitespace % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /ean2 { 20 dict begin /options exch def % We are given an options string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textxoffset 0 def /textyoffset (unset) def /height 0.7 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /height height cvr def /textxoffset textxoffset cvr def textyoffset (unset) eq { /textyoffset height 72 mul 1 add def } { /textyoffset textyoffset cvr def } ifelse % Validate input barcode length 2 ne { /bwipp.ean2badLength (EAN-2 add-on must be 2 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.ean2badCharacter (EAN-2 add-on must contain only digits) //raiseerror exec } if } forall % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (112) (11) ] def % Create a string of the available characters /barchars (0123456789) def % Determine the mirror map based on mod 4 checksum /mirrormap [(00) (01) (10) (11)] barcode 0 2 getinterval cvi 4 mod get def /sbs 13 string def /txt 2 array def 0 1 1 { /i exch def % Prefix with either a start character or separator character i 0 eq { sbs 0 encs 10 get putinterval } { sbs i 1 sub 6 mul 7 add encs 11 get putinterval } ifelse % Lookup the encoding for the barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding mirrormap i get 49 eq { % Reverse enc if 1 in this position in mirrormap /enclen enc length def /revenc enclen string def 0 1 enclen 1 sub { /j exch def /char enc j get def revenc enclen j sub 1 sub char put } for /enc revenc def } if sbs i 6 mul 3 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 1 sub 9 mul 13 add textxoffset add textyoffset textfont textsize] put } for % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [12{height}repeat] /bbs [12{0}repeat] includetext { /txt txt } if /opt options /guardrightpos 10 /guardrightypos textyoffset 4 add /bordertop 10 >> dontdraw not //renlinear if end } bind def /ean2 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER ean2-- postscriptbarcode-2014-03-12/src/ean5.ps000066400000000000000000000122721231007474100176220ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER ean5-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: EAN-5 (5 digit addon) % --EXAM: 90200 % --EXOP: includetext guardwhitespace % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /ean5 { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textxoffset 0 def /textyoffset (unset) def /height 0.7 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /height height cvr def /textxoffset textxoffset cvr def textyoffset (unset) eq { /textyoffset height 72 mul 1 add def } { /textyoffset textyoffset cvr def } ifelse % Validate input barcode length 5 ne { /bwipp.ean5badLength (EAN-5 add-on must be 5 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.ean5badCharacter (EAN-5 add-on must contain only digits) //raiseerror exec } if } forall % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (112) (11) ] def % Create a string of the available characters /barchars (0123456789) def % Determine the mirror map based on mod 10 checksum /mirrormaps [ (11000) (10100) (10010) (10001) (01100) (00110) (00011) (01010) (01001) (00101) ] def /checksum 0 def 0 1 4 { /i exch def /barchar barcode i get 48 sub def i 2 mod 0 eq { /checksum barchar 3 mul checksum add def } { /checksum barchar 9 mul checksum add def } ifelse } for /checksum checksum 10 mod def /mirrormap mirrormaps checksum get def /sbs 31 string def /txt 5 array def 0 1 4 { /i exch def % Prefix with either a start character or separator character i 0 eq { sbs 0 encs 10 get putinterval } { sbs i 1 sub 6 mul 7 add encs 11 get putinterval } ifelse % Lookup the encoding for the barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding mirrormap i get 49 eq { % Reverse enc if 1 in this position in mirrormap /enclen enc length def /revenc enclen string def 0 1 enclen 1 sub { /j exch def /char enc j get def revenc enclen j sub 1 sub char put } for /enc revenc def } if sbs i 6 mul 3 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 1 sub 9 mul 13 add textxoffset add textyoffset textfont textsize] put } for % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [16{height}repeat] /bbs [16{0}repeat] includetext { /txt txt } if /opt options /guardrightpos 10 /guardrightypos textyoffset 4 add /bordertop 10 >> dontdraw not //renlinear if end } bind def /ean5 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER ean5-- postscriptbarcode-2014-03-12/src/ean8.ps000066400000000000000000000174231231007474100176300ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER ean8-- % --REQUIRES preamble raiseerror renlinear ean5 ean2-- % --DESC: EAN-8 % --EXAM: 02345673 % --EXOP: includetext guardwhitespace % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /ean2 dup /uk.co.terryburton.bwipp findresource put dup /ean5 dup /uk.co.terryburton.bwipp findresource put begin /ean8 { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textxoffset 4 def /textyoffset -4 def /height 1 def /addongap 12 def /addontextfont (unset) def /addontextsize (unset) def /addontextxoffset (unset) def /addontextyoffset (unset) def % Parse the input options, either a string or a dict options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /height height cvr def /addongap addongap cvr def addontextfont (unset) ne {/addontextfont addontextfont cvlit def} if addontextsize (unset) ne {/addontextsize addontextsize cvr def} if addontextxoffset (unset) ne {/addontextxoffset addontextxoffset cvr def} if addontextyoffset (unset) ne {/addontextyoffset addontextyoffset cvr def} if % Split off the addon barcode ( ) search { /barcode exch def pop /addon exch def } { pop /addon () def } ifelse % Validate the input barcode length 7 ne barcode length 8 ne and { /bwipp.ean8badLength (EAN-8 must be 7 or 8 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.ean8badCharacter (EAN-8 must contain only digits) //raiseerror exec } if } forall addon length 0 ne addon length 2 ne and addon length 5 ne and { /bwipp.ean8badAddOnLength (Add-on for EAN-8 must be 2 or 5 digits) //raiseerror exec } if % Add checksum digit /pad 8 string def /checksum 0 def 0 1 6 { /i exch def /barchar barcode i get 48 sub def i 2 mod 0 ne { /checksum barchar checksum add def } { /checksum barchar 3 mul checksum add def } ifelse } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 8 eq { barcode 7 get checksum 48 add ne { /bwipp.ean8badCheckDigit (Incorrect EAN-8 check digit provided) //raiseerror exec } if } if pad 0 barcode putinterval % Add barcode to the start of the pad pad 7 checksum 48 add put % Put ascii for checksum at end of pad /barcode pad def % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (111) (11111) (111) ] def % Create a string of the available characters /barchars (0123456789) def /sbs 43 string def /txt 8 array def % Put the start character sbs 0 encs 10 get putinterval % Left side 0 1 3 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 4 mul 3 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 7 mul textxoffset add textyoffset textfont textsize] put } for % Put the middle character sbs 4 4 mul 3 add encs 11 get putinterval % Right side 4 1 7 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 4 mul 8 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 7 mul textxoffset add 4 add textyoffset textfont textsize] put } for % Put the end character sbs 40 encs 12 get putinterval /sbs [sbs {48 sub} forall] def includetext { /bhs [height height 8{height .075 sub}repeat height height 8{height .075 sub}repeat height height] def /bbs [0 0 8{.075}repeat 0 0 8{.075}repeat 0 0] def } { /bhs [22{height}repeat] def /bbs [22{0}repeat] def /txt [] def } ifelse /guardrightypos 0 def % Append the addon addon () ne { /addopts << /dontdraw true /includetext true /height height 0.15 sub /textxoffset addontextxoffset (unset) ne {addontextxoffset} {67 addongap add} ifelse addontextyoffset (unset) ne {/textyoffset addontextyoffset} if /textsize addontextsize (unset) ne {addontextsize} {textsize} ifelse /textfont addontextfont (unset) ne {addontextfont} {textfont} ifelse >> def addon length 2 eq {addon addopts //ean2 exec} if addon length 5 eq {addon addopts //ean5 exec} if /addcode exch def /sbs [sbs aload pop addongap addcode (sbs) get aload pop] def /bhs [bhs aload pop addcode (bhs) get {.075 sub} forall] def /bbs [bbs aload pop addcode (bbs) get {.075 add} forall] def /txt [txt aload pop addcode (txt) get aload pop] def /guardrightypos height 72 mul 6 sub def } if % Return the arguments << /ren //renlinear /sbs sbs /bhs bhs /bbs bbs /txt txt /opt options /guardleftpos 10 /guardrightpos 10 /guardrightypos guardrightypos /borderbottom 5 >> dontdraw not //renlinear if end } bind def /ean8 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER ean8-- postscriptbarcode-2014-03-12/src/ean8composite.ps000066400000000000000000000064071231007474100215530ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER ean8composite-- % --REQUIRES preamble raiseerror renlinear renmatrix ean5 ean2 ean8 micropdf417 pdf417 gs1-cc-- % --DESC: EAN-8 Composite % --EXAM: 02345673|(21)A12345678 % --EXOP: includetext % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /ean8 dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /ean8composite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse gsave % Get the result of encoding with ean8 and gs1-cc options (lintype) (ean8) put options (inkspread) (0) put options (dontdraw) true put % Plot the linear part linear options //ean8 exec //renlinear exec % Plot the separator -1 72 rmoveto << /ren //renmatrix /pixs [ 0 1 65 {0} repeat 1 0 1 0 65 {0} repeat 0 1 0 1 65 {0} repeat 1 0 ] /pixx 69 /pixy 3 /height 6 72 div /width 69 72 div /opt options >> //renmatrix exec % Plot the 2D part comp options //gs1-cc exec dup (pixx) get 69 exch sub 6 rmoveto //renmatrix exec grestore end } bind def /ean8composite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER ean8composite-- postscriptbarcode-2014-03-12/src/flattermarken.ps000066400000000000000000000102161231007474100216250ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER flattermarken-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Flattermarken % --EXAM: 11099 % --EXOP: inkspread=-0.25 showborder borderleft=0 borderright=0 % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /flattermarken { 20 dict begin % Confine variable to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 0.3 def % Validate the input barcode { dup 48 lt exch 57 gt or { /bwipp.flattermarkenBadCharacter (Flattermarken must contain only digits) //raiseerror exec } if } forall % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Validate the input barcode { dup 48 lt exch 57 gt or { /bwipp.flattermarkenBadCharacter (Flattermarken must contain only digits) //raiseerror exec } if } forall % Create an array containing the character mappings /encs [ (0018) (0117) (0216) (0315) (0414) (0513) (0612) (0711) (0810) (0900) ] def % Create a string of the available characters /barchars (1234567890) def /barlen barcode length def % Length of the code /sbs barlen 4 mul string def /txt barlen array def 0 1 barlen 1 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 4 mul enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 9 mul textyoffset textfont textsize] put } for % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] /txt txt /opt options >> dontdraw not //renlinear if end } bind def /flattermarken dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER flattermarken-- postscriptbarcode-2014-03-12/src/gs1-128.ps000066400000000000000000000132771231007474100200020ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER gs1-128-- % --REQUIRES preamble raiseerror renlinear code128-- % --DESC: GS1-128 % --EXAM: (01)95012345678903(3103)000123 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /code128 dup /uk.co.terryburton.bwipp findresource put begin /gs1-128 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textxoffset 0 def /textyoffset -7 def /height 0.5 def /linkagea false def /linkagec false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /height height cvr def /text barcode def % Expand ordinals of the form ^NNN to ASCII /expand { /in exch def /out in length string def /j 0 def in { % loop (^) search { dup out exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi out exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup out exch j exch putinterval length j add /j exch def out 0 j getinterval exit } ifelse } loop } bind def % Parse out AIs /ais [] def /aival 2 dict def barcode dup length 1 sub 1 exch getinterval { % loop dup () eq {exit} if (\)) search pop exch pop exch (\() search { exch pop exch 3 1 roll } { () 3 1 roll } ifelse [ ais aload pop counttomark 2 add index ] /ais exch def aival 3 1 roll expand put } loop pop % Pre-defined fixed length data field AIs % any AI whose prefix is not included in this table must be % terminated with "FNC1", even if it's fixed length /aifixed 23 dict def [ 0 1 4 {} for ] { (00) 2 string copy dup dup 1 5 -1 roll 48 add put aifixed 3 1 roll put } forall [ 11 1 20 {} for 23 31 1 36 {} for 41 ] { 10 2 string cvrs dup aifixed 3 1 roll put } forall % Create the code128 data /fnc1 -1 def /c128 [ fnc1 ] def 0 1 ais length 1 sub { /i exch def /ai ais i get def /val aival ai get def c128 length ai length add val length add array dup 0 c128 putinterval dup c128 length ai [ exch {} forall ] putinterval dup c128 length ai length add val [ exch {} forall ] putinterval /c128 exch def i ais length 1 sub ne aifixed ai 0 2 getinterval known not and { % Append FNC1 c128 length 1 add array dup 0 c128 putinterval dup c128 length fnc1 put /c128 exch def } if } for % Compose input to code128 /barcode c128 length 1 add 5 mul string def /i 0 def /j 0 def { i c128 length eq {exit} if c128 i get dup fnc1 eq { pop barcode j (^FNC1) putinterval /j j 4 add def } { barcode exch j exch put } ifelse /i i 1 add def /j j 1 add def } loop linkagea linkagec or { barcode j linkagea {(^LNKA)} {(^LNKC)} ifelse putinterval /j j 5 add def } if /barcode barcode 0 j getinterval def % Get the result of encoding with code128 options (height) height put options (dontdraw) true put options (parsefnc) true put /args barcode options //code128 exec def args (txt) [ [text textxoffset textyoffset textfont textsize] ] put args (textxalign) (center) put args (opt) options put args dontdraw not //renlinear if end } bind def /gs1-128 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER gs1-128-- postscriptbarcode-2014-03-12/src/gs1-128composite.ps000066400000000000000000000101671231007474100217200ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER gs1-128composite-- % --REQUIRES preamble raiseerror renlinear renmatrix code128 gs1-128 micropdf417 pdf417 gs1-cc-- % --DESC: GS1-128 Composite % --EXAM: (00)030123456789012340|(02)13012345678909(37)24(10)1234567ABCDEFG % --EXOP: ccversion=c % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 2 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /gs1-128 dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /gs1-128composite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse gsave options (inkspread) (0) put options (dontdraw) true put % Dummy plot of linear part with CC-A to get width options (linkagea) true put linear << options {} forall >> //gs1-128 exec (sbs) get 0 exch {add} forall /linwidth exch def % Create 2D part and determine type options (lintype) (gs1-128) put options (linwidth) linwidth put comp options //gs1-cc exec /compsym exch def compsym (pixx) get 99 eq {(a)} {(c)} ifelse /linktype exch def % Plot linear part linktype (a) eq { options (linkagea) true put options (linkagec) false put } { options (linkagea) false put options (linkagec) true put } ifelse linear << options {} forall >> //gs1-128 exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def //renlinear exec % Plot the separator mark 1 linsbs {1 index 0 eq {{1}} {{0}} ifelse repeat} forall counttomark 1 sub array astore /sep exch def pop pop 0 linheight rmoveto << /ren //renmatrix /pixs sep /pixx sep length /pixy 1 /height 1 72 div /width sep length 72 div /opt options >> //renmatrix exec % Plot the 2D part linktype (a) eq { /s linwidth 2 sub 11 idiv def /p s 9 sub 2 idiv def /x s p sub 1 sub 11 mul 10 add p 0 eq {2 add} if 99 sub def x 1 rmoveto } { -7 1 rmoveto } ifelse compsym //renmatrix exec grestore end } bind def /gs1-128composite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER gs1-128composite-- postscriptbarcode-2014-03-12/src/gs1-cc.ps000066400000000000000000000545431231007474100200560ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER gs1-cc-- % --REQUIRES preamble raiseerror renmatrix micropdf417 pdf417-- % --DESC: GS1 Composite 2D Component % --EXAM: (01)95012345678903(3103)000123 % --EXOP: ccversion=b cccolumns=4 % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put dup /pdf417 dup /uk.co.terryburton.bwipp findresource put dup /micropdf417 dup /uk.co.terryburton.bwipp findresource put begin /gs1-cc { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /ccversion (a) def /cccolumns -1 def /lintype () def /linwidth -1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /cccolumns cccolumns cvi def /linwidth linwidth cvi def % Select columns based on linear type cccolumns -1 eq { << /ean13 4 /upca 4 /ean8 3 /upce 2 /gs1-128 ccversion (c) ne {4} {linwidth 52 sub 17 idiv} ifelse /databaromni 4 /databarstacked 2 /databarstackedomni 2 /databartruncated 4 /databarlimited 3 /databarexpanded 4 /databarexpandedstacked 4 >> lintype get /cccolumns exch def } if % Expand ordinals of the form ^NNN to ASCII /expand { /in exch def /out in length string def /j 0 def in { % loop (^) search { dup out exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi out exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup out exch j exch putinterval length j add /j exch def out 0 j getinterval exit } ifelse } loop } bind def % Parse out AIs /ais [] def /aival 2 dict def barcode dup length 1 sub 1 exch getinterval { % loop dup () eq {exit} if (\)) search pop exch pop exch (\() search { exch pop exch 3 1 roll } { () 3 1 roll } ifelse [ ais aload pop counttomark 2 add index ] /ais exch def aival 3 1 roll expand put } loop pop % Method selection /isupper {dup 65 ge exch 90 le and} bind def % A-Z /isnum0 {dup 48 ge exch 57 le and} bind def % 0-9 /isnum1 {dup 49 ge exch 57 le and} bind def % 1-9 { % common exit % (10/11/17)... ais length 1 ge { ais 0 get (10) eq ais 0 get (11) eq or ais 0 get (17) eq or { -1 (10) exit } if } if % (90){0-3 digits not starting 0}{upper alpha}... ais length 1 ge { ais 0 get (90) eq { /v aival (90) get def v length 1 ge { v 0 get isupper { 0 (11) exit } if } if v length 2 ge { v 0 get isnum1 v 1 get isupper and { 1 (11) exit } if } if v length 3 ge { v 0 get isnum1 v 1 get isnum0 and v 2 get isupper and { 2 (11) exit } if } if v length 4 ge { v 0 get isnum1 v 1 get isnum0 and v 2 get isnum0 and v 3 get isupper and { 3 (11) exit } if } if } if } if % Freeform -1 (0) exit } loop /method exch def /npre exch def /fnc1 -1 def /lnumeric -2 def /lalphanumeric -3 def /liso646 -4 def /tobin { string dup length 1 sub 0 exch 1 exch {1 index exch 48 put} for dup 3 -1 roll 2 2 index length string cvrs dup length 2 index length exch sub exch putinterval } bind def /alpha << 65 1 90 {dup 65 sub 5 tobin} for 48 1 57 {dup 4 add 6 tobin} for fnc1 (11111) >> def /numeric << 0 1 119 { dup (00) 2 string copy dup 3 -1 roll 11 2 string cvrs dup length 2 exch sub exch putinterval dup 0 get 65 eq {dup 0 94 put} if dup 1 get 65 eq {dup 1 94 put} if exch 8 add (0000000) 7 string copy dup 3 -1 roll 2 7 string cvrs dup length 7 exch sub exch putinterval } for lalphanumeric (0000) >> def /alphanumeric << 48 1 57 {dup 43 sub 5 tobin} for fnc1 (01111) 65 1 90 {dup 33 sub 6 tobin} for 42 (111010) 44 1 47 {dup 15 add 6 tobin} for lnumeric (000) liso646 (00100) >> def /iso646 << 48 1 57 {dup 43 sub 5 tobin} for fnc1 (01111) 65 1 90 {dup 1 sub 7 tobin} for 97 1 122 {dup 7 sub 7 tobin} for 33 (11101000) 34 (11101001) 37 1 47 {dup 197 add 8 tobin} for 58 1 63 {dup 187 add 8 tobin} for 95 (11111011) 32 (11111100) lnumeric (000) lalphanumeric (00100) >> def method (10) eq { % TODO: fixme ais 0 get (11) eq ais 0 get (17) eq or { aival ais 0 get get dup 0 2 getinterval cvi 384 mul exch dup 2 2 getinterval cvi 1 sub 32 mul exch 4 2 getinterval cvi add add (0000000000000000) 16 string copy dup 3 -1 roll 2 16 string cvrs dup length 16 exch sub exch putinterval [ 1 0 4 -1 roll {48 sub} forall ais 0 get (11) eq {0} {1} ifelse ] /cdf exch def /ais ais 1 ais length 1 sub getinterval def } { /cdf [ 1 0 1 1 ] def } ifelse ais length 0 ne { ais 0 get (10) eq { /gpf [ aival (10) get {} forall ] def ais length 1 gt {/gpf [ gpf aload pop fnc1 ] def} if % TODO: check /ais ais 1 ais length 1 sub getinterval def } { /gpf [fnc1] def % TODO: check } ifelse } { /cdf [ cdf aload pop 0 0 0 0 0 1 1 1 1 ] def /gpf [] def } ifelse /mode (numeric) def } if method (11) eq { /cdf [ 1 1 ] def /ai90 aival (90) get def npre 1 add ai90 length ne { ai90 npre 1 add ai90 length npre sub 1 sub getinterval } { () } ifelse /ai90rem exch def /nalpha 0 ai90rem {dup 65 ge exch 90 le and {1 add} if} forall def /nnums 0 ai90rem {dup 48 ge exch 57 le and {1 add} if} forall def /mode nalpha nnums gt {(alpha)} {(numeric)} ifelse def nalpha nnums add ai90rem length ne {/mode (alphanumeric) def} if /cdf [ cdf aload pop mode (alphanumeric) eq {0} if mode (numeric) eq {1 0} if mode (alpha) eq {1 1} if ] def /ais1 ais length 1 gt {ais 1 get} {-1} ifelse def ais1 (21) eq ais1 (8004) eq or { /cdf [ cdf aload pop ais1 (21) eq {1 0} {1 1} ifelse ] def } { /cdf [ cdf aload pop 0 ] def } ifelse /nval npre 0 ne {ai90 0 npre getinterval cvi} {0} ifelse def (BDHIJKLNPQRSTVXZ) ai90 npre 1 getinterval search { length exch pop exch pop /aval exch def } { pop /aval -1 def } ifelse nval 31 lt aval -1 ne and { (00000) 5 string copy dup nval 2 5 string cvrs dup length 5 exch sub exch putinterval [ exch {48 sub} forall ] /nbits exch def (0000) 4 string copy dup aval 2 4 string cvrs dup length 4 exch sub exch putinterval [ exch {48 sub} forall ] /abits exch def /cdf [ cdf aload pop nbits aload pop abits aload pop ] def } { (0000000000) 10 string copy dup nval 2 10 string cvrs dup length 10 exch sub exch putinterval [ exch {48 sub} forall ] /nbits exch def (00000) 5 string copy dup ai90 npre get 65 sub 2 5 string cvrs dup length 5 exch sub exch putinterval [ exch {48 sub} forall ] /abits exch def /cdf [ cdf aload pop 1 1 1 1 1 nbits aload pop abits aload pop ] def } ifelse mode (numeric) eq { /gpf [ ai90rem {} forall ais length 1 gt {fnc1} if ] def } { /encs mode (alpha) eq {alpha} {alphanumeric} ifelse def /in [ ai90rem {} forall ais length 1 gt {fnc1} if ] def /out in length 6 mul array def /j 0 def 0 1 in length 1 sub { in exch get encs exch get dup [ exch {48 sub} forall ] out exch j exch putinterval length j add /j exch def } for /cdf [ cdf aload pop out 0 j getinterval aload pop ] def /gpf [] def ais length 1 gt mode (alpha) ne or {/mode (numeric) def} if } ifelse /ais ais 1 ais length 1 sub getinterval def ais length 0 ne { ais1 (21) eq ais1 (8004) eq or { /gpf [ gpf aload pop aival ais1 get {} forall ] def /ais ais 1 ais length 1 sub getinterval def ais length 0 ne {/gpf [gpf aload pop fnc1] def} if } if } if } if method (0) eq { /cdf [ 0 ] def /gpf [] def /mode (numeric) def } if % Pre-defined fixed length data field AIs % any AI whose prefix is not included in this table must be % terminated with "FNC1", even if it's fixed length /aifixed 23 dict def [ 0 1 4 {} for ] { (00) 2 string copy dup dup 1 5 -1 roll 48 add put aifixed 3 1 roll put } forall [ 11 1 20 {} for 23 31 1 36 {} for 41 ] { 10 2 string cvrs dup aifixed 3 1 roll put } forall % Append the remaining AI data 0 1 ais length 1 sub { /i exch def /ai ais i get def /val aival ai get def gpf length ai length add val length add array dup 0 gpf putinterval dup gpf length ai [ exch {} forall ] putinterval dup gpf length ai length add val [ exch {} forall ] putinterval /gpf exch def i ais length 1 sub ne aifixed ai 0 2 getinterval known not and { % Append FNC1 gpf length 1 add array dup 0 gpf putinterval dup gpf length fnc1 put /gpf exch def } if } for % Calculate the number of bits remaining to the next valid symbol size /rembits { /used exch def ccversion (c) ne { % cc-a or cc-b << /a [ [167 138 118 108 88 78 59] [167 138 118 98 78] [197 167 138 108 78] ] /b [ [ 336 296 256 208 160 104 56] [ 768 648 536 416 304 208 152 112 72 32] [1184 1016 840 672 496 352 264 208 152 96 56] ] >> ccversion get cccolumns 2 sub get /bitcaps exch def -1 bitcaps {dup used ge {exch} if pop} forall dup -1 ne {used sub} if } { << /c -1 >> ccversion get pop % Assert cc-c /m used 8 div ceiling cvi dup 6 idiv 5 mul exch 6 mod add def m 40 le {8 } if m 41 ge m 160 le and {16} if m 161 ge m 320 le and {32} if m 321 ge {64} if /eccws exch def /m m eccws add 3 add def /c linwidth 52 sub 17 idiv def m c idiv 90 gt {/c c 1 add def} if /r m c div ceiling cvi def /tgt c r mul eccws sub 3 sub dup 5 idiv 6 mul exch 5 mod add 8 mul def used 8296 le {tgt used sub} {-1} ifelse } ifelse dup -1 eq { % Upgrade CC-A to CC-B or CC-B to CC-C to fit pop ccversion (a) eq { /ccversion (b) def } { ccversion (b) eq lintype (gs1-128) eq and { /ccversion (c) def /cccolumns linwidth 52 sub 17 idiv def } { /ccversion -1 def } ifelse } ifelse used rembits } if } bind def /encode { dup /raw ne {exch get} {pop} ifelse [ exch {48 sub} forall ] dup length exch gpfenc exch j exch putinterval /j exch j add def } bind def % Pre-compute alphanumeric and numeric runlengths and position of next ISO646-only characters /numericruns [ gpf length {0} repeat 0 -1 ] def /alphanumericruns [ gpf length {0} repeat 0 ] def /nextiso646only [ gpf length {0} repeat 9999 ] def gpf length 1 sub -1 0 { /i exch def gpf i get (00) 2 string copy dup 0 gpf i get dup fnc1 eq {pop 94} if put i gpf length 1 sub lt {dup 1 gpf i 1 add get dup fnc1 eq {pop 94} if put} if numeric exch known { numericruns i numericruns i 2 add get 2 add put } { numericruns i 0 put } ifelse dup alphanumeric exch known { alphanumericruns i alphanumericruns i 1 add get 1 add put } { alphanumericruns i 0 put } ifelse dup iso646 exch known exch alphanumeric exch known not and { nextiso646only i 0 put } { nextiso646only i nextiso646only i 1 add get 1 add put } ifelse } for % Encode the general purpose field /gpfenc 8296 array def /i 0 def /j 0 def { % loop i gpf length eq {exit} if { % not a loop but common exit point mode (numeric) eq { i gpf length 2 sub le { 2 string dup 0 gpf i get dup fnc1 eq {pop 94} if put dup 1 gpf i 1 add get dup fnc1 eq {pop 94} if put dup numeric exch known { numeric encode /i i 2 add def exit } if pop lalphanumeric numeric encode /mode (alphanumeric) def exit } { gpf i get dup 48 lt exch 57 gt or { lalphanumeric numeric encode /mode (alphanumeric) def exit } if /rem cdf length j add rembits def rem 4 ge rem 6 le and { % C1 + 1 into 4 to 6 bits (000000) 6 string copy 0 rem getinterval dup gpf i get 47 sub 2 4 string cvrs dup length 4 exch sub exch putinterval /raw encode /i i 1 add def exit } { % C1.FNC1 2 string dup 0 gpf i get put dup 1 94 put numeric encode /i i 1 add def exit } ifelse } ifelse } if mode (alphanumeric) eq { gpf i get fnc1 eq { fnc1 alphanumeric encode /mode (numeric) def /i i 1 add def exit } if gpf i get dup iso646 exch known exch alphanumeric exch known not and { liso646 alphanumeric encode /mode (iso646) def exit } if numericruns i get 6 ge { lnumeric alphanumeric encode /mode (numeric) def exit } if numericruns i get dup 4 ge exch i add gpf length eq and { lnumeric alphanumeric encode /mode (numeric) def exit } if gpf i get alphanumeric encode /i i 1 add def exit } if mode (iso646) eq { gpf i get fnc1 eq { fnc1 iso646 encode /mode (numeric) def /i i 1 add def exit } if numericruns i get 4 ge nextiso646only i get 10 ge and { lnumeric iso646 encode /mode (numeric) def exit } if alphanumericruns i get 5 ge nextiso646only i get 10 ge and { lalphanumeric iso646 encode /mode (alphanumeric) def exit } if gpf i get iso646 encode /i i 1 add def exit } if } loop } loop /gpf gpfenc 0 j getinterval def % Create pad /pad cdf length gpf length add rembits array def pad length 0 gt { 0 5 pad length 1 sub { % Fill with 00100 /i exch def pad i [ 0 0 1 0 0 ] 0 pad length i sub 5 2 copy gt {exch} if pop getinterval putinterval } for mode (numeric) eq { % Prefix shift from numeric to ASCII /pad [ 0 0 0 0 pad aload pop ] 0 pad length getinterval def } if mode (alpha) eq { % Prefix FNC1 /pad [ 1 1 1 1 1 pad aload pop ] 0 pad length getinterval def } if } if % Concatinate fields /bits [ cdf aload pop gpf aload pop pad aload pop ] def ccversion (a) eq { /pwr928 [ [ 0 0 0 0 0 0 1 ] 68 {7 array} repeat ] def 1 1 68 { /j exch def /v 0 def 6 -1 1 { /i exch def /v pwr928 j 1 sub get i get 2 mul v 928 idiv add def pwr928 j get i v 928 mod put } for pwr928 j get 0 pwr928 j 1 sub get 0 get 2 mul v 928 idiv add put } for /cws [ 28 {0} repeat ] def /b 0 def /c 0 def { % loop b bits length eq {exit} if /bs bits b 69 bits length b sub 2 copy gt {exch} if pop getinterval def /bsl bs length def /cs cws c bsl 10 idiv 1 add getinterval def /csl cs length def 0 1 bsl 1 sub { /i exch def 0 1 csl 1 sub { /j exch def cs j 2 copy get pwr928 i get j 7 add csl sub get bs bsl i sub 1 sub get mul add put } for } for csl 1 sub -1 1 { /i exch def cs i 1 sub 2 copy get cs i get 928 idiv add put cs i 2 copy get 928 mod put } for /b b bsl add def /c c csl add def } loop /cws cws 0 c getinterval def /barcode cws length 4 mul string def 0 1 cws length 1 sub { /i exch def (^ ) 4 string copy dup cws i get 10 4 string cvrs dup length 4 exch sub exch putinterval barcode i 4 mul 3 -1 roll putinterval } for options (dontdraw) true put options (cca) true put options (columns) cccolumns put /args barcode options //micropdf417 exec def } if ccversion (b) eq { /barcode bits length 8 idiv string def 0 1 barcode length 1 sub { /i exch def bits i 8 mul 8 getinterval 0 exch {add 2 mul} forall 2 idiv barcode exch i exch put } for options (dontdraw) true put options (ccb) true put options (columns) cccolumns put /args barcode options //micropdf417 exec def } if ccversion (c) eq { /barcode bits length 8 idiv string def 0 1 barcode length 1 sub { /i exch def bits i 8 mul 8 getinterval 0 exch {add 2 mul} forall 2 idiv barcode exch i exch put } for options (dontdraw) true put options (ccc) true put options (columns) cccolumns put /args barcode options //pdf417 exec def } if args dontdraw not //renmatrix if end } bind def /gs1-cc dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER gs1-cc-- postscriptbarcode-2014-03-12/src/gs1datamatrix.ps000066400000000000000000000121351231007474100215410ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER gs1datamatrix-- % --REQUIRES preamble raiseerror renmatrix datamatrix-- % --DESC: GS1 Data Matrix % --EXAM: (01)03453120000011(17)120508(10)ABCD1234(410)9501101020917 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put dup /datamatrix dup /uk.co.terryburton.bwipp findresource put begin /gs1datamatrix { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Expand ordinals of the form ^NNN to ASCII /expand { /in exch def /out in length string def /j 0 def in { % loop (^) search { dup out exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi out exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup out exch j exch putinterval length j add /j exch def out 0 j getinterval exit } ifelse } loop } bind def % Parse out AIs /ais [] def /aival 2 dict def barcode dup length 1 sub 1 exch getinterval { % loop dup () eq {exit} if (\)) search pop exch pop exch (\() search { exch pop exch 3 1 roll } { () 3 1 roll } ifelse [ ais aload pop counttomark 2 add index ] /ais exch def aival 3 1 roll expand put } loop pop % Pre-defined fixed length data field AIs % any AI whose prefix is not included in this table must be % terminated with "FNC1", even if it's fixed length /aifixed 23 dict def [ 0 1 4 {} for ] { (00) 2 string copy dup dup 1 5 -1 roll 48 add put aifixed 3 1 roll put } forall [ 11 1 20 {} for 23 31 1 36 {} for 41 ] { 10 2 string cvrs dup aifixed 3 1 roll put } forall % Create the datamatrix data /fnc1 -1 def /dmtx [ fnc1 ] def 0 1 ais length 1 sub { /i exch def /ai ais i get def /val aival ai get def dmtx length ai length add val length add array dup 0 dmtx putinterval dup dmtx length ai [ exch {} forall ] putinterval dup dmtx length ai length add val [ exch {} forall ] putinterval /dmtx exch def i ais length 1 sub ne aifixed ai 0 2 getinterval known not and { % Append FNC1 dmtx length 1 add array dup 0 dmtx putinterval dup dmtx length fnc1 put /dmtx exch def } if } for % Compose input to datamatrix /barcode dmtx length 1 add 5 mul string def /i 0 def /j 0 def { i dmtx length eq {exit} if dmtx i get dup fnc1 eq { pop barcode j (^FNC1) putinterval /j j 4 add def } { barcode exch j exch put } ifelse /i i 1 add def /j j 1 add def } loop /barcode barcode 0 j getinterval def % Get the result of encoding with code128 options (dontdraw) true put options (parsefnc) true put /args barcode options //datamatrix exec def args (opt) options put args dontdraw not //renmatrix if end } bind def /gs1datamatrix dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER gs1datamatrix-- postscriptbarcode-2014-03-12/src/gs1qrcode.ps000066400000000000000000000117671231007474100206720ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER gs1qrcode-- % --REQUIRES preamble raiseerror renmatrix qrcode-- % --DESC: GS1 QR Code % --EXAM: (01)03453120000011(8200)http://www.abc.net(10)ABCD1234(410)9501101020917 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /renmatrix dup /uk.co.terryburton.bwipp findresource put dup /qrcode dup /uk.co.terryburton.bwipp findresource put begin /gs1qrcode { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Expand ordinals of the form ^NNN to ASCII /expand { /in exch def /out in length string def /j 0 def in { % loop (^) search { dup out exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi out exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup out exch j exch putinterval length j add /j exch def out 0 j getinterval exit } ifelse } loop } bind def % Parse out AIs /ais [] def /aival 2 dict def barcode dup length 1 sub 1 exch getinterval { % loop dup () eq {exit} if (\)) search pop exch pop exch (\() search { exch pop exch 3 1 roll } { () 3 1 roll } ifelse [ ais aload pop counttomark 2 add index ] /ais exch def aival 3 1 roll expand put } loop pop % Pre-defined fixed length data field AIs % any AI whose prefix is not included in this table must be % terminated with "FNC1", even if it's fixed length /aifixed 23 dict def [ 0 1 4 {} for ] { (00) 2 string copy dup dup 1 5 -1 roll 48 add put aifixed 3 1 roll put } forall [ 11 1 20 {} for 23 31 1 36 {} for 41 ] { 10 2 string cvrs dup aifixed 3 1 roll put } forall % Create the qrcode data /fnc1 -1 def /qrc [ fnc1 ] def 0 1 ais length 1 sub { /i exch def /ai ais i get def /val aival ai get def qrc length ai length add val length add array dup 0 qrc putinterval dup qrc length ai [ exch {} forall ] putinterval dup qrc length ai length add val [ exch {} forall ] putinterval /qrc exch def i ais length 1 sub ne aifixed ai 0 2 getinterval known not and { % Append FNC1 qrc length 1 add array dup 0 qrc putinterval dup qrc length fnc1 put /qrc exch def } if } for % Compose input to qrcode /barcode qrc length 1 add 5 mul string def /i 0 def /j 0 def { i qrc length eq {exit} if qrc i get dup fnc1 eq { pop barcode j (^FNC1) putinterval /j j 4 add def } { barcode exch j exch put } ifelse /i i 1 add def /j j 1 add def } loop /barcode barcode 0 j getinterval def % Get the result of encoding with qrcode options (dontdraw) true put options (parsefnc) true put /args barcode options //qrcode exec def args (opt) options put args dontdraw not //renmatrix if end } bind def /gs1qrcode dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER gs1qrcode-- postscriptbarcode-2014-03-12/src/hibccodablockf.ps000066400000000000000000000073041231007474100217070ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER hibccodablockf-- % --REQUIRES preamble raiseerror renmatrix codablockf-- % --DESC: HIBC Codablock F % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put dup /codablockf dup /uk.co.terryburton.bwipp findresource put begin /hibccodablockf { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /validatecheck false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%) def /charvals 43 dict def 0 1 42 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.codablockfBadCharacter (HIBC Codablock F must contain only digits, capital letters, spaces and the symbols -.$/+%) //raiseerror exec } if } for /barlen barcode length validatecheck {1 sub} if def /checksum 41 def 0 1 barlen 1 sub { barcode exch 1 getinterval charvals exch get checksum add /checksum exch def } for /checksum checksum 43 mod def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.hibccodablockfBadCheckDigit (Incorrect HIBC Codablock F check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def } if /barcode barlen 2 add string dup 1 barcode putinterval def barcode 0 43 put barcode barlen 1 add barchars checksum get put % Get the result of encoding with codablockf options (dontdraw) true put options (validatecheck) false put /args barcode options //codablockf exec def args (opt) options put args dontdraw not //renmatrix if end } bind def /hibccodablockf dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER hibccodablockf-- postscriptbarcode-2014-03-12/src/hibccode128.ps000066400000000000000000000102741231007474100207650ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER hibccode128-- % --REQUIRES preamble raiseerror renlinear code128-- % --DESC: HIBC Code 128 % --EXAM: A123BJC5D6E71 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /code128 dup /uk.co.terryburton.bwipp findresource put begin /hibccode128 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /textxoffset 0 def /validatecheck false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /textxoffset textxoffset cvr def % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%) def /charvals 43 dict def 0 1 42 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.hibccode128badCharacter (HIBC Code 128 must contain only digits, capital letters, spaces and the symbols -.$/+%) //raiseerror exec } if } for /barlen barcode length validatecheck {1 sub} if def /checksum 41 def 0 1 barlen 1 sub { barcode exch 1 getinterval charvals exch get checksum add /checksum exch def } for /checksum checksum 43 mod def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.hibccode128badCheckDigit (Incorrect HIBC Code 128 check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def } if /barcode barlen 2 add string dup 1 barcode putinterval def barcode 0 43 put barcode barlen 1 add barchars checksum get put /text barlen 4 add string def text 0 42 put text 1 barcode putinterval text barlen 2 add barcode barlen 1 add get dup 32 eq {pop 95} if put text barlen 3 add 42 put % Get the result of encoding with code128 options (dontdraw) true put options (validatecheck) false put /args barcode options //code128 exec def args (txt) [ [text textxoffset textyoffset textfont textsize] ] put args (textxalign) (center) put args (opt) options put args dontdraw not //renlinear if end } bind def /hibccode128 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER hibccode128-- postscriptbarcode-2014-03-12/src/hibccode39.ps000066400000000000000000000103241231007474100207020ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER hibccode39-- % --REQUIRES preamble raiseerror renlinear code39-- % --DESC: HIBC Code 39 % --EXAM: A123BJC5D6E71 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /code39 dup /uk.co.terryburton.bwipp findresource put begin /hibccode39 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /textxoffset 0 def /validatecheck false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /textxoffset textxoffset cvr def % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%) def /charvals 43 dict def 0 1 42 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.hibccode39badCharacter (HIBC Code 39 must contain only digits, capital letters, spaces and the symbols -.$/+%) //raiseerror exec } if } for /barlen barcode length validatecheck {1 sub} if def /checksum 41 def 0 1 barlen 1 sub { barcode exch 1 getinterval charvals exch get checksum add /checksum exch def } for /checksum checksum 43 mod def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.hibccode39badCheckDigit (Incorrect HIBC Code 39 check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def } if /barcode barlen 2 add string dup 1 barcode putinterval def barcode 0 43 put barcode barlen 1 add barchars checksum get put /text barlen 4 add string def text 0 42 put text 1 barcode putinterval text barlen 2 add barcode barlen 1 add get dup 32 eq {pop 95} if put text barlen 3 add 42 put % Get the result of encoding with code39 options (dontdraw) true put options (includecheck) false put options (validatecheck) false put /args barcode options //code39 exec def args (txt) [ [text textxoffset textyoffset textfont textsize] ] put args (textxalign) (center) put args (opt) options put args dontdraw not //renlinear if end } bind def /hibccode39 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER hibccode39-- postscriptbarcode-2014-03-12/src/hibcdatamatrix.ps000066400000000000000000000073101231007474100217530ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER hibcdatamatrix-- % --REQUIRES preamble raiseerror renmatrix datamatrix-- % --DESC: HIBC Data Matrix % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put dup /datamatrix dup /uk.co.terryburton.bwipp findresource put begin /hibcdatamatrix { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /validatecheck false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%) def /charvals 43 dict def 0 1 42 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.hibcdatamatrixBadCharacter (HIBC Data Matrix must contain only digits, capital letters, spaces and the symbols -.$/+%) //raiseerror exec } if } for /barlen barcode length validatecheck {1 sub} if def /checksum 41 def 0 1 barlen 1 sub { barcode exch 1 getinterval charvals exch get checksum add /checksum exch def } for /checksum checksum 43 mod def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.hibcdatamatrixBadCheckDigit (Incorrect HIBC Data Matrix check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def } if /barcode barlen 2 add string dup 1 barcode putinterval def barcode 0 43 put barcode barlen 1 add barchars checksum get put % Get the result of encoding with datamatrix options (dontdraw) true put options (validatecheck) false put /args barcode options //datamatrix exec def args (opt) options put args dontdraw not //renmatrix if end } bind def /hibcdatamatrix dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER hibcdatamatrix-- postscriptbarcode-2014-03-12/src/hibcmicropdf417.ps000066400000000000000000000074451231007474100216650ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER hibcmicropdf417-- % --REQUIRES preamble raiseerror renmatrix micropdf417-- % --DESC: HIBC MicroPDF417 % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put dup /micropdf417 dup /uk.co.terryburton.bwipp findresource put begin /hibcmicropdf417 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /columns 2 def /validatecheck false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /columns columns cvi def % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%) def /charvals 43 dict def 0 1 42 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.hibcmicropdf417BadCharacter (HIBC MicroPDF417 must contain only digits, capital letters, spaces and the symbols -.$/+%) //raiseerror exec } if } for /barlen barcode length validatecheck {1 sub} if def /checksum 41 def 0 1 barlen 1 sub { barcode exch 1 getinterval charvals exch get checksum add /checksum exch def } for /checksum checksum 43 mod def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.hibcmicropdf417BadCheckDigit (Incorrect HIBC MicroPDF417 check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def } if /barcode barlen 2 add string dup 1 barcode putinterval def barcode 0 43 put barcode barlen 1 add barchars checksum get put % Get the result of encoding with micropdf417 options (dontdraw) true put options (columns) columns put options (validatecheck) false put /args barcode options //micropdf417 exec def args (opt) options put args dontdraw not //renmatrix if end } bind def /hibcmicropdf417 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER hibcmicropdf417-- postscriptbarcode-2014-03-12/src/hibcpdf417.ps000066400000000000000000000073441231007474100206310ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER hibcpdf417-- % --REQUIRES preamble raiseerror renmatrix pdf417-- % --DESC: HIBC PDF417 % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put dup /pdf417 dup /uk.co.terryburton.bwipp findresource put begin /hibcpdf417 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /columns 2 def /validatecheck false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /columns columns cvi def % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%) def /charvals 43 dict def 0 1 42 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.hibcpdf417BadCharacter (HIBC PDF417 must contain only digits, capital letters, spaces and the symbols -.$/+%) //raiseerror exec } if } for /barlen barcode length validatecheck {1 sub} if def /checksum 41 def 0 1 barlen 1 sub { barcode exch 1 getinterval charvals exch get checksum add /checksum exch def } for /checksum checksum 43 mod def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.hibcpdf417BadCheckDigit (Incorrect HIBC PDF417 check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def } if /barcode barlen 2 add string dup 1 barcode putinterval def barcode 0 43 put barcode barlen 1 add barchars checksum get put % Get the result of encoding with pdf417 options (dontdraw) true put options (columns) columns put options (validatecheck) false put /args barcode options //pdf417 exec def args (opt) options put args dontdraw not //renmatrix if end } bind def /hibcpdf417 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER hibcpdf417-- postscriptbarcode-2014-03-12/src/hibcqrcode.ps000066400000000000000000000072241231007474100210760ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER hibcqrcode-- % --REQUIRES preamble raiseerror renmatrix qrcode-- % --DESC: HIBC QR Code % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put dup /qrcode dup /uk.co.terryburton.bwipp findresource put begin /hibcqrcode { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /validatecheck false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%) def /charvals 43 dict def 0 1 42 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.hibcqrcodeBadCharacter (HIBC QR Code must contain only digits, capital letters, spaces and the symbols -.$/+%) //raiseerror exec } if } for /barlen barcode length validatecheck {1 sub} if def /checksum 41 def 0 1 barlen 1 sub { barcode exch 1 getinterval charvals exch get checksum add /checksum exch def } for /checksum checksum 43 mod def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.hibcqrcodeBadCheckDigit (Incorrect HIBC QR Code check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def } if /barcode barlen 2 add string dup 1 barcode putinterval def barcode 0 43 put barcode barlen 1 add barchars checksum get put % Get the result of encoding with qrcode options (dontdraw) true put options (validatecheck) false put /args barcode options //qrcode exec def args (opt) options put args dontdraw not //renmatrix if end } bind def /hibcqrcode dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER hibcqrcode-- postscriptbarcode-2014-03-12/src/identcode.ps000066400000000000000000000103401231007474100207220ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER identcode-- % --REQUIRES preamble raiseerror renlinear interleaved2of5-- % --DESC: Deutsche Post Identcode % --EXAM: 563102430313 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /interleaved2of5 dup /uk.co.terryburton.bwipp findresource put begin /identcode { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textxoffset 0 def /textyoffset -7 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /height height cvr def % Validate the input barcode length 11 ne barcode length 12 ne and { /bwipp.identcodeBadLength (Deutsche Post Identcode must be 11 or 12 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.identcodeBadCharacter (Deutsche Post Identcode must contain only digits) //raiseerror exec } if } forall % Calculate checksum and add to end of barcode /checksum 0 def 0 1 10 { /i exch def /checksum checksum barcode i get 48 sub i 2 mod 0 eq {4 mul} {9 mul} ifelse add def } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 12 eq { barcode 11 get checksum 48 add ne { /bwipp.identcodeBadCheckDigit (Incorrect Deutsche Post Identcode check digit provided) //raiseerror exec } if } if 12 string dup 0 barcode putinterval dup 11 checksum 48 add put /barcode exch def % Compose the human readable text /text ( . . ) 16 string copy def text 0 barcode 0 2 getinterval putinterval text 3 barcode 2 3 getinterval putinterval text 7 barcode 5 3 getinterval putinterval text 11 barcode 8 3 getinterval putinterval text 15 barcode 11 1 getinterval putinterval % Get the result of encoding with interleaved2of5 options (dontdraw) true put options (includecheck) false put /args barcode options //interleaved2of5 exec def args (txt) [ [text textxoffset textyoffset textfont textsize] ] put args (textxalign) (center) put args (opt) options put args dontdraw not //renlinear if end } bind def /identcode dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER identcode-- postscriptbarcode-2014-03-12/src/interleaved2of5.ps000066400000000000000000000147761231007474100220030ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER interleaved2of5-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Interleaved 2 of 5 (ITF) % --EXAM: 2401234567 % --EXOP: height=0.5 includecheck includetext includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /interleaved2of5 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includecheck false def % Enable/disable checkdigit /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Validate the input barcode { dup 48 lt exch 57 gt or { /bwipp.interleaved2of5badCharacter (Interleaved 2 of 5 must contain only digits) //raiseerror exec } if } forall /barlen barcode length def % Length of the code % Prefix 0 to barcode if length is even and including checkdigit % or length is odd and not including checkdigit barlen 2 mod 0 eq includecheck and % even & includecheck barlen 2 mod 0 ne includecheck not and or { % odd & !includecheck /pad barlen 1 add string def % Create pad one bigger than barcode pad 0 48 put % Put ascii 0 at start of pad pad 1 barcode putinterval % Add barcode to the end of pad /barcode pad def % barcode=pad /barlen barlen 1 add def % barlen++ } if % Add checksum to end of barcode includecheck { /checksum 0 def 0 1 barlen 1 sub { /i exch def i 2 mod 0 eq { /checksum checksum barcode i get 48 sub 3 mul add def } { /checksum checksum barcode i get 48 sub add def } ifelse } for /checksum 10 checksum 10 mod sub 10 mod def /pad barlen 1 add string def % Create pad one bigger than barcode pad 0 barcode putinterval % Add barcode to the start of pad pad barlen checksum 48 add put % Add checksum to end of pad /barcode pad def % barcode=pad /barlen barlen 1 add def % barlen++ } if % Create an array containing the character mappings /encs [ (11221) (21112) (12112) (22111) (11212) (21211) (12211) (11122) (21121) (12121) (1111) (2111) ] def % Create a string of the available characters /barchars (0123456789) def /sbs barlen 5 mul 8 add string def /txt barlen array def % Put the start character sbs 0 encs 10 get putinterval 0 2 barlen 1 sub { /i exch def % Lookup the encodings for two consecutive barcode characters barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enca encs indx get def % Get the indxth encoding barcode i 1 add 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /encb encs indx get def % Get the indxth encoding % Interleave the two character encodings /intl enca length 2 mul string def 0 1 enca length 1 sub { /j exch def /achar enca j get def /bchar encb j get def intl j 2 mul achar put intl j 2 mul 1 add bchar put } for sbs i 5 mul 4 add intl putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 9 mul 4 add textyoffset textfont textsize] put includecheck includecheckintext not and barlen 2 sub i eq and { txt i 1 add [( ) i 1 add 9 mul 4 add textyoffset textfont textsize] put } { txt i 1 add [barcode i 1 add 1 getinterval i 1 add 9 mul 4 add textyoffset textfont textsize] put } ifelse } for % Put the end character sbs barlen 5 mul 4 add encs 11 get putinterval % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] includetext { /txt txt } if /barratio 2 /spaceratio 2 /opt options >> dontdraw not //renlinear if end } bind def /interleaved2of5 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER interleaved2of5-- postscriptbarcode-2014-03-12/src/isbn.ps000066400000000000000000000235351231007474100177310ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER isbn-- % --REQUIRES preamble raiseerror renlinear ean5 ean2 ean13-- % --DESC: ISBN % --EXAM: 978-1-56581-231-4 52250 % --EXOP: includetext guardwhitespace % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /ean13 dup /uk.co.terryburton.bwipp findresource put begin /isbn { 20 dict begin /options exch def % We are given an options string /barcode exch def % We are given the isbn text with dashes /dontdraw false def /includetext false def % Enable/disable ISBN text /isbntextfont /Courier def /isbntextsize 9 def /isbntextxoffset (unset) def /isbntextyoffset (unset) def /height 1 def /addongap 12 def /legacy false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /isbntextfont isbntextfont cvlit def /isbntextsize isbntextsize cvr def isbntextxoffset (unset) ne {/isbntextxoffset isbntextxoffset cvr def} if isbntextyoffset (unset) ne {/isbntextyoffset isbntextyoffset cvr def} if /height height cvr def /addongap addongap cvr def % Split off the addon barcode ( ) search { /barcode exch def pop /addon exch def } { pop /addon () def } ifelse % Validate the input barcode length 15 ne barcode length 17 ne and barcode length 11 ne barcode length 13 ne and and { /bwipp.isbnBadLength (ISBN-13 must be 15 or 17 characters including dashes. ISBN-10 must be 11 or 13 characters including dashes) //raiseerror exec } if addon length 0 ne addon length 2 ne and addon length 5 ne and { /bwipp.isbnBadAddOnLength (Add-on for ISBN must be 2 or 5 digits) //raiseerror exec } if barcode length 15 ge { % ISBN-13 barcode 0 4 getinterval dup (978-) ne exch (979-) ne and { /bwipp.isbn13badPrefix (ISBN-13 prefix must be 978- or 979-) //raiseerror exec } if /wasdash false def /numdash 0 def /numdigit 0 def barcode 5 9 getinterval { dup 45 eq { wasdash { /bwipp.isbn13adjacentDashes (ISBN-13 does not permit adjacent dashes) //raiseerror exec } if /wasdash true def /numdash numdash 1 add def } if dup 48 ge exch 57 le and { /wasdash false def /numdigit numdigit 1 add def } if } forall numdash 2 ne numdigit 7 ne or { /bwipp.isbn13numDashesDigits (Incorrect number of dashes and digits for ISBN-13) //raiseerror exec } if barcode 14 get dup 48 lt exch 57 gt or { /bwipp.isbn13character15 (ISBN-13 character 15 must be a digit) //raiseerror exec } if barcode length 17 eq { barcode 15 1 getinterval (-) ne { /bwipp.isbn13character16 (ISBN-13 penultimate character must be a dash) //raiseerror exec } if barcode 16 get dup 48 lt exch 57 gt or { /bwipp.isbn13character17 (ISBN-13 final character must be a digit) //raiseerror exec } if } if } { % ISBN-10 barcode 0 get dup 48 lt exch 57 gt or { /bwipp.isbn10FirstDigit (ISBN-10 first character must be a digit) //raiseerror exec } if /wasdash false def /numdash 0 def /numdigit 0 def barcode 1 9 getinterval { dup 45 eq { wasdash { /bwipp.isbn10adjacentDashes (ISBN-10 does not permit adjacent dashes) //raiseerror exec } if /wasdash true def /numdash numdash 1 add def } if dup 48 ge exch 57 le and { /wasdash false def /numdigit numdigit 1 add def } if } forall numdash 2 ne numdigit 7 ne or { /bwipp.isbn10numDashesDigits (Incorrect number of dashes and digits for ISBN-10) //raiseerror exec } if barcode 10 get dup 48 lt exch 57 gt or { /bwipp.isbn10character11 (ISBN-10 character 11 must be a digit) //raiseerror exec } if barcode length 13 eq { barcode 11 1 getinterval (-) ne { /bwipp.isbn10character12 (ISBN-10 penultimate character must be a dash) //raiseerror exec } if barcode 12 get dup dup 48 lt exch 57 gt or exch 88 ne and { /bwipp.isbn10character13 (ISBN-10 final character must be a digit or X) //raiseerror exec } if } if } ifelse /isbntxt barcode def % Read the digits from isbntxt and validate checksum for ISBN-10 isbntxt length 13 le { /isbn 10 string def /checksum 0 def /i 0 def /n 0 def { % loop /isbnchar isbntxt i get 48 sub def isbnchar -3 ne { % Ignore dashes isbn n isbnchar 48 add put n 9 lt { /checksum checksum 10 n sub isbnchar mul add def } if /n n 1 add def } if /i i 1 add def i isbntxt length eq {exit} if } loop /checksum 11 checksum 11 mod sub 11 mod dup 10 eq {pop 40} if 48 add def /isbn isbn 0 9 getinterval def isbntxt length 13 eq { isbntxt 12 get checksum ne { /bwipp.isbn10badCheckDigit (Incorrect ISBN-10 check digit provided) //raiseerror exec } if } if } if legacy not isbntxt length 15 ge or { % Convert ISBN-10 to ISBN-13 isbntxt length 13 le { /pad 15 string def pad 0 (978-) putinterval pad 4 isbntxt 0 11 getinterval putinterval /isbntxt pad def } if % Read the digits from isbntxt and validate checksum for ISBN-13 /isbn 13 string def /checksum 0 def /i 0 def /n 0 def { % loop /isbnchar isbntxt i get 48 sub def isbnchar -3 ne { % Ignore dashes isbn n isbnchar 48 add put n 12 lt { /checksum isbnchar n 2 mod 0 ne {3 mul} if checksum add def } if /n n 1 add def } if /i i 1 add def i isbntxt length eq {exit} if } loop /checksum 10 checksum 10 mod sub 10 mod 48 add def /isbn isbn 0 12 getinterval def isbntxt length 17 eq { isbntxt 16 get checksum ne { /bwipp.isbn13badCheckDigit (Incorrect ISBN-13 check digit provided) //raiseerror exec } if } if } if % Add the ISBN header to the isbntxt /pad isbn length 12 eq {22} {18} ifelse string def pad 0 (ISBN ) putinterval pad 5 isbntxt putinterval pad pad length 2 sub 45 put pad pad length 1 sub checksum put /isbntxt pad def % Convert ISBN digits to EAN-13 /barcode 12 string def isbn length 9 eq { barcode 0 (978) putinterval barcode 3 isbn putinterval } { barcode 0 isbn putinterval } ifelse % Append the addon addon () ne { 12 addon length add 1 add string dup 0 barcode putinterval dup 12 ( ) putinterval dup 13 addon putinterval /barcode exch def } if % Get the result of encoding with ean13 options (dontdraw) true put options (addongap) addongap put /args barcode options //ean13 exec def % Add the ISBN text includetext { isbntextxoffset (unset) eq { /isbntextxoffset isbn length 9 eq {-1} {-12} ifelse def } if isbntextyoffset (unset) eq { /isbntextyoffset height 72 mul 3 add def } if args (txt) known { /txt args (txt) get def /newtxt txt length 1 add array def newtxt 0 txt putinterval newtxt newtxt length 1 sub [isbntxt isbntextxoffset isbntextyoffset isbntextfont isbntextsize] put args (txt) newtxt put } { args (txt) [ [isbntxt isbntextxoffset isbntextyoffset isbntextfont isbntextsize] ] put } ifelse } if args (opt) options put args dontdraw not //renlinear if end } bind def /isbn dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER isbn-- postscriptbarcode-2014-03-12/src/ismn.ps000066400000000000000000000220771231007474100177440ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER ismn-- % --REQUIRES preamble raiseerror renlinear ean5 ean2 ean13-- % --DESC: ISMN % --EXAM: 979-0-2605-3211-3 % --EXOP: includetext guardwhitespace % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /ean13 dup /uk.co.terryburton.bwipp findresource put begin /ismn { 20 dict begin /options exch def % We are given an options string /barcode exch def % We are given the ismn text with dashes /dontdraw false def /includetext false def % Enable/disable ISMN text /ismntextfont /Courier def /ismntextsize 9 def /ismntextxoffset (unset) def /ismntextyoffset (unset) def /height 1 def /addongap 12 def /legacy false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /ismntextfont ismntextfont cvlit def /ismntextsize ismntextsize cvr def ismntextxoffset (unset) ne {/ismntextxoffset ismntextxoffset cvr def} if ismntextyoffset (unset) ne {/ismntextyoffset ismntextyoffset cvr def} if /height height cvr def /addongap addongap cvr def % Split off the addon barcode ( ) search { /barcode exch def pop /addon exch def } { pop /addon () def } ifelse % Validate the input barcode length 15 ne barcode length 17 ne and barcode length 11 ne barcode length 13 ne and and { /bwipp.ismnBadLength (ISMN-13 must be 15 or 17 characters including dashes. ISMN-10 must be 11 or 13 characters including dashes) //raiseerror exec } if addon length 0 ne addon length 2 ne and addon length 5 ne and { /bwipp.ismnBadAddOnLength (Add-on for ISMN must be 2 or 5 digits) //raiseerror exec } if barcode length 15 ge { % ISMN-13 barcode 0 4 getinterval (979-) ne { /bwipp.ismn13badPrefix (ISMN-13 prefix must be 979-) //raiseerror exec } if /wasdash false def /numdash 0 def /numdigit 0 def barcode 5 9 getinterval { dup 45 eq { wasdash { /bwipp.ismn13adjacentDashes (ISMN-13 does not permit adjacent dashes) //raiseerror exec } if /wasdash true def /numdash numdash 1 add def } if dup 48 ge exch 57 le and { /wasdash false def /numdigit numdigit 1 add def } if } forall numdash 2 ne numdigit 7 ne or { /bwipp.ismn13numDashesDigits (Incorrect number of dashes and digits for ISMN-13) //raiseerror exec } if barcode 14 get dup 48 lt exch 57 gt or { /bwipp.ismn13character15 (ISMN-13 character 15 must be a digit) //raiseerror exec } if barcode length 17 eq { barcode 15 1 getinterval (-) ne { /bwipp.ismn13character16 (ISMN-13 penultimate character must be a dash) //raiseerror exec } if barcode 16 get dup 48 lt exch 57 gt or { /bwipp.ismn13character17 (ISMN-13 final character must be a digit) //raiseerror exec } if } if } { % ISMN-10 barcode 0 2 getinterval (M-) ne { /bwipp.ismn10badPrefix (ISMN-10 prefix must be M-) //raiseerror exec } if barcode 2 get dup 48 lt exch 57 gt or { /bwipp.ismn10character3 (ISMN-10 character 3 must be a digit) //raiseerror exec } if /wasdash false def /numdash 0 def /numdigit 0 def barcode 3 7 getinterval { dup 45 eq { wasdash { /bwipp.ismn10adjacentDashes (ISMN-10 does not permit adjacent dashes) //raiseerror exec } if /wasdash true def /numdash numdash 1 add def } if dup 48 ge exch 57 le and { /wasdash false def /numdigit numdigit 1 add def } if } forall numdash 1 ne numdigit 6 ne or { /bwipp.ismn10numDashesDigits (Incorrect number of dashes and digits for ISMN-10) //raiseerror exec } if barcode 10 get dup 48 lt exch 57 gt or { /bwipp.ismn10character11 (ISMN-10 character 11 must be a digit) //raiseerror exec } if barcode length 13 eq { barcode 11 1 getinterval (-) ne { /bwipp.ismn10character12 (ISMN-10 penultimate character must be a dash) //raiseerror exec } if barcode 12 get dup dup 48 lt exch 57 gt or exch 88 ne and { /bwipp.ismn10character13 (ISMN-10 final character must be a digit or X) //raiseerror exec } if } if } ifelse /ismntxt barcode def % Convert old ISMN to ISMN-13 /legacytxt () def ismntxt length 13 le { /legacytxt ismntxt def /pad ismntxt length 4 add string def pad 0 (979-0-) putinterval pad 6 ismntxt 2 ismntxt length 2 sub getinterval putinterval /ismntxt pad def } if % Read the digits from ismntxt and calculate checksums /ismn 13 string def /checksum 0 def /i 0 def /n 0 def { % loop /ismnchar ismntxt i get 48 sub def ismnchar -3 ne { % Ignore dashes ismn n ismnchar 48 add put n 12 lt { n 2 mod 0 eq { /checksum ismnchar checksum add def } { /checksum ismnchar 3 mul checksum add def } ifelse } if /n n 1 add def } if /i i 1 add def i ismntxt length eq {exit} if } loop /checksum 10 checksum 10 mod sub 10 mod 48 add def % Validate the checksum barcode length 13 eq barcode length 17 eq or { barcode dup length 1 sub get checksum ne { /bwipp.ismnBadCheckDigit (Incorrect ISMN check digit provided) //raiseerror exec } if } if % Add the ISMN header and checksum to the ismntxt legacy legacytxt () ne and { /ismntxt legacytxt def /pad 18 string def } { /pad 22 string def } ifelse pad 0 (ISMN ) putinterval pad 5 ismntxt putinterval pad pad length 2 sub 45 put pad pad length 1 sub checksum put /ismntxt pad def % Convert ISMN digits to EAN-13 /barcode ismn 0 12 getinterval def % Append the addon addon () ne { 12 addon length add 1 add string dup 0 barcode putinterval dup 12 ( ) putinterval dup 13 addon putinterval /barcode exch def } if % Get the result of encoding with ean13 options (dontdraw) true put options (addongap) addongap put /args barcode options //ean13 exec def % Add the ISMN text includetext { ismntextxoffset (unset) eq { /ismntextxoffset ismntxt length 18 eq {-1} {-12} ifelse def } if ismntextyoffset (unset) eq { /ismntextyoffset height 72 mul 3 add def } if args (txt) known { /txt args (txt) get def /newtxt txt length 1 add array def newtxt 0 txt putinterval newtxt newtxt length 1 sub [ismntxt ismntextxoffset ismntextyoffset ismntextfont ismntextsize] put args (txt) newtxt put } { args (txt) [ [ismntxt ismntextxoffset ismntextyoffset ismntextfont ismntextsize] ] put } ifelse } if args (opt) options put args dontdraw not //renlinear if end } bind def /ismn dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER ismn-- postscriptbarcode-2014-03-12/src/issn.ps000066400000000000000000000153611231007474100177500ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER issn-- % --REQUIRES preamble raiseerror renlinear ean2 ean5 ean13-- % --DESC: ISSN % --EXAM: 0311-175X 00 17 % --EXOP: includetext guardwhitespace % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /ean13 dup /uk.co.terryburton.bwipp findresource put begin /issn { 20 dict begin /options exch def % We are given an options string /issntxt exch def % We are given the issn text with dashes /dontdraw false def /includetext false def % Enable/disable ISSN text /issntextfont /Courier def /issntextsize 9 def /issntextxoffset (unset) def /issntextyoffset (unset) def /height 1 def /addongap 12 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /issntextfont issntextfont cvlit def /issntextsize issntextsize cvr def issntextxoffset (unset) ne {/issntextxoffset issntextxoffset cvr def} if issntextyoffset (unset) ne {/issntextyoffset issntextyoffset cvr def} if /height height cvr def /addongap addongap cvr def % Split off the ISSN issntxt ( ) search { /issntxt exch def pop /seqvar exch def } { pop /seqvar () def } ifelse % Split off the sequence variant and addon seqvar ( ) search { /seqvar exch def pop /addon exch def } { pop /addon seqvar def /seqvar (00) def } ifelse % Validate the input issntxt length 8 ne issntxt length 9 ne and { /bwipp.issnBadLength (ISSN must be 8 or 9 characters including dash) //raiseerror exec } if issntxt 0 4 getinterval { dup 48 lt exch 57 gt or { /bwipp.issnBadFormat (ISSN must have the format XXXX-XXXX) //raiseerror exec } if } forall issntxt 4 1 getinterval (-) ne { /bwipp.issnBadFormat (ISSN must have the format XXXX-XXXX) //raiseerror exec } if issntxt 5 3 getinterval { dup 48 lt exch 57 gt or { /bwipp.issnBadFormat (ISSN must have the format XXXX-XXXX) //raiseerror exec } if } forall issntxt length 9 eq { issntxt 8 get dup dup 48 lt exch 57 gt or exch 88 ne and { % Digits or X /bwipp.issnBadFormat (ISSN must have the format XXXX-XXXX) //raiseerror exec } if } if seqvar length 2 ne { /bwipp.issnBadSequenceVariantLength (Sequence variant for ISSN must be 2 digits) //raiseerror exec } if seqvar { dup 48 lt exch 57 gt or { /bwipp.issnSequenceVariantBadCharacter (Sequence variant for ISSN must contain only digits) //raiseerror exec } if } forall addon length 0 ne addon length 2 ne and addon length 5 ne and { /bwipp.issnBadAddOnLength (Add-on for ISSN must be 2 or 5 digits) //raiseerror exec } if % Read the digits from issntxt and calculate checksums /issn 8 string def /checksum 0 def /i 0 def /n 0 def { % loop /issnchar issntxt i get 48 sub def issnchar -3 ne { % Ignore dashes issn n issnchar 48 add put n 7 lt { /checksum checksum issnchar 8 n sub mul add def } if /n n 1 add def } if /i i 1 add def i issntxt length eq {exit} if } loop /checksum 11 checksum 11 mod sub 11 mod def /checksum checksum 48 add dup 58 eq {pop 88} if def issntxt length 9 eq { issntxt 8 get checksum ne { /bwipp.issnBadCheckDigit (Incorrect ISSN check digit provided) //raiseerror exec } if } if % Add the ISSN header and checksum to the issntxt /pad 14 string def pad 0 (ISSN ) putinterval pad 5 issntxt putinterval % Add issntxt to the pad pad 13 checksum put /issntxt pad def % Convert ISSN digits to EAN-13 /barcode issn 0 7 getinterval def % Append the sequence variant /barcode 12 string def barcode 0 (977) putinterval barcode 3 issn putinterval barcode 10 seqvar putinterval % Append the addon addon () ne { 12 addon length add 1 add string dup 0 barcode putinterval dup 12 ( ) putinterval dup 13 addon putinterval /barcode exch def } if % Get the result of encoding with ean13 options (dontdraw) true put options (addongap) addongap put /args barcode options //ean13 exec def % Add the ISSN text includetext { issntextxoffset (unset) eq {/issntextxoffset 10 def} if issntextyoffset (unset) eq { /issntextyoffset height 72 mul 3 add def } if args (txt) known { /txt args (txt) get def /newtxt txt length 1 add array def newtxt 0 txt putinterval newtxt newtxt length 1 sub [issntxt issntextxoffset issntextyoffset issntextfont issntextsize] put args (txt) newtxt put } { args (txt) [ [issntxt issntextxoffset issntextyoffset issntextfont issntextsize] ] put } ifelse } if args (opt) options put args dontdraw not //renlinear if end } bind def /issn dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER issn-- postscriptbarcode-2014-03-12/src/itf14.ps000066400000000000000000000102321231007474100177130ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER itf14-- % --REQUIRES preamble raiseerror renlinear interleaved2of5-- % --DESC: ITF-14 % --EXAM: 04601234567893 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /interleaved2of5 dup /uk.co.terryburton.bwipp findresource put begin /itf14 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def /includecheckintext true def /textfont /Courier def /textsize 10 def /textxoffset 0 def /textyoffset -10 def /height 0.5 def /showborder true def /borderwidth 4 def /borderleft 15 def /borderright 15 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /height height cvr def /borderwidth borderwidth cvr def /borderleft borderleft cvr def /borderright borderright cvr def % Validate the input barcode length 13 ne barcode length 14 ne and { /bwipp.itf14badLength (ITF-14 must be 13 or 14 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.itf14badCharacter (ITF-14 must contain only digits) //raiseerror exec } if } forall % Calculate ITF checksum and add to end of barcode /checksum 0 def 0 1 12 { /i exch def /checksum checksum barcode i get 48 sub i 2 mod 0 eq {3 mul} if add def } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 14 eq { barcode 13 get checksum 48 add ne { /bwipp.itf14badCheckDigit (Incorrect ITF-14 check digit provided) //raiseerror exec } if } if 14 string dup 0 barcode putinterval dup 13 checksum 48 add put /barcode exch def % Get the result of encoding with interleaved2of5 options (dontdraw) true put options (showborder) showborder put options (borderwidth) borderwidth put options (borderleft) borderleft put options (borderright) borderright put options (height) height put options (textyoffset) textyoffset put options (includecheckintext) includecheckintext put /args barcode options //interleaved2of5 exec def args (opt) options put args dontdraw not //renlinear if end } bind def /itf14 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER itf14-- postscriptbarcode-2014-03-12/src/japanpost.ps000066400000000000000000000141311231007474100207650ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER japanpost-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Japan Post 4 State Customer Code % --EXAM: 6540123789-A-K-Z % --EXOP: includetext includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /japanpost { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 0.175 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Create an array containing the character mappings % 0123456789- C1C2C3C4C5C6C7C8 ST EN /encs [ (300) (330) (312) (132) (321) (303) (123) (231) (213) (033) (030) (120) (102) (210) (012) (201) (021) (003) (333) (31) (13) ] def % Create a string of the available characters /barchars (0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZ) def /barlen barcode length def /encstr 20 1 add 3 mul 4 add string def /digits 20 array def /txt barlen 1 add array def % Put start character encstr 0 encs 19 get putinterval /checksum 0 def /j 0 def /i 0 def 0 1 barlen 1 sub { /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard match and post indx 11 ge indx 37 lt and { % Insert escape j 18 gt {exit} if % Should fit in 20 chars % 11-20: C1 (11) % 21-30: C2 (12) % 31-36: C3 (13) /digit indx 1 sub 10 idiv 10 add def encstr j 3 mul 2 add encs digit get putinterval /checksum checksum digit add def digits j digit put /j j 1 add def } if j 19 gt {exit} if % Should fit in 20 chars /digit 0 def indx 37 eq { /digit 14 def % space (C14) } if indx 11 ge indx 37 lt and { /digit indx 1 sub 10 mod def } if indx 11 lt { /digit indx def } if encstr j 3 mul 2 add encs digit get putinterval % space /checksum checksum digit add def digits j digit put txt i [barcode i 1 getinterval j 3 mul 2 add 3.312 mul textyoffset textfont textsize] put /j j 1 add def } for % Fill spaces (c14) at right end j 1 20 1 sub { /k exch def encstr k 3 mul 2 add encs 14 get putinterval /checksum checksum 14 add def digits k 14 put } for % Put the checksum character /checksum checksum 19 mod 19 exch sub def encstr 2 20 3 mul add encs checksum get putinterval % Put end character encstr 2 21 3 mul add encs 20 get putinterval /checkdigit ( ) def includecheckintext { /checkdigit barchars checksum 1 getinterval def } if txt i 1 add [ checkdigit 20 3 mul 2 add 3.312 mul textyoffset textfont textsize] put % Put end character encstr 20 1 add 3 mul 2 add encs 20 get putinterval /bbs 21 3 mul 4 add array def /bhs bbs length array def 0 1 bbs length 1 sub { /i exch def /enc encstr i 1 getinterval def /bunit 0 def /hunit 0 def enc (0) eq { /bunit 3 def /hunit 2 def } if enc (1) eq { /bunit 0 def /hunit 5 def } if enc (2) eq { /bunit 3 def /hunit 5 def } if enc (3) eq { /bunit 0 def /hunit 8 def } if bbs i bunit height mul 8 div put bhs i hunit height mul 8 div put } for % Return the arguments << /ren //renlinear /bbs bbs /bhs bhs /sbs [bhs length 1 sub {1.44 1.872} repeat 1.44] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /japanpost dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER japanpost-- postscriptbarcode-2014-03-12/src/kix.ps000066400000000000000000000107261231007474100175670ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER kix-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Royal Dutch TPG Post KIX % --EXAM: 1231FZ13XHS % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /kix { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 0.175 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Create an array containing the character mappings /encs [ (0033) (0123) (0132) (1023) (1032) (1122) (0213) (0303) (0312) (1203) (1212) (1302) (0231) (0321) (0330) (1221) (1230) (1320) (2013) (2103) (2112) (3003) (3012) (3102) (2031) (2121) (2130) (3021) (3030) (3120) (2211) (2301) (2310) (3201) (3210) (3300) ] def % Create a string of the available characters /barchars (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) def /charvals 36 dict def 0 1 35 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.kixBadCharacter (KIX must contain only capital letters and digits) //raiseerror exec } if } for /barlen barcode length def /encstr barlen 4 mul string def /txt barlen array def 0 1 barlen 1 sub { /i exch def /indx charvals barcode i 1 getinterval get def encstr i 4 mul encs indx get putinterval txt i [barcode i 1 getinterval i 4 mul 3.312 mul textyoffset textfont textsize] put } for /bbs encstr length array def /bhs encstr length array def 0 1 encstr length 1 sub { /i exch def /enc encstr i 1 getinterval def enc (0) eq { bbs i 3 height mul 8 div put bhs i 2 height mul 8 div put } if enc (1) eq { bbs i 0 height mul 8 div put bhs i 5 height mul 8 div put } if enc (2) eq { bbs i 3 height mul 8 div put bhs i 5 height mul 8 div put } if enc (3) eq { bbs i 0 height mul 8 div put bhs i 8 height mul 8 div put } if } for % Return the arguments << /ren //renlinear /bbs bbs /bhs bhs /sbs [bhs length 1 sub {1.44 1.872} repeat 1.44] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /kix dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER kix-- postscriptbarcode-2014-03-12/src/leitcode.ps000066400000000000000000000103311231007474100205540ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER leitcode-- % --REQUIRES preamble raiseerror renlinear interleaved2of5-- % --DESC: Deutsche Post Leitcode % --EXAM: 21348075016401 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /interleaved2of5 dup /uk.co.terryburton.bwipp findresource put begin /leitcode { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textxoffset 0 def /textyoffset -7 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /height height cvr def % Validate the input barcode length 13 ne barcode length 14 ne and { /bwipp.leitcodeBadLength (Deutsche Post Leitcode must be 13 or 14 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.leitcodeBadCharacter (Deutsche Post Leitcode must contain only digits) //raiseerror exec } if } forall % Calculate checksum and add to end of barcode /checksum 0 def 0 1 12 { /i exch def /checksum checksum barcode i get 48 sub i 2 mod 0 eq {4 mul} {9 mul} ifelse add def } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 14 eq { barcode 13 get checksum 48 add ne { /bwipp.leitcodeBadCheckDigit (Incorrect Deutsche Post Leitcode check digit provided) //raiseerror exec } if } if 14 string dup 0 barcode putinterval dup 13 checksum 48 add put /barcode exch def % Compose the human readable text /text ( . . . ) 18 string copy def text 0 barcode 0 5 getinterval putinterval text 6 barcode 5 3 getinterval putinterval text 10 barcode 8 3 getinterval putinterval text 14 barcode 11 2 getinterval putinterval text 17 barcode 13 1 getinterval putinterval % Get the result of encoding with interleaved2of5 options (dontdraw) true put options (includecheck) false put /args barcode options //interleaved2of5 exec def args (txt) [ [text textxoffset textyoffset textfont textsize] ] put args (textxalign) (center) put args (opt) options put args dontdraw not //renlinear if end } bind def /leitcode dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER leitcode-- postscriptbarcode-2014-03-12/src/maxicode.ps000066400000000000000000000544041231007474100205660ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER maxicode-- % --REQUIRES preamble raiseerror renmaximatrix-- % --DESC: MaxiCode % --EXAM: [)>^03001^02996152382802^029840^029001^0291Z00004951^029UPSN^02906X610^029159^0291234567^0291/1^029^029Y^029634 ALPHA DR^029PITTSBURGH^029PA^029^004 % --EXOP: mode=2 parse % --RNDR: renmaximatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmaximatrix dup /uk.co.terryburton.bwipp findresource put begin /maxicode { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /mode -1 def /sam -1 def /parse false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /mode mode cvi def /sam sam cvi def % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if /msg barcode def /msglen msg length def % Special message handling for modes 2 and 3 mode 2 eq mode 3 eq or { % Normalise messages that begin with a field identifier [)>RS01GSyy msg 0 7 getinterval <5b293e1e30311d> eq { /fid msg 0 9 getinterval def /msg msg 9 msglen 9 sub getinterval def } { /fid () def } ifelse % Read the postcode, country code and service code fields seperated by GS msg <1d> search pop /pcode exch def pop <1d> search pop /ccode exch def pop <1d> search pop /scode exch def pop /msg exch def % Prepend the field identifier msg length fid length add string dup 0 fid putinterval dup fid length msg putinterval /msg exch def /msglen msg length def } if % Special function characters /eci -1 def /pad -2 def /ns -3 def /la -4 def /lb -5 def /sa -6 def /sb -7 def /sc -8 def /sd -9 def /se -10 def /sa2 -11 def /sa3 -12 def /lkc -13 def /lkd -14 def /lke -15 def /pd2 -16 def /pd3 -17 def % Character maps for each state /charmaps [ % A B C D E [ 13 (`) 192 224 0 ] % 0 [ (A) (a) 193 225 1 ] % 1 [ (B) (b) 194 226 2 ] % 2 [ (C) (c) 195 227 3 ] % 3 [ (D) (d) 196 228 4 ] % 4 [ (E) (e) 197 229 5 ] % 5 [ (F) (f) 198 230 6 ] % 6 [ (G) (g) 199 231 7 ] % 7 [ (H) (h) 200 232 8 ] % 8 [ (I) (i) 201 233 9 ] % 9 [ (J) (j) 202 234 10 ] % 10 [ (K) (k) 203 235 11 ] % 11 [ (L) (l) 204 236 12 ] % 12 [ (M) (m) 205 237 13 ] % 13 [ (N) (n) 206 238 14 ] % 14 [ (O) (o) 207 239 15 ] % 15 [ (P) (p) 208 240 16 ] % 16 [ (Q) (q) 209 241 17 ] % 17 [ (R) (r) 210 242 18 ] % 18 [ (S) (s) 211 243 19 ] % 19 [ (T) (t) 212 244 20 ] % 20 [ (U) (u) 213 245 21 ] % 21 [ (V) (v) 214 246 22 ] % 22 [ (W) (w) 215 247 23 ] % 23 [ (X) (x) 216 248 24 ] % 24 [ (Y) (y) 217 249 25 ] % 25 [ (Z) (z) 218 250 26 ] % 26 [ eci eci eci eci eci ] % 27 [ 28 28 28 28 pad ] % 28 [ 29 29 29 29 pad ] % 29 [ 30 30 30 30 27 ] % 30 [ ns ns ns ns ns ] % 31 [ ( ) ({) 219 251 28 ] % 32 [ pad pad 220 252 29 ] % 33 [ (") (}) 221 253 30 ] % 34 [ (#) (~) 222 254 31 ] % 35 [ ($) 127 223 255 159 ] % 36 [ (%) (;) 170 161 160 ] % 37 [ (&) (<) 172 168 162 ] % 38 [ (') (=) 177 171 163 ] % 39 [ 40 (>) 178 175 164 ] % 40 [ 41 (?) 179 176 165 ] % 41 [ (*) ([) 181 180 166 ] % 42 [ (+) 92 185 183 167 ] % 43 [ (,) (]) 186 184 169 ] % 44 [ (-) (^) 188 187 173 ] % 45 [ (.) (_) 189 191 174 ] % 46 [ (/) ( ) 190 138 182 ] % 47 [ (0) (,) 128 139 149 ] % 48 [ (1) (.) 129 140 150 ] % 49 [ (2) (/) 130 141 151 ] % 50 [ (3) (:) 131 142 152 ] % 51 [ (4) (@) 132 143 153 ] % 52 [ (5) (!) 133 144 154 ] % 53 [ (6) (|) 134 145 155 ] % 54 [ (7) pd2 135 146 156 ] % 55 [ (8) sa2 136 147 157 ] % 56 [ (9) sa3 137 148 158 ] % 57 [ (:) pd3 la la la ] % 58 [ sb sa ( ) ( ) ( ) ] % 59 [ sc sc lkc sc sc ] % 60 [ sd sd sd lkd sd ] % 61 [ se se se se lke ] % 62 [ lb la lb lb lb ] % 63 ] def % Invert charmaps to give character to value maps for each state /charvals [ 64 dict 64 dict 64 dict 64 dict 64 dict ] def 0 1 charmaps length 1 sub { /i exch def /encs charmaps i get def 0 1 4 { /j exch def encs j get dup type /stringtype eq {0 get} if % convert string to ASCII if required charvals j get exch i put } for } for /seta charvals 0 get def /setb charvals 1 get def /setc charvals 2 get def /setd charvals 3 get def /sete charvals 4 get def % Compute numeric runlengths /nseq [ msglen 1 add {0} repeat ] def msglen 1 sub -1 0 { /i exch def msg i get dup 48 ge exch 57 le and { nseq i nseq i 1 add get 1 add put } { nseq i 0 put } ifelse } for /nseq nseq 0 msglen getinterval def % Encode the message from ASCII to codewords /prefixinset { 0 { 2 copy exch length ge {exit} if 2 copy get 3 index exch known {1 add} {exit} ifelse } loop exch pop exch pop } bind def /enc { exch get out exch j exch put /j j 1 add def } bind def /out 144 array def /i 0 def /j 0 def /cset (seta) def { % loop % Exit when no characters remain latching back to A if necessary i msglen eq { cset (seta) ne cset (setb) ne and { la cset load enc /cset (seta) def } if exit } if { % not a loop but common exit point % If 9 numerals available then use NS nseq i get 9 ge { msg i 9 getinterval cvi 4 { dup 63 and exch -6 bitshift } repeat cset load ns get 0 2 10 {index} for 6 array astore 7 1 roll 6 {pop} repeat out exch j exch putinterval /i i 9 add def /j j 6 add def exit } if % Read next three characters /char1 msg i get def /char2 i 1 add msglen lt {msg i 1 add get} {-99} ifelse def /char3 i 2 add msglen lt {msg i 2 add get} {-99} ifelse def % If current mode is sufficient then directly encode cset load char1 known { char1 cset load enc /i i 1 add def exit } if % For switching from A to B cset (seta) eq setb char1 known and { setb char2 known { lb seta enc /cset (setb) def } { sb seta enc char1 setb enc /i i 1 add def } ifelse exit } if % For switching from B to A encode according to length of prefix cset (setb) eq seta char1 known and { /p seta msg i 4 msglen i sub 2 copy gt {exch} if pop getinterval prefixinset def p 1 eq { sa setb enc char1 seta enc /i i 1 add def } if p 2 eq { sa2 setb enc char1 seta enc char2 seta enc /i i 2 add def } if p 3 eq { sa3 setb enc char1 seta enc char2 seta enc char3 seta enc /i i 3 add def } if p 4 ge { la setb enc /cset (seta) def } if exit } if % If character is in A or B then directly latch seta char1 known { la cset load enc /cset (seta) def exit } if setb char1 known { lb cset load enc /cset (setb) def exit } if % Determine which one of sets C, D or E the character is in setc char1 known {/setx (setc) def /sx sc def /lkx lkc def} if setd char1 known {/setx (setd) def /sx sd def /lkx lkd def} if sete char1 known {/setx (sete) def /sx se def /lkx lke def} if % Encode according to the length of the prefix /p setx load msg i 4 msglen i sub 2 copy gt {exch} if pop getinterval prefixinset def p 1 eq { sx cset load enc char1 setx load enc /i i 1 add def } if p 2 eq { sx cset load enc char1 setx load enc sx cset load enc char2 setx load enc /i i 2 add def } if p 3 eq { sx cset load enc char1 setx load enc sx cset load enc char2 setx load enc sx cset load enc char3 setx load enc /i i 3 add def } if p 4 ge { sx cset load enc lkx setx load enc /cset setx def } if exit } loop % out } loop /encmsg out 0 j getinterval def /padval cset load pad get def % Prefix the encoded message with the structured append insert /sami [] def sam -1 ne { /sami 2 array def sami 0 seta pad get put sami 1 sam 10 idiv 1 sub 8 mul sam 10 mod 1 sub add put } if /encmsg [ sami aload pop encmsg aload pop ] def % Derive the primary and secondary codewords for modes 2 and 3 mode 2 eq mode 3 eq or { % Calculate the fixed-width binary values for the mode, postcode, country code and service /mdb (0000) 4 string copy dup mode cvi 2 4 string cvrs dup length 4 exch sub exch putinterval def /ccb (0000000000) 10 string copy dup ccode cvi 2 10 string cvrs dup length 10 exch sub exch putinterval def /scb (0000000000) 10 string copy dup scode cvi 2 10 string cvrs dup length 10 exch sub exch putinterval def /pcb (000000000000000000000000000000000000) 36 string copy def mode 2 eq { % For numeric postcode, first six bits represent length and remaining 30 bits the value pcb pcode length 2 6 string cvrs dup length 6 exch sub exch putinterval pcb pcode cvi 2 30 string cvrs dup length 36 exch sub exch putinterval } { % mode=3 % For alphanumeric postcode, trim or pad with spaces to 6 chars and encode to binary /pccw [ ( ) 6 string copy dup 0 pcode length 6 gt {pcode 0 6 getinterval} {pcode} ifelse putinterval {seta exch get} forall ] def 0 1 5 { /i exch def pcb pccw i get 2 6 string cvrs dup length 6 i mul 6 add exch sub exch putinterval } for } ifelse % Convolute the binary values into the structured carrier message /scm 60 string def scm 2 mdb putinterval scm 38 pcb 0 4 getinterval putinterval scm 30 pcb 4 6 getinterval putinterval scm 24 pcb 10 6 getinterval putinterval scm 18 pcb 16 6 getinterval putinterval scm 12 pcb 22 6 getinterval putinterval scm 6 pcb 28 6 getinterval putinterval scm 0 pcb 34 2 getinterval putinterval scm 52 ccb 0 2 getinterval putinterval scm 42 ccb 2 6 getinterval putinterval scm 36 ccb 8 2 getinterval putinterval scm 54 scb 0 6 getinterval putinterval scm 48 scb 6 4 getinterval putinterval % Evaluate the structured carrier message as codewords /pri [ 0 0 0 0 0 0 0 0 0 0 ] def 0 1 59 { /i exch def /ps i 6 idiv def /ep 2 5 i 6 mod sub exp cvi scm i get 48 sub mul def pri ps pri ps get ep add put } for % Pad the encoded message into the secondary component /sec [ 84 {padval} repeat ] def sec 0 encmsg putinterval } if % Derive the primary and secondary codewords for modes 4, 5 and 6 mode 4 eq mode 5 eq or mode 6 eq or mode -1 eq or { % If mode isn't specified then use EEC if message fits, otherwise SEC mode -1 eq { /mode encmsg length 77 le {5} {4} ifelse def } if % First symbol is the mode and the remainder are the padded message /cws [ mode 5 eq {78} {94} ifelse {padval} repeat ] def cws 0 mode put cws 1 encmsg putinterval % Fit the message into the primary and secondary components /pri cws 0 10 getinterval def /sec cws 10 cws length 10 sub getinterval def } if % Calculate the log and anti-log tables /rsalog [ 1 63 { dup 2 mul dup 64 ge {67 xor} if } repeat ] def /rslog 64 array def 1 1 63 {dup rsalog exch get exch rslog 3 1 roll put} for % Function to calculate the product in the field /rsprod { 2 copy 0 ne exch 0 ne and { rslog exch get exch rslog exch get add 63 mod rsalog exch get } { pop pop 0 } ifelse } bind def % Generate error correction codewords /rscodes { /rsnum exch def /cwb exch def % Generate the coefficients /coeffs [ 1 rsnum {0} repeat ] def 1 1 rsnum { /i exch def coeffs i coeffs i 1 sub get put i 1 sub -1 1 { /j exch def coeffs j coeffs j 1 sub get coeffs j get rsalog i get rsprod xor put } for coeffs 0 coeffs 0 get rsalog i get rsprod put } for /coeffs coeffs 0 coeffs length 1 sub getinterval def % Calculate the error correction codewords /ecb [ rsnum {0} repeat ] def 0 1 cwb length 1 sub { /t exch cwb exch get ecb 0 get xor def ecb length 1 sub -1 0 { /i exch def /p ecb length i sub 1 sub def ecb p t coeffs i get rsprod put i 0 gt { ecb p ecb p 1 add get ecb p get xor put } if } for } for ecb } bind def % Split secondary codeword into odd and even elements /seco [ 0 2 sec length 1 sub { sec exch get } for ] def /sece [ 1 2 sec length 1 sub { sec exch get } for ] def % Calculate the parity codewords for secondary codeword parts based on mode /scodes sec length 84 eq {20} {28} ifelse def % SEC/EEC mode /secochk seco scodes rscodes def /secechk sece scodes rscodes def % Recompose the secondary parity codewords /secchk [ 0 1 scodes 1 sub { dup secochk exch get exch secechk exch get } for ] def % Concatinate the data into final codewords /codewords [ pri aload pop pri 10 rscodes aload pop sec aload pop secchk aload pop ] def % Convert the codewords into module bits /mods [ 864 {0} repeat ] def 0 1 143 { /i exch def /cw [ codewords i get 2 6 string cvrs {48 sub} forall ] def mods 6 i mul 6 cw length sub add cw putinterval } for % Maps modules to pixels in the grid /modmap [ 469 529 286 316 347 346 673 672 703 702 647 676 283 282 313 312 370 610 618 379 378 409 408 439 705 704 559 589 588 619 458 518 640 701 675 674 285 284 315 314 310 340 531 289 288 319 349 348 456 486 517 516 471 470 369 368 399 398 429 428 549 548 579 578 609 608 649 648 679 678 709 708 639 638 669 668 699 698 279 278 309 308 339 338 381 380 411 410 441 440 561 560 591 590 621 620 547 546 577 576 607 606 367 366 397 396 427 426 291 290 321 320 351 350 651 650 681 680 711 710 1 0 31 30 61 60 3 2 33 32 63 62 5 4 35 34 65 64 7 6 37 36 67 66 9 8 39 38 69 68 11 10 41 40 71 70 13 12 43 42 73 72 15 14 45 44 75 74 17 16 47 46 77 76 19 18 49 48 79 78 21 20 51 50 81 80 23 22 53 52 83 82 25 24 55 54 85 84 27 26 57 56 87 86 117 116 147 146 177 176 115 114 145 144 175 174 113 112 143 142 173 172 111 110 141 140 171 170 109 108 139 138 169 168 107 106 137 136 167 166 105 104 135 134 165 164 103 102 133 132 163 162 101 100 131 130 161 160 99 98 129 128 159 158 97 96 127 126 157 156 95 94 125 124 155 154 93 92 123 122 153 152 91 90 121 120 151 150 181 180 211 210 241 240 183 182 213 212 243 242 185 184 215 214 245 244 187 186 217 216 247 246 189 188 219 218 249 248 191 190 221 220 251 250 193 192 223 222 253 252 195 194 225 224 255 254 197 196 227 226 257 256 199 198 229 228 259 258 201 200 231 230 261 260 203 202 233 232 263 262 205 204 235 234 265 264 207 206 237 236 267 266 297 296 327 326 357 356 295 294 325 324 355 354 293 292 323 322 353 352 277 276 307 306 337 336 275 274 305 304 335 334 273 272 303 302 333 332 271 270 301 300 331 330 361 360 391 390 421 420 363 362 393 392 423 422 365 364 395 394 425 424 383 382 413 412 443 442 385 384 415 414 445 444 387 386 417 416 447 446 477 476 507 506 537 536 475 474 505 504 535 534 473 472 503 502 533 532 455 454 485 484 515 514 453 452 483 482 513 512 451 450 481 480 511 510 541 540 571 570 601 600 543 542 573 572 603 602 545 544 575 574 605 604 563 562 593 592 623 622 565 564 595 594 625 624 567 566 597 596 627 626 657 656 687 686 717 716 655 654 685 684 715 714 653 652 683 682 713 712 637 636 667 666 697 696 635 634 665 664 695 694 633 632 663 662 693 692 631 630 661 660 691 690 721 720 751 750 781 780 723 722 753 752 783 782 725 724 755 754 785 784 727 726 757 756 787 786 729 728 759 758 789 788 731 730 761 760 791 790 733 732 763 762 793 792 735 734 765 764 795 794 737 736 767 766 797 796 739 738 769 768 799 798 741 740 771 770 801 800 743 742 773 772 803 802 745 744 775 774 805 804 747 746 777 776 807 806 837 836 867 866 897 896 835 834 865 864 895 894 833 832 863 862 893 892 831 830 861 860 891 890 829 828 859 858 889 888 827 826 857 856 887 886 825 824 855 854 885 884 823 822 853 852 883 882 821 820 851 850 881 880 819 818 849 848 879 878 817 816 847 846 877 876 815 814 845 844 875 874 813 812 843 842 873 872 811 810 841 840 871 870 901 900 931 930 961 960 903 902 933 932 963 962 905 904 935 934 965 964 907 906 937 936 967 966 909 908 939 938 969 968 911 910 941 940 971 970 913 912 943 942 973 972 915 914 945 944 975 974 917 916 947 946 977 976 919 918 949 948 979 978 921 920 951 950 981 980 923 922 953 952 983 982 925 924 955 954 985 984 927 926 957 956 987 986 58 89 88 118 149 148 178 209 208 238 269 268 298 329 328 358 389 388 418 449 448 478 509 508 538 569 568 598 629 628 658 689 688 718 749 748 778 809 808 838 869 868 898 929 928 958 989 988 ] def % Lookup pixels for enabled modules from modmap /pixs 864 array def /j 0 def 0 1 mods length 1 sub { /i exch def mods i get 1 eq { pixs j modmap i get put /j j 1 add def } if } for /pixs [ pixs 0 j getinterval {} forall 28 29 280 281 311 457 488 500 530 670 700 677 707 ] def % Return the arguments << /ren //renmaximatrix /pixs pixs /opt options >> dontdraw not //renmaximatrix if end } bind def /maxicode dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER maxicode-- postscriptbarcode-2014-03-12/src/micropdf417.ps000066400000000000000000001043451231007474100210340ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER micropdf417-- % --REQUIRES preamble raiseerror renmatrix-- % --DESC: MicroPDF417 % --EXAM: MicroPDF417 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /micropdf417 { 20 dict begin /options exch def /barcode exch def /dontdraw false def /columns 0 def /rows 0 def /rowmult 2 def /cca false def /ccb false def /raw false def /parse false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /columns columns cvi def /rows rows cvi def /rowmult rowmult cvr def cca {/raw true def} if % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if % Convert input into array of codewords raw { /datcws barcode length array def /i 0 def /j 0 def { % loop i barcode length eq {exit} if /cw barcode i 1 add 3 getinterval cvi def datcws j cw put /i i 4 add def /j j 1 add def } loop /datcws datcws 0 j getinterval def } { % Simple autoencoder from input to codewords using byte mode /barlen barcode length def barlen 6 mod 0 eq { /datcws barlen 6 idiv 5 mul 1 add array def datcws 0 924 put } { /datcws barlen 6 idiv 5 mul barlen 6 mod add 1 add array def datcws 0 901 put } ifelse % Rebase groups of 6 bytes splitting into 3 byte chunks 0 1 barlen 6 idiv 1 sub { /i exch def /msbs [ barcode i 6 mul 3 getinterval {} forall ] def /mscs [ msbs aload pop exch 256 mul add exch 65536 mul add 3 {dup 900 mod exch 900 idiv} repeat ] def /lsbs [barcode i 6 mul 3 add 3 getinterval {} forall] def /lscs [ lsbs aload pop exch 256 mul add exch 65536 mul add 3 {dup 900 mod exch 900 idiv} repeat ] def /cws 5 array def lscs 0 get mscs 0 get 316 mul add cws 4 2 index 900 mod put 900 idiv lscs 1 get add mscs 0 get 641 mul add mscs 1 get 316 mul add cws 3 2 index 900 mod put 900 idiv lscs 2 get add mscs 0 get 20 mul add mscs 1 get 641 mul add mscs 2 get 316 mul add cws 2 2 index 900 mod put 900 idiv lscs 3 get add mscs 1 get 20 mul add mscs 2 get 641 mul add cws 1 2 index 900 mod put 900 idiv mscs 2 get 20 mul add cws 0 3 -1 roll 900 mod put datcws i 5 mul 1 add cws putinterval } for % Add the remaining bytes to the end of the codewords /rem barlen 6 mod def rem 0 ne { datcws datcws length rem sub [ barcode barlen rem sub rem getinterval {} forall ] putinterval } if ccb {/datcws [920 datcws aload pop] def} if } ifelse % Basic metrics for the each symbol % c r ecw rl rc rr /metrics [ [ 1 11 7 1 0 9 ] [ 1 14 7 8 0 8 ] [ 1 17 7 36 0 36 ] [ 1 20 8 19 0 19 ] [ 1 24 8 9 0 17 ] [ 1 28 8 25 0 33 ] [ 2 8 8 1 0 1 ] [ 2 11 9 1 0 9 ] [ 2 14 9 8 0 8 ] [ 2 17 10 36 0 36 ] [ 2 20 11 19 0 19 ] [ 2 23 13 9 0 17 ] [ 2 26 15 27 0 35 ] [ 3 6 12 1 1 1 ] [ 3 8 14 7 7 7 ] [ 3 10 16 15 15 15 ] [ 3 12 18 25 25 25 ] [ 3 15 21 37 37 37 ] [ 3 20 26 1 17 33 ] [ 3 26 32 1 9 17 ] [ 3 32 38 21 29 37 ] [ 3 38 44 15 31 47 ] [ 3 44 50 1 25 49 ] [ 4 4 8 47 19 43 ] [ 4 6 12 1 1 1 ] [ 4 8 14 7 7 7 ] [ 4 10 16 15 15 15 ] [ 4 12 18 25 25 25 ] [ 4 15 21 37 37 37 ] [ 4 20 26 1 17 33 ] [ 4 26 32 1 9 17 ] [ 4 32 38 21 29 37 ] [ 4 38 44 15 31 47 ] [ 4 44 50 1 25 49 ] ] def % Basic metrics for the each symbol % c r ecw rl rc rr /ccametrics [ [ 2 5 4 39 0 19 ] [ 2 6 4 1 0 33 ] [ 2 7 5 32 0 12 ] [ 2 8 5 8 0 40 ] [ 2 9 6 14 0 46 ] [ 2 10 6 43 0 23 ] [ 2 12 7 20 0 52 ] [ 3 4 4 11 43 23 ] [ 3 5 5 1 33 13 ] [ 3 6 6 5 37 17 ] [ 3 7 7 15 47 27 ] [ 3 8 7 21 1 33 ] [ 4 3 4 40 20 52 ] [ 4 4 5 43 23 3 ] [ 4 5 6 46 26 6 ] [ 4 6 7 34 14 46 ] [ 4 7 8 29 9 41 ] ] def cca {/metrics ccametrics def} if % Select metrics of an appropriate symbol /urows rows def /ucols columns def /i 0 def { % loop /m metrics i get def /c m 0 get def % Columns in symbol /r m 1 get def % Rows in symbol /k m 2 get def % Error correction codewords /rapl m 3 get def % Left row address pattern /rapc m 4 get def % Centre row address pattern /rapr m 5 get def % Right row address pattern /ncws r c mul k sub def % Data codewords /okay true def datcws length ncws gt {/okay false def} if urows 0 ne urows r ne and {/okay false def} if ucols 0 ne ucols c ne and {/okay false def} if okay {exit} if /i i 1 add def } loop /m datcws length def % Create codewords array with one extra working space element and add padding /n c r mul k sub def /cws c r mul 1 add array def cws 0 datcws putinterval cws m [ n m sub {900} repeat ] putinterval cws n [ k {0} repeat 0 ] putinterval % Calculate the log and anti-log tables /rsalog [ 1 928 {dup 3 mul 929 mod} repeat ] def /rslog 929 array def 1 1 928 {dup rsalog exch get exch rslog 3 1 roll put} for % Function to calculate the product in the field /rsprod { 2 copy 0 ne exch 0 ne and { rslog exch get exch rslog exch get add 928 mod rsalog exch get } { pop pop 0 } ifelse } bind def % Generate the coefficients /coeffs [ 1 k {0} repeat ] def 1 1 k { /i exch def coeffs i coeffs i 1 sub get put i 1 sub -1 1 { /j exch def coeffs j coeffs j 1 sub get coeffs j get rsalog i get rsprod add 929 mod put } for coeffs 0 coeffs 0 get rsalog i get rsprod put } for /coeffs coeffs 0 coeffs length 1 sub getinterval def coeffs length 1 sub -2 0 {coeffs exch 2 copy get 929 exch sub put} for % Derive the error codewords 0 1 n 1 sub { /t exch cws exch get cws n get add 929 mod def 0 1 k 1 sub { /j exch def cws n j add cws n j add 1 add get 929 t coeffs k j sub 1 sub get mul 929 mod sub add 929 mod put } for } for n 1 n k add { dup cws exch 929 cws 5 -1 roll get sub 929 mod put } for % Trim the working space from the end of the codewords /cws cws 0 cws length 1 sub getinterval def % Base 10 encoding of the bar space successions for the codewords in each cluster /clusters [ [ 120256 125680 128380 120032 125560 128318 108736 119920 108640 86080 108592 86048 110016 120560 125820 109792 120440 125758 88256 109680 88160 89536 110320 120700 89312 110200 120638 89200 110140 89840 110460 89720 110398 89980 128506 119520 125304 128190 107712 119408 125244 107616 119352 84032 107568 119324 84000 107544 83984 108256 119672 125374 85184 108144 119612 85088 108088 119582 85040 108060 85728 108408 119742 85616 108348 85560 108318 85880 108478 85820 85790 107200 119152 125116 107104 119096 125086 83008 107056 119068 82976 107032 82960 82952 83648 107376 119228 83552 107320 119198 83504 107292 83480 83468 83824 107452 83768 107422 83740 83900 106848 118968 125022 82496 106800 118940 82464 106776 118926 82448 106764 82440 106758 82784 106936 119006 82736 106908 82712 106894 82700 82694 106974 82830 82240 106672 118876 82208 106648 118862 82192 106636 82184 106630 82180 82352 82328 82316 82080 118830 106572 106566 82050 117472 124280 127678 103616 117360 124220 103520 117304 124190 75840 103472 75808 104160 117624 124350 76992 104048 117564 76896 103992 76848 76824 77536 104312 117694 77424 104252 77368 77340 77688 104382 77628 77758 121536 126320 128700 121440 126264 128670 111680 121392 126236 111648 121368 126222 111632 121356 103104 117104 124092 112320 103008 117048 124062 112224 121656 126366 93248 74784 102936 117006 93216 112152 93200 75456 103280 117180 93888 75360 103224 117150 93792 112440 121758 93744 75288 93720 75632 103356 94064 75576 103326 94008 112542 93980 75708 94140 75678 94110 121184 126136 128606 111168 121136 126108 111136 121112 126094 111120 121100 111112 111108 102752 116920 123998 111456 102704 116892 91712 74272 121244 116878 91680 74256 102668 91664 111372 102662 74244 74592 102840 116958 92000 74544 102812 91952 111516 102798 91928 74508 74502 74680 102878 92088 74652 92060 74638 92046 92126 110912 121008 126044 110880 120984 126030 110864 120972 110856 120966 110852 110850 74048 102576 116828 90944 74016 102552 116814 90912 111000 121038 90896 73992 102534 90888 110982 90884 74160 102620 91056 74136 102606 91032 111054 91020 74118 91014 91100 91086 110752 120920 125998 110736 120908 110728 120902 110724 110722 73888 102488 116782 90528 73872 102476 90512 110796 102470 90504 73860 90500 73858 73944 90584 90572 90566 120876 120870 110658 102444 73800 90312 90308 90306 101056 116080 123580 100960 116024 70720 100912 115996 70688 100888 70672 70664 71360 101232 116156 71264 101176 116126 71216 101148 71192 71180 71536 101308 71480 101278 71452 71612 71582 118112 124600 127838 105024 118064 124572 104992 118040 124558 104976 118028 104968 118022 100704 115896 123486 105312 100656 115868 79424 70176 118172 115854 79392 105240 100620 79376 70152 79368 70496 100792 115934 79712 70448 118238 79664 105372 100750 79640 70412 79628 70584 100830 79800 70556 79772 70542 70622 79838 122176 126640 128860 122144 126616 128846 122128 126604 122120 126598 122116 104768 117936 124508 113472 104736 126684 124494 113440 122264 126670 113424 104712 117894 113416 122246 104706 69952 100528 115804 78656 69920 100504 115790 96064 78624 104856 117966 96032 113560 122318 100486 96016 78600 104838 96008 69890 70064 100572 78768 70040 100558 96176 78744 104910 96152 113614 70022 78726 70108 78812 70094 96220 78798 122016 126552 128814 122000 126540 121992 126534 121988 121986 104608 117848 124462 113056 104592 126574 113040 122060 117830 113032 104580 113028 104578 113026 69792 100440 115758 78240 69776 100428 95136 78224 104652 100422 95120 113100 69764 95112 78212 69762 78210 69848 100462 78296 69836 95192 78284 69830 95180 78278 69870 95214 121936 126508 121928 126502 121924 121922 104528 117804 112848 104520 117798 112840 121958 112836 104514 112834 69712 100396 78032 69704 100390 94672 78024 104550 94664 112870 69698 94660 78018 94658 78060 94700 94694 126486 121890 117782 104484 104482 69672 77928 94440 69666 77922 99680 68160 99632 68128 99608 115342 68112 99596 68104 99590 68448 99768 115422 68400 99740 68376 99726 68364 68358 68536 99806 68508 68494 68574 101696 116400 123740 101664 116376 101648 116364 101640 116358 101636 67904 99504 115292 72512 67872 116444 115278 72480 101784 116430 72464 67848 99462 72456 101766 67842 68016 99548 72624 67992 99534 72600 101838 72588 67974 68060 72668 68046 72654 118432 124760 127918 118416 124748 118408 124742 118404 118402 101536 116312 105888 101520 116300 105872 118476 116294 105864 101508 105860 101506 105858 67744 99416 72096 67728 116334 80800 72080 101580 99398 80784 105932 67716 80776 72068 67714 72066 67800 99438 72152 67788 80856 72140 67782 80844 72134 67822 72174 80878 126800 128940 126792 128934 126788 126786 118352 124716 122576 126828 124710 122568 126822 122564 118338 122562 101456 116268 105680 101448 116262 114128 105672 118374 114120 122598 101442 114116 105666 114114 67664 99372 71888 67656 99366 80336 71880 101478 97232 80328 105702 67650 97224 114150 71874 97220 67692 71916 67686 80364 71910 97260 80358 97254 126760 128918 126756 126754 118312 124694 122472 126774 122468 118306 122466 101416 116246 105576 101412 113896 105572 101410 113892 105570 113890 67624 99350 71784 101430 80104 71780 67618 96744 80100 71778 96740 80098 96738 71798 96758 126738 122420 122418 105524 113780 113778 71732 79988 96500 96498 66880 66848 98968 66832 66824 66820 66992 66968 66956 66950 67036 67022 100000 99984 115532 99976 115526 99972 99970 66720 98904 69024 100056 98892 69008 100044 69000 100038 68996 66690 68994 66776 98926 69080 100078 69068 66758 69062 66798 69102 116560 116552 116548 116546 99920 102096 116588 115494 102088 116582 102084 99906 102082 66640 68816 66632 98854 73168 68808 66628 73160 68804 66626 73156 68802 66668 68844 66662 73196 68838 73190 124840 124836 124834 116520 118632 124854 118628 116514 118626 99880 115478 101992 116534 106216 101988 99874 106212 101986 106210 66600 98838 68712 99894 72936 68708 66594 81384 72932 68706 81380 72930 66614 68726 72950 81398 128980 128978 124820 126900 124818 126898 116500 118580 116498 122740 118578 122738 99860 101940 99858 106100 101938 114420 ] [ 128352 129720 125504 128304 129692 125472 128280 129678 125456 128268 125448 128262 125444 125792 128440 129758 120384 125744 128412 120352 125720 128398 120336 125708 120328 125702 120324 120672 125880 128478 110144 120624 125852 110112 120600 125838 110096 120588 110088 120582 110084 110432 120760 125918 89664 110384 120732 89632 110360 120718 89616 110348 89608 110342 89952 110520 120798 89904 110492 89880 110478 89868 90040 110558 90012 89998 125248 128176 129628 125216 128152 129614 125200 128140 125192 128134 125188 125186 119616 125360 128220 119584 125336 128206 119568 125324 119560 125318 119556 119554 108352 119728 125404 108320 119704 125390 108304 119692 108296 119686 108292 108290 85824 108464 119772 85792 108440 119758 85776 108428 85768 108422 85764 85936 108508 85912 108494 85900 85894 85980 85966 125088 128088 129582 125072 128076 125064 128070 125060 125058 119200 125144 128110 119184 125132 119176 125126 119172 119170 107424 119256 125166 107408 119244 107400 119238 107396 107394 83872 107480 119278 83856 107468 83848 107462 83844 83842 83928 107502 83916 83910 83950 125008 128044 125000 128038 124996 124994 118992 125036 118984 125030 118980 118978 106960 119020 106952 119014 106948 106946 82896 106988 82888 106982 82884 82882 82924 82918 124968 128022 124964 124962 118888 124982 118884 118882 106728 118902 106724 106722 82408 106742 82404 82402 124948 124946 118836 118834 106612 106610 124224 127664 129372 124192 127640 129358 124176 127628 124168 127622 124164 124162 117568 124336 127708 117536 124312 127694 117520 124300 117512 124294 117508 117506 104256 117680 124380 104224 117656 124366 104208 117644 104200 117638 104196 104194 77632 104368 117724 77600 104344 117710 77584 104332 77576 104326 77572 77744 104412 77720 104398 77708 77702 77788 77774 128672 129880 93168 128656 129868 92664 128648 129862 92412 128644 128642 124064 127576 129326 126368 124048 129902 126352 128716 127558 126344 124036 126340 124034 126338 117152 124120 127598 121760 117136 124108 121744 126412 124102 121736 117124 121732 117122 121730 103328 117208 124142 112544 103312 117196 112528 121804 117190 112520 103300 112516 103298 112514 75680 103384 117230 94112 75664 103372 94096 112588 103366 94088 75652 94084 75650 75736 103406 94168 75724 94156 75718 94150 75758 128592 129836 91640 128584 129830 91388 128580 91262 128578 123984 127532 126160 123976 127526 126152 128614 126148 123970 126146 116944 124012 121296 116936 124006 121288 126182 121284 116930 121282 102864 116972 111568 102856 116966 111560 121318 111556 102850 111554 74704 102892 92112 74696 102886 92104 111590 92100 74690 92098 74732 92140 74726 92134 128552 129814 90876 128548 90750 128546 123944 127510 126056 128566 126052 123938 126050 116840 123958 121064 116836 121060 116834 121058 102632 116854 111080 121078 111076 102626 111074 74216 102646 91112 74212 91108 74210 91106 74230 91126 128532 90494 128530 123924 126004 123922 126002 116788 120948 116786 120946 102516 110836 102514 110834 73972 90612 73970 90610 128522 123914 125978 116762 120890 102458 110714 123552 127320 129198 123536 127308 123528 127302 123524 123522 116128 123608 127342 116112 123596 116104 123590 116100 116098 101280 116184 123630 101264 116172 101256 116166 101252 101250 71584 101336 116206 71568 101324 71560 101318 71556 71554 71640 101358 71628 71622 71662 127824 129452 79352 127816 129446 79100 127812 78974 127810 123472 127276 124624 123464 127270 124616 127846 124612 123458 124610 115920 123500 118224 115912 123494 118216 124646 118212 115906 118210 100816 115948 105424 100808 115942 105416 118246 105412 100802 105410 70608 100844 79824 70600 100838 79816 105446 79812 70594 79810 70636 79852 70630 79846 129960 95728 113404 129956 95480 113278 129954 95356 95294 127784 129430 78588 128872 129974 95996 78462 128868 127778 95870 128866 123432 127254 124520 123428 126696 128886 123426 126692 124514 126690 115816 123446 117992 115812 122344 117988 115810 122340 117986 122338 100584 115830 104936 100580 113640 104932 100578 113636 104930 113634 70120 100598 78824 70116 96232 78820 70114 96228 78818 96226 70134 78838 129940 94968 113022 129938 94844 94782 127764 78206 128820 127762 95102 128818 123412 124468 123410 126580 124466 126578 115764 117876 115762 122100 117874 122098 100468 104692 100466 113140 104690 113138 69876 78324 69874 95220 78322 95218 129930 94588 94526 127754 128794 123402 124442 126522 115738 117818 121978 100410 104570 112890 69754 78074 94714 94398 123216 127148 123208 127142 123204 123202 115408 123244 115400 123238 115396 115394 99792 115436 99784 115430 99780 99778 68560 99820 68552 99814 68548 68546 68588 68582 127400 129238 72444 127396 72318 127394 123176 127126 123752 123172 123748 123170 123746 115304 123190 116456 115300 116452 115298 116450 99560 115318 101864 99556 101860 99554 101858 68072 99574 72680 68068 72676 68066 72674 68086 72694 129492 80632 105854 129490 80508 80446 127380 72062 127924 127378 80766 127922 123156 123700 123154 124788 123698 124786 115252 116340 115250 118516 116338 118514 99444 101620 99442 105972 101618 105970 67828 72180 67826 80884 72178 80882 97008 114044 96888 113982 96828 96798 129482 80252 130010 97148 80190 97086 127370 127898 128954 123146 123674 124730 126842 115226 116282 118394 122618 99386 101498 105722 114170 67706 71930 80378 96632 113854 96572 96542 80062 96702 96444 96414 96350 123048 123044 123042 115048 123062 115044 115042 99048 115062 99044 99042 67048 99062 67044 67042 67062 127188 68990 127186 123028 123316 123026 123314 114996 115572 114994 115570 98932 100084 98930 100082 66804 69108 66802 69106 129258 73084 73022 127178 127450 123018 123290 123834 114970 115514 116602 98874 99962 102138 66682 68858 73210 81272 106174 81212 81182 72894 81342 97648 114364 97592 114334 97564 97550 81084 97724 81054 97694 97464 114270 97436 97422 80990 97502 97372 97358 97326 114868 114866 98676 98674 66292 66290 123098 114842 115130 98618 99194 66170 67322 69310 73404 73374 81592 106334 81564 81550 73310 81630 97968 114524 97944 114510 97932 97926 81500 98012 81486 97998 97880 114478 97868 97862 81454 97902 97836 97830 69470 73564 73550 81752 106414 81740 81734 73518 81774 81708 81702 ] [ 109536 120312 86976 109040 120060 86496 108792 119934 86256 108668 86136 129744 89056 110072 129736 88560 109820 129732 88312 109694 129730 88188 128464 129772 89592 128456 129766 89340 128452 89214 128450 125904 128492 125896 128486 125892 125890 120784 125932 120776 125926 120772 120770 110544 120812 110536 120806 110532 84928 108016 119548 84448 107768 119422 84208 107644 84088 107582 84028 129640 85488 108284 129636 85240 108158 129634 85116 85054 128232 129654 85756 128228 85630 128226 125416 128246 125412 125410 119784 125430 119780 119778 108520 119798 108516 108514 83424 107256 119166 83184 107132 83064 107070 83004 82974 129588 83704 107390 129586 83580 83518 128116 83838 128114 125172 125170 119284 119282 107508 107506 82672 106876 82552 106814 82492 82462 129562 82812 82750 128058 125050 119034 82296 106686 82236 82206 82366 82108 82078 76736 103920 117500 76256 103672 117374 76016 103548 75896 103486 75836 129384 77296 104188 129380 77048 104062 129378 76924 76862 127720 129398 77564 127716 77438 127714 124392 127734 124388 124386 117736 124406 117732 117730 104424 117750 104420 104418 112096 121592 126334 92608 111856 121468 92384 111736 121406 92272 111676 92216 111646 92188 75232 103160 117118 93664 74992 103036 93424 112252 102974 93304 74812 93244 74782 93214 129332 75512 103294 129908 129330 93944 75388 129906 93820 75326 93758 127604 75646 128756 127602 94078 128754 124148 126452 124146 126450 117236 121844 117234 121842 103412 103410 91584 111344 121212 91360 111224 121150 91248 111164 91192 111134 91164 91150 74480 102780 91888 74360 102718 91768 111422 91708 74270 91678 129306 74620 129850 92028 74558 91966 127546 128634 124026 126202 116986 121338 102906 90848 110968 121022 90736 110908 90680 110878 90652 90638 74104 102590 91000 74044 90940 74014 90910 74174 91070 90480 110780 90424 110750 90396 90382 73916 90556 73886 90526 90296 110686 90268 90254 73822 90334 90204 90190 71136 101112 116094 70896 100988 70776 100926 70716 70686 129204 71416 101246 129202 71292 71230 127348 71550 127346 123636 123634 116212 116210 101364 101362 79296 105200 118140 79072 105080 118078 78960 105020 78904 104990 78876 78862 70384 100732 79600 70264 100670 79480 105278 79420 70174 79390 129178 70524 129466 79740 70462 79678 127290 127866 123514 124666 115962 118266 100858 113376 122232 126654 95424 113264 122172 95328 113208 122142 95280 113180 95256 113166 95244 78560 104824 117950 95968 78448 104764 95856 113468 104734 95800 78364 95772 78350 95758 70008 100542 78712 69948 96120 78652 69918 96060 78622 96030 70078 78782 96190 94912 113008 122044 94816 112952 122014 94768 112924 94744 112910 94732 94726 78192 104636 95088 78136 104606 95032 113054 95004 78094 94990 69820 78268 69790 95164 78238 95134 94560 112824 121950 94512 112796 94488 112782 94476 94470 78008 104542 94648 77980 94620 77966 94606 69726 78046 94686 94384 112732 94360 112718 94348 94342 77916 94428 77902 94414 94296 112686 94284 94278 77870 94318 94252 94246 68336 99708 68216 99646 68156 68126 68476 68414 127162 123258 115450 99834 72416 101752 116414 72304 101692 72248 101662 72220 72206 67960 99518 72568 67900 72508 67870 72478 68030 72638 80576 105840 118460 80480 105784 118430 80432 105756 80408 105742 80396 80390 72048 101564 80752 71992 101534 80696 71964 80668 71950 80654 67772 72124 67742 80828 72094 80798 114016 122552 126814 96832 113968 122524 96800 113944 122510 96784 113932 96776 113926 96772 80224 105656 118366 97120 80176 105628 97072 114076 105614 97048 80140 97036 80134 97030 71864 101470 80312 71836 97208 80284 71822 97180 80270 97166 67678 71902 80350 97246 96576 113840 122460 96544 113816 122446 96528 113804 96520 113798 96516 96514 80048 105564 96688 80024 105550 96664 113870 96652 80006 96646 71772 80092 71758 96732 80078 96718 96416 113752 122414 96400 113740 96392 113734 96388 96386 79960 105518 96472 79948 96460 79942 96454 71726 79982 96494 96336 113708 96328 113702 96324 96322 79916 96364 79910 96358 96296 113686 96292 96290 79894 96310 66936 99006 66876 66846 67006 68976 100028 68920 99998 68892 68878 66748 69052 66718 69022 73056 102072 116574 73008 102044 72984 102030 72972 72966 68792 99934 73144 68764 73116 68750 73102 66654 68830 73182 81216 106160 118620 81184 106136 118606 81168 106124 81160 106118 81156 81154 72880 101980 81328 72856 101966 81304 106190 81292 72838 81286 68700 72924 68686 81372 72910 81358 114336 122712 126894 114320 122700 114312 122694 114308 114306 81056 106072 118574 97696 81040 106060 97680 114380 106054 97672 81028 97668 81026 97666 72792 101934 81112 72780 97752 81100 72774 97740 81094 97734 68654 72814 81134 97774 114256 122668 114248 122662 114244 114242 80976 106028 97488 80968 106022 97480 114278 97476 80962 97474 72748 81004 72742 97516 80998 97510 114216 122646 114212 114210 80936 106006 97384 80932 97380 80930 97378 72726 80950 97398 114196 114194 80916 97332 80914 97330 66236 66206 67256 99166 67228 67214 66142 67294 69296 100188 69272 100174 69260 69254 67164 69340 67150 69326 73376 102232 116654 73360 102220 73352 102214 73348 73346 69208 100142 73432 102254 73420 69190 73414 67118 69230 73454 106320 118700 106312 118694 106308 106306 73296 102188 81616 106348 102182 81608 73284 81604 73282 81602 69164 73324 69158 81644 73318 81638 122792 126934 122788 122786 106280 118678 114536 106276 114532 106274 114530 73256 102166 81512 73252 98024 81508 73250 98020 81506 98018 69142 73270 81526 98038 122772 122770 106260 114484 106258 114482 73236 81460 73234 97908 81458 97906 122762 106250 114458 73226 81434 97850 66396 66382 67416 99246 67404 67398 66350 67438 69456 100268 69448 100262 69444 69442 67372 69484 67366 69478 102312 116694 102308 102306 69416 100246 73576 102326 73572 69410 73570 67350 69430 73590 118740 118738 102292 106420 102290 106418 69396 73524 69394 81780 73522 81778 118730 102282 106394 69386 73498 81722 66476 66470 67496 99286 67492 67490 66454 67510 100308 100306 67476 69556 67474 69554 116714 ] ] def % Row address patterns /raps [ [ % Left and right 802 930 946 818 882 890 826 954 922 986 970 906 778 794 786 914 978 982 980 916 948 932 934 942 940 936 808 812 814 806 822 950 918 790 788 820 884 868 870 878 876 872 840 856 860 862 846 844 836 838 834 866 ] [ % Centre 718 590 622 558 550 566 534 530 538 570 562 546 610 626 634 762 754 758 630 628 612 614 582 578 706 738 742 740 748 620 556 552 616 744 712 716 708 710 646 654 652 668 664 696 688 656 720 592 600 604 732 734 ] ] def % Return the 17 bits for a codeword in a given cluster /cwtobits { clusters exch get exch get /v exch def [ 17 {0} repeat v 2 17 string cvrs {48 sub} forall ] dup length 17 sub 17 getinterval } bind def % Return the 10 bits for a row address pattern /raptobits { raps exch get exch get /v exch def [ 10 {0} repeat v 2 10 string cvrs {48 sub} forall ] dup length 10 sub 10 getinterval } bind def % Populate bitmap for the image /rwid [38 55 82 99] c 1 sub get def c 3 eq cca and {/rwid 72 def} if /pixs rwid r mul array def 0 1 r 1 sub { /i exch def /clst i rapl add 1 sub 3 mod def pixs rwid i mul [ c 1 eq { i rapl add 1 sub 52 mod 0 raptobits aload pop cws i get clst cwtobits aload pop i rapr add 1 sub 52 mod 0 raptobits aload pop } if c 2 eq { i rapl add 1 sub 52 mod 0 raptobits aload pop cws i 2 mul get clst cwtobits aload pop cws i 2 mul 1 add get clst cwtobits aload pop i rapr add 1 sub 52 mod 0 raptobits aload pop } if c 3 eq { cca not { i rapl add 1 sub 52 mod 0 raptobits aload pop } if cws i 3 mul get clst cwtobits aload pop i rapc add 1 sub 52 mod 1 raptobits aload pop cws i 3 mul 1 add get clst cwtobits aload pop cws i 3 mul 2 add get clst cwtobits aload pop i rapr add 1 sub 52 mod 0 raptobits aload pop } if c 4 eq { i rapl add 1 sub 52 mod 0 raptobits aload pop cws i 4 mul get clst cwtobits aload pop cws i 4 mul 1 add get clst cwtobits aload pop i rapc add 1 sub 52 mod 1 raptobits aload pop cws i 4 mul 2 add get clst cwtobits aload pop cws i 4 mul 3 add get clst cwtobits aload pop i rapr add 1 sub 52 mod 0 raptobits aload pop } if 1 ] putinterval } for % Return the arguments << /ren //renmatrix /pixs pixs /pixx rwid /pixy r /height r 72 div rowmult mul /width rwid 72 div /opt options >> dontdraw not //renmatrix if end } bind def /micropdf417 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER micropdf417-- postscriptbarcode-2014-03-12/src/msi.ps000066400000000000000000000136611231007474100175650ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER msi-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: MSI Modified Plessey % --EXAM: 0123456789 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /msi { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includecheck false def % Enable/disable checkdigit /includetext false def % Enable/disable text /includecheckintext false def /checktype (mod10) def /badmod11 false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Create an array containing the character mappings /encs [ (12121212) (12121221) (12122112) (12122121) (12211212) (12211221) (12212112) (12212121) (21121212) (21121221) (21) (121) ] def % Create a string of the available characters /barchars (0123456789) def /barlen barcode length def % Length of the code /txtlen barlen def /mod10 { /code exch def 0 0 code {48 sub exch 10 mul add exch} forall pop 2 mul 0 {1 index 10 mod add exch 10 idiv dup 0 eq {pop exit} if exch} loop 0 0 code {48 sub add exch} forall exch pop add 10 mod 10 exch sub 10 mod code length 1 add string dup 0 code putinterval dup code length 4 -1 roll 48 add put } bind def /mod11 { /code exch def code length 1 sub code {48 sub exch dup 1 sub exch 6 mod 2 add exch} forall pop 0 code length {3 1 roll mul add} repeat 11 mod 11 exch sub 11 mod dup 10 eq badmod11 and { pop code length 2 add string dup 0 code putinterval dup code length (10) putinterval } { code length 1 add string dup 0 code putinterval dup code length 4 -1 roll 48 add put } ifelse } bind def /ncrmod11 { /code exch def code length 1 sub code {48 sub exch dup 1 sub exch 8 mod 2 add exch} forall pop 0 code length {3 1 roll mul add} repeat 11 mod 11 exch sub 11 mod dup 10 eq badmod11 and { pop code length 2 add string dup 0 code putinterval dup code length (10) putinterval } { code length 1 add string dup 0 code putinterval dup code length 4 -1 roll 48 add put } ifelse } bind def % Calculate checksum includecheck { checktype (mod10) eq {barcode mod10} if checktype (mod1010) eq {barcode mod10 mod10} if checktype (mod11) eq {barcode mod11} if checktype (ncrmod11) eq {barcode ncrmod11} if checktype (mod1110) eq {barcode mod11 mod10} if checktype (ncrmod1110) eq {barcode ncrmod11 mod10} if /barcode exch def /barlen barcode length def includecheckintext {/txtlen barlen def} if } if /sbs barlen 8 mul 5 add string def /txt barlen array def % Put start character sbs 0 encs 10 get putinterval 0 1 barlen 1 sub { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 8 mul 2 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 12 mul 3 add textyoffset textfont textsize] put } for % Put the end character sbs barlen 8 mul 2 add encs 11 get putinterval % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] includetext { /txt txt 0 txtlen getinterval } if /opt options >> dontdraw not //renlinear if end } bind def /msi dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER msi-- postscriptbarcode-2014-03-12/src/olddocs/000077500000000000000000000000001231007474100200515ustar00rootroot00000000000000postscriptbarcode-2014-03-12/src/olddocs/postscriptbarcode.tex000066400000000000000000000744071231007474100243410ustar00rootroot00000000000000% This documentation requires the PSTricks package called pst-barcode: % http://www.tug.org/tex-archive/graphics/pstricks/contrib/pst-barcode/ % $Id$ \documentclass []{article} \parindent 0.0cm \parskip 0.2cm \usepackage{pslatex} \usepackage{graphicx} \usepackage{pst-barcode} \title{Barcode Writer in Pure Postscript} \author{Terry Burton $<$tez@terryburton.co.uk$>$} \begin{document} \pagenumbering{roman} \maketitle \begin{abstract} This document describes the implementation of the Barcode Writer in Pure Postscript project, explains by example how to use this to generate your own barcodes, and provides a simple reference to using the symbologies that it supports. \end{abstract} Note: Despite the date on this document, the information contained herein is somewhat out of date. A much more thorough and up-to-date reference to this project is available in the wiki, \mbox{http://www.terryburton.co.uk/barcodewriter/wiki/}. This wiki provides a collaborative approach to documentation that allows users to add and edit content collectively. \newpage \tableofcontents \newpage \pagenumbering{arabic} \section{Introduction} Barcode Writer in Pure Postscript is an award-winning open source barcode maker, as used by NASA, that facilitates the printing of all major barcode symbologies entirely within level 2 PostScript, ideal for variable data printing. The complete process of generating printed barcodes is performed entirely within the printer (or print system) so that it is no longer the responsibility of your application or a library. There is no need for any barcode fonts and the flexibility offered by direct PostScript means you can avoid re-implementing barcode generator code, or migrating to new libraries, whenever your project language needs change. To make it as easy as possible to incorporate this project into your own systems, whether they be freely available or proprietary, it is licensed under the permissive MIT/X-Consortium License given in section \ref{license}. The project homepage is at http://www.terryburton.co.uk/barcodewriter. This is the main resource for the project providing the latest downloads of code and documentation, as well as access to the support and development mailing list. \section*{Acknowledgements} The author wishes to take this opportunity to thank the growing community of volunteers that have helped to develop, test and document this project. Most especially Michael Landers and Ross McFarland for freely donating their encoder implementations early in the life of the project. Also, special appreciation is extended to the developers that have created the front-ends necessary to make the code valuable to ordinary computer users, especially Petr Van\v{e}k, Dominik Seichter and Herbert Vo\ss. \newpage \section{Code Commentary} This commentary assumes familiarity with the PostScript language\footnote{The PostScript Language Tutorial and Cookbook (a.k.a. the Blue Book), which is freely available online, serves as both a useful tutorial and reference manual to the language.}. The code is split cleanly into two types of procedure: \begin{description} \item[The encoders]{Each of these represents a barcode symbology\footnote{By symbology we mean an accepted standard for representation of data as a barcode}, e.g. EAN-13 or Code-128. It takes a string containing the barcode data and a string containing a list of options that modify the output of the encoder. It generates a structured representation of the barcode and its text for the symbology, including the calculation of check digits where necessary.} \item[The renderer]{This takes the output of an encoder and generates a visual representation of the barcode.} \end{description} This means that all barcodes can be generated simply in a similar manner: \begin{verbatim} (78858101497) (includetext height=0.6) upca barcode (0123456789) (includecheck) interleaved2of5 barcode \end{verbatim} \subsection{The Barcode Data Structure} \label{datastructure} The following table describes the structured representation of a barcode that is passed by an encoder to the renderer as a dictionary when the PostScript is executed. \begin{center} \begin{tabular}{l|c|p{6.5cm}} Element & Key & Value \\ \hline Space bar succession & \texttt{sbs} & Array containing the widths, in points, of each bar and space, starting with the leftmost bar.\\ Bar height succession & \texttt{bhs} & Array containing the height of each bar in inches, starting with the leftmost bar.\\ Bar base succession & \texttt{bbs} & Array containing the offset of the base of each bar in inches, starting with the leftmost bar.\\ Human readable text & \texttt{txt} & Array of arrays that contain the character, position, height, font and scale factor (font size), in points, for each of the visible text characters.\\ Renderer options & \texttt{opt} & String containing the user-defined renderer options. \end{tabular} \end{center} Other keys and values may be contained in this structure that override the render defaults with encoder specific defaults. \subsection{An Encoder} The procedure labelled code2of5 is a simple example of an encoder, which we will now consider. Its purpose is to accept as input a string containing the barcode contents and a string containing a list of options, and to process these in a way that is specific to this encoder, and finally to output an instance of the dictionary-based data structure described in section \ref{datastructure} that represents the barcode contents in the Code 2 of 5 symbology. As with all of the encoders, the input string is assumed to be valid for the corresponding symbology, otherwise the behaviour is undefined. The variables that we use in this procedure are confined to local scope by declaring the procedure as follows: \begin{verbatim} /code2of5 { 0 begin ... end } bind def /code2of5 load 0 1 dict put \end{verbatim} We start by immediately reading the contents strings that are passed as arguments to this procedure by the user. We duplicate the options string because it is later passed unamended to the renderer. \begin{verbatim} /options exch def /useropts options def /barcode exch def \end{verbatim} We initialise a few default variables. Those variables corresponding to options that can be enabled with the options argument are initially set to false. \begin{verbatim} /includetext false def /textfont /Courier def /textsize 10 def /textpos -7 def /height 1 def \end{verbatim} The options string is tokenised with each successive token defining either a name value pair which we instantiate or a lone variable that we define as true, allowing us to override the given default variables given above. \begin{verbatim} options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop \end{verbatim} Since any user given options create variables that are strings we need to convert them back to their intended types. \begin{verbatim} /textfont textfont cvlit def /textsize textsize cvr def /textpos textpos cvr def /height height cvr def \end{verbatim} We then create an array of string encodings for each of the available characters which we then declare in another string. This information can be derived from careful reading of the relevant specification, although this is often surprisingly difficult to obtain. \begin{verbatim} /encs [ (1111313111) (3111111131) (1131111131) (3131111111) (1111311131) (3111311111) (1131311111) (1111113131) (3111113111) (1131113111) (313111) (311131) ] def /barchars (0123456789) def \end{verbatim} We now store the length of the content string and calculate the total number of bars and spaces in the resulting barcode. We initialise a string of size dependant on this length into which we will build the space bar succession. Similarly, we create an array into which we will add the human readable text information. \begin{verbatim} /barlen barcode length def /sbs barlen 10 mul 12 add string def /txt barlen array def \end{verbatim} We now begin to populate the space bar succession by adding the encoding of the start character to the beginning. \begin{verbatim} sbs 0 encs 10 get putinterval \end{verbatim} We now enter the main loop which iterates over the content string from start to finish, looking up the encoding for each character, adding this to the space bar succession. It is important to understand how the encoding for a given character is derived. Firstly, given a character, we find its position in the string of all available characters. We then use this position to index the array of character encodings to obtain the encoding for the given character, which is added to the space/bar succession. Likewise, the character is added to the array of human readable text along with positioning and font information. \begin{verbatim} 0 1 barlen 1 sub { /i exch def barcode i 1 getinterval barchars exch search pop length /indx exch def pop pop /enc encs indx get def sbs i 10 mul 6 add enc putinterval txt i [barcode i 1 getinterval i 14 mul 10 add -7 textfont textsize] put } for \end{verbatim} The encoding for the end character is obtained and added to the end of the space bar succession. \begin{verbatim} sbs barlen 10 mul 6 add encs 11 get putinterval \end{verbatim} Finally we prepare to push a dictionary containing the space bar succession (and any additional information defined in section \ref{datastructure}) that will be passed to the renderer. \begin{verbatim} /retval 1 dict def retval (sbs) [sbs {48 sub} forall] put retval (bhs) [sbs length 1 add 2 idiv {height} repeat] put retval (bbs) [sbs length 1 add 2 idiv {0} repeat] put includetext { retval (txt) txt put } if retval (opt) useropts put retval \end{verbatim} \subsection{The Renderer} This description is out of date. The procedure labelled barcode is known as the renderer, which we now consider. Its purpose is to accept as input an instance of the dictionary-based data structure described in section \ref{datastructure} that represents a barcode in some arbitrary symbology and produce a visual rendering of this at the current point. The variables that we use in this procedure are confined to local scope by declaring the procedure as follows: \begin{verbatim} /barcode { 0 begin ... end } bind def /barcode load 0 1 dict put \end{verbatim} We then immediately read the dictionary-based data structure which is passed as a single argument to this procedure by an encoder, from which we extract the space bar succession, bar height succession and bar base succession. \begin{verbatim} /args exch def /sbs args (sbs) get def /bhs args (bhs) get def /bbs args (bbs) get def /renderopts args (opt) get def \end{verbatim} We attempt to extract from the dictionary the array containing the information about human readable text. However, this may not exist in the dictionary in which case we create a default empty array. \begin{verbatim} args (txt) known { /txt args (txt) get def } { /txt [] def } ifelse \end{verbatim} Just as with the encoders, we read and tokenise the supplied options allowing specific rendering options to be overridden. \begin{verbatim} /inkspread 0.15 def renderopts { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop /inkspread inkspread cvr def \end{verbatim} We have extracted or derived all of the necessary information from the input, and now use the space bar succession, bar height succession and bar base succession in calculations that create a single array containing elements that give coordinates for each of the bars in the barcode. We start by creating a bars array that is half the length of the space bar succession. We build this by repeatedly adding array elements that contain the height, x-coordinate, y-coordinate and width of single bars. The height and y-coordinates are read from the bar height succession and the bar base succession, respectively, whilst the x-coordinate and the width are made from a calculation of the total indent, based on the space bar succession and a compensating factor that accounts for ink spread. \begin{verbatim} /bars sbs length 1 add 2 idiv array def /x 0.00 def 0 1 sbs length 1 sub { /i exch def /d sbs i get 48 sub def i 2 mod 0 eq { /h bhs i 2 idiv get 72 mul def /c d 2 div x add def /y bbs i 2 idiv get 72 mul def /w d inkspread sub def bars i 2 idiv [h c y w] put } if /x x d add def } for \end{verbatim} Finally, we perform the actual rendering in two phases. Firstly we use the contents of the bars array that we just built to render each of the bars, and secondly we use the contents of the text array extracted from the input argument to render the text. We make an efficiency saving here by not performing loading and rescaling of a font if the scale factor for the font size is 0. The graphics state is preserved across calls to this procedure to prevent unexpected interference with the users environment. \begin{verbatim} gsave bars { {} forall setlinewidth moveto 0 exch rlineto stroke } forall txt { {} forall dup 0 ne {exch findfont exch scalefont setfont} {pop pop} ifelse moveto show } forall grestore \end{verbatim} \subsection{Notes Regarding Coding Style} PostScript programming veterans are encouraged to remember that the majority of people who read the code are likely to have little, if any, prior knowledge of the language. To encourage development, the code has been written with these goals in mind: \begin{itemize} \item[-]{That it be easy to use and to comprehend} \item[-]{That it be easy to modify and enhance} \end{itemize} To this end the following points should be observed for all new code submissions: \begin{itemize} \item[-]{New encoders should be based on the code of a similar existing encoder} \item[-]{Include comments where these clarify the operations involved, particular where something unexpected happens} \item[-]{Prefer simplicity to efficency and clarity to obfuscation, except where this will be a problem} \end{itemize} \newpage \section{Resources and Examples} There are several ways of using the PostScript within your own projects. Many example uses of the code for various languages and platforms can be downloaded from the code repository at \mbox{http://www.terryburton.co.uk/barcodewriter/files/repository/} \subsection{Language Specific APIs} No language specific APIs exist yet. If you have experience writing API specifications and would like to help create an API design for the project then contact the author. \subsection{Front Ends} The following is a list of the front ends available for the project. \begin{description} \item[Web based generator]{ \mbox{http://www.terryburton.co.uk/barcodewriter/generator/} } \item[Scribus] Scribus versions 1.3 and later come with a Barcode Maker plugin based on this project.\\ \mbox{http://www.scribus.org.uk} \item[KBarcode] KBarcode versions 2 and later make use of this project.\\ \mbox{http://www.kbarcode.net} \item[pst-barcode]{ pst-barcode is a PSTricks package for \LaTeX.\\ \mbox{http://www.ctan.org/tex-archive/graphics/pstricks/contrib/pst-barcode/} } \end{description} \newpage \subsection{Installing the Barcode Generation Capability into a Printer's Virtual Machine} Most genuine PostScript printers allow procedures to be defined such that they persist across different jobs through the use of the \texttt{exitserver} command. If your printer supports this then you will be able to print the main code containing the definitons of all the encoders and the renderer once, e.g. soon after the device is turned on, and later omit these definitons from each of the barcode documents that you print. To install the barcode generation capabilities into the virtual machine of a PostScript printer you need to uncomment a line near the top of the code so that it reads: \begin{verbatim} serverdict begin 0 exitserver \end{verbatim} Once this code is printed the procedural definitions for the encoders and the renderer will remain defined across all jobs until the device is reset either by power-cycling or with the following code: \begin{verbatim} serverdict begin 0 exitserver systemdict /quit get exec \end{verbatim} \newpage \subsection{Hints for Generating Precisely the Required Symbol} To create a barcode to a required width and height, without stretching the human readable text, perform the following steps. Create a basic symbol by choosing the relevant data and text options for the corresponding encoder, and position this using \texttt{translate} such that the \emph{bottom-left} corner of the bars is in the required location: \begin{verbatim} gsave 430 750 translate (977147396801) (includetext) ean13 barcode grestore \end{verbatim} Find the uniform scale factor (same value for x and y) that makes your output of the required \emph{width}: \begin{verbatim} gsave 430 750 translate 1.3 1.3 scale % <-- Add a line like this (977147396801) (includetext) ean13 barcode grestore \end{verbatim} Add a height option that adjusts the bar \emph{height} appropriately (taking the scaling into account): \begin{verbatim} gsave 430 750 translate 1.3 1.3 scale % Added height=0.8 option to adjust height (977147396801) (includetext height=0.8) ean13 barcode grestore \end{verbatim} The result should now be of the intended dimensions at the desired location with properly scaled text. You can now add any additional options to customise the symbol. \newpage \subsection{Printing in Perl} This example will print a page of EAN-13s ranging between two given values when called from a shell like this: \begin{verbatim} $ ./ean13s.pl 978186074271 978186074292 | lpr \end{verbatim} The contents of the script \texttt{ean13s.pl} is as follows: \begin{verbatim} #!/usr/bin/perl -w use strict; die 'Requires two arguments' if (@ARGV!=2); open(PS,'barcode.ps') || die 'File not found'; $_=join('',); close(PS); print "%!PS-Adobe-2.0\n"; m/ %\ --BEGIN\ TEMPLATE-- (.*) %\ --END\ TEMPLATE-- /sx || die 'Unable to parse out the template'; print $1; for (my $i=$ARGV[0], my $j=0; $i<$ARGV[1]; $i++, $j++) { my $x=100+150*(int($j/7)); my $y=100+100*($j%7); print "gsave\n"; print "$x $y translate\n"; print "($i) (includetext) ean13 barcode\n"; print "grestore\n"; } print "showpage\n"; \end{verbatim} \newpage \section{Supported Symbologies} The following section shows the symbologies that are supported by the encoders, including the available features for each. This list may not be up-to-date. If it does not contain any of the formats or features that you require then check the project source code or try the support mailing list. \subsection{EAN-13} \begin{description} \item[Data]{12 or 13 digits} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \end{tabular} } \item[Notes]{ If just 12 digits are entered then the check digit is calculated automatically } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(3,1in) \psbarcode{9781860742712}{includetext guardwhitespace}{ean13} \end{pspicture} %} \caption{\texttt{(9781860742712) (includetext guardwhitespace) ean13 barcode}} \end{figure} \subsection{EAN-8} \begin{description} \item[Data]{8 digits} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \end{tabular} } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(2,0.6in) \psbarcode{12345678}{includetext guardwhitespace height=0.6}{ean8} \end{pspicture} %} \caption{\texttt{(12345678) (includetext guardwhitespace height=0.6) ean8 barcode}} \end{figure} \newpage \subsection{UPC-A} \begin{description} \item[Data]{11 or 12 digits} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \end{tabular} } \item[Notes]{ If just 11 digits are entered then the check digit is calculated automatically } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(3,1in) \psbarcode{78858101497}{includetext}{upca} \end{pspicture} %} \caption{\texttt{(78858101497) (includetext) upca barcode}} \end{figure} \subsection{UPC-E} \begin{description} \item[Data]{7 or 8 digits} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \end{tabular} } \item[Notes]{ If just 7 digits are entered then the check digit is calculated automatically } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(2,1in) \psbarcode{0123456}{includetext}{upce} \end{pspicture} %} \caption{\texttt{(0123456) (includetext) upce barcode}} \end{figure} \newpage \subsection{EAN-5} \begin{description} \item[Data]{5 digits} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \end{tabular} } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(2,1in) \psbarcode{90200}{includetext guardwhitespace}{ean5} \end{pspicture} %} \caption{\texttt{(90200) (includetext guardwhitespace) ean5 barcode}} \end{figure} \subsection{EAN-2} \begin{description} \item[Data]{2 digits} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \end{tabular} } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(1,1in) \psbarcode{38}{includetext guardwhitespace}{ean2} \end{pspicture} %} \caption{\texttt{(38) (includetext guardwhitespace) ean2 barcode}} \end{figure} \newpage \subsection{ISBN} \begin{description} \item[Data]{9 or 10 digits seperated appropriately with dashes} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \end{tabular} } \item[Notes]{ If just 9 digits are entered then the human readable ISBN check digit is calculated automatically } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(3,1in) \psbarcode{1-58880-149}{includetext guardwhitespace}{isbn} \end{pspicture} %} \caption{\texttt{(1-58880-149) (includetext) isbn barcode}} \end{figure} \subsection{Code-39} \begin{description} \item[Data]{ Variable number of characters, digits and any of the symbols \texttt{-.\@ *\$/+\%}. } \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includecheck} & Enable check digit\\ \texttt{includetext} & Enable human readable text\\ \texttt{includecheckintext} & Make check digit visible in text\\ \end{tabular} } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(5,1in) \psbarcode{CODE-39}{includecheck includetext}{code39} \end{pspicture} %} \caption{\texttt{(CODE-39) (includecheck includetext) code39 barcode}} \end{figure} \newpage \subsection{Code-128 and UCC/EAN-128} \begin{description} \item[Data]{Variable number of ASCII characters and special funtion symbols, starting with the approriate start character for the initial character set. UCC/EAN-128s must have a manditory \texttt{FNC 1} symbol immediately following the start character. } \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \texttt{includecheckintext} & Make check digit visible in text\\ \end{tabular} } \item[Notes]{ Any non-printable character can be entered via its escaped ordinal value, for example \texttt{\^{}070} for \texttt{ACK} and \texttt{\^{}102} for \texttt{FNC 1}. Since a caret symbol serves as an escape character it must be escaped as \texttt{\^{}062} if used in the data. The check character is always added automatically. } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(5,1in) \psbarcode{^104^102Count^0991234^101!}{includetext}{code128} \end{pspicture} %} \caption{\texttt{(\^{}104\^{}102Count\^{}0991234\^{}101!)\@ (includetext) code128 barcode}} \end{figure} \subsection{Rationalized Codabar} \begin{description} \item[Data]{ Variable number of digits and any of the symbols \texttt{-\$:/.+ABCD}. } \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includecheck} & Enable check digit\\ \texttt{includetext} & Enable human readable text\\ \texttt{includecheckintext} & Make check digit visible in text\\ \end{tabular} } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(4,1in) \psbarcode{0123456789}{includetext}{rationalizedCodabar} \end{pspicture} %} \caption{\texttt{(0123456789) (includetext) rationalizedCodabar barcode}} \end{figure} \newpage \subsection{Interleaved 2 of 5 and ITF-14} \begin{description} \item[Data]{Variable number of digits. An ITF-14 is 14 characters and does not have a check digit.} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includecheck} & Enable check digit\\ \texttt{includetext} & Enable human readable text\\ \texttt{includecheckintext} & Make check digit visible in text\\ \end{tabular} } \item[Notes]{The data may be automatically prefixed with 0 to make the data, including optional check digit, of even length.} \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(5,0.7in) \psbarcode{05012345678900}{includecheck height=0.7}{interleaved2of5} \end{pspicture} %} \caption{\texttt{(05012345678900) (includecheck height=0.7) interleaved2of5 barcode}} \end{figure} \subsection{Code 2 of 5} \begin{description} \item[Data]{Variable number of digits} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \end{tabular} } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(5,1.2in) \psbarcode{0123456789}{includetext textpos=75 textfont=Helvetica textsize=16}{code2of5} \end{pspicture} %} \caption{\texttt{(0123456789) (includetext textpos=75 textfont=Helvetica textsize=16) code2of5 barcode}} \end{figure} \newpage \subsection{Postnet} \begin{description} \item[Data]{Variable number digits} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \texttt{includecheckintext} & Make the check digit visible in the text \end{tabular} } \item[Notes]{ Check digit is always added automatically } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(7,0.3in) \psbarcode{01234567}{includetext textpos=-10 textfont=Arial textsize=10}{postnet} \end{pspicture} %} \caption{\texttt{(01234567) (includetext textpos=-10 textfont=Arial textsize=10) postnet barcode}} \end{figure} \subsection{Royal Mail} \begin{description} \item[Data]{Variable number digits and capital letters} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \texttt{includecheckintext} & Make the check digit visible in the text \end{tabular} } \item[Notes]{ Check digit is always added automatically } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(5,0.5in) \psbarcode{LE28HS9Z}{includetext}{royalmail} \end{pspicture} %} \caption{\texttt{(LE28HS9Z) (includetext) royalmail barcode}} \end{figure} \newpage \subsection{MSI} \begin{description} \item[Data]{Variable number digits} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includecheck} & Enable check digit\\ \texttt{includetext} & Enable human readable text\\ \texttt{includecheckintext} & Make check digit visible in the text \end{tabular} } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(6,1in) \psbarcode{0123456789}{includecheck includetext}{msi} \end{pspicture} %} \caption{\texttt{(0123456789) (includecheck includetext) msi barcode}} \end{figure} \subsection{Plessey} \begin{description} \item[Data]{Variable number of hexadecimal characters} \item[Options]{ \begin{tabular}{l|l} Option & Feature\\ \hline \texttt{includetext} & Enable human readable text\\ \texttt{includecheckintext} & Make the check digits visible in the text \end{tabular} } \item[Notes]{ Check digits are always added automatically. } \end{description} \begin{figure}[h] \centering %\framebox{ \begin{pspicture}(12,1in) \psbarcode{0123456789ABCDEF}{includetext}{plessey} \end{pspicture} %} \caption{\texttt{(012345ABCDEF) (includetext) plessey barcode}} \end{figure} \newpage \section{License} \label{license} Copyright \copyright 2004 Terry Burton Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. \end{document} postscriptbarcode-2014-03-12/src/onecode.ps000066400000000000000000000373211231007474100204100ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER onecode-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: USPS Intelligent Mail % --EXAM: 0123456709498765432101234567891 % --EXOP: barcolor=FF0000 % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /onecode { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /height 0.15 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /height height cvr def /barlen barcode length def % Create the human readable text /txtdict << 2 dup 5 dup barcode 5 1 getinterval (9) eq {14} {11} ifelse dup 20 dup 25 dup 29 dup >> def /txt barlen 6 add array def /spacecnt 0 def 0 1 barlen 1 sub { /i exch def txtdict i known { txt i spacecnt add [( ) 0 0 () 0] put /spacecnt spacecnt 1 add def } if txt i spacecnt add [barcode i 1 getinterval 0 0 () 0] put } for /txt txt 0 barcode length spacecnt add getinterval def /normalize { /base exch def /num exch def num length 1 sub -1 1 { /i exch def num i 1 sub 2 copy get num i get base idiv add put num i num i get base mod put } for { %loop - extend input as necessary num 0 get base lt {exit} if /num [0 num {} forall] def num 0 num 0 get num 1 get base idiv add put num 1 num 1 get base mod put } loop % Trim leading zeros /num [/i true def num {dup 0 eq i and {pop} {/i false def} ifelse} forall] def num length 0 eq {/num [0] def} if num } bind def /bigadd { 2 copy length exch length 2 copy sub abs /offset exch def lt {exch} if /a exch def /b exch def 0 1 b length 1 sub { dup a exch offset add 2 copy get b 5 -1 roll get add put } for a } bind def % Conversion of data fields into binary data barlen 20 eq {[0]} if barlen 25 eq {[1]} if barlen 29 eq {[1 0 0 0 0 1]} if barlen 31 eq {[1 0 0 0 1 0 0 0 0 1]} if /binval exch [barcode 20 barlen 20 sub getinterval {48 sub} forall] bigadd def /binval [binval {} forall barcode 0 get 48 sub] def /binval [binval {5 mul} forall] [barcode 1 get 48 sub] bigadd 10 normalize def /binval [binval {} forall barcode 2 18 getinterval {48 sub} forall] def % Conversion of binary data into byte array /bytes 13 array def /bintmp [binval {} forall] def 12 -1 0 { /i exch def 0 1 bintmp length 2 sub { /j exch def bintmp j 1 add 2 copy get bintmp j get 256 mod 10 mul add put bintmp j bintmp j get 256 idiv put } for bytes i bintmp bintmp length 1 sub get 256 mod put bintmp bintmp length 1 sub 2 copy get 256 idiv put } for % Generation of 11-bit CRC on byte array /fcs 2047 def /dat bytes 0 get 5 bitshift def 6 { fcs dat xor 1024 and 0 ne { /fcs fcs 1 bitshift 3893 xor def } { /fcs fcs 1 bitshift def } ifelse /fcs fcs 2047 and def /dat dat 1 bitshift def } repeat 1 1 12 { bytes exch get 3 bitshift /dat exch def 8 { fcs dat xor 1024 and 0 ne { /fcs fcs 1 bitshift 3893 xor def } { /fcs fcs 1 bitshift def } ifelse /fcs fcs 2047 and def /dat dat 1 bitshift def } repeat } for % Conversion from binary data to codewords /codewords 10 array def 9 -1 0 { /i exch def i 9 eq { /b 636 def } { /b 1365 def } ifelse 0 1 binval length 2 sub { /j exch def binval j 1 add 2 copy get binval j get b mod 10 mul add put binval j binval j get b idiv put } for codewords i binval binval length 1 sub get b mod put binval binval length 1 sub 2 copy get b idiv put } for % Inserting additional information into codewords codewords 9 codewords 9 get 2 mul put fcs 1024 and 0 ne { codewords 0 codewords 0 get 659 add put } if % Conversion from codewords to characters /tab513 [ 31 7936 47 7808 55 7552 59 7040 61 6016 62 3968 79 7744 87 7488 91 6976 93 5952 94 3904 103 7360 107 6848 109 5824 110 3776 115 6592 117 5568 118 3520 121 5056 122 3008 124 1984 143 7712 151 7456 155 6944 157 5920 158 3872 167 7328 171 6816 173 5792 174 3744 179 6560 181 5536 182 3488 185 5024 186 2976 188 1952 199 7264 203 6752 205 5728 206 3680 211 6496 213 5472 214 3424 217 4960 218 2912 220 1888 227 6368 229 5344 230 3296 233 4832 234 2784 236 1760 241 4576 242 2528 244 1504 248 992 271 7696 279 7440 283 6928 285 5904 286 3856 295 7312 299 6800 301 5776 302 3728 307 6544 309 5520 310 3472 313 5008 314 2960 316 1936 327 7248 331 6736 333 5712 334 3664 339 6480 341 5456 342 3408 345 4944 346 2896 348 1872 355 6352 357 5328 358 3280 361 4816 362 2768 364 1744 369 4560 370 2512 372 1488 376 976 391 7216 395 6704 397 5680 398 3632 403 6448 405 5424 406 3376 409 4912 410 2864 412 1840 419 6320 421 5296 422 3248 425 4784 426 2736 428 1712 433 4528 434 2480 436 1456 440 944 451 6256 453 5232 454 3184 457 4720 458 2672 460 1648 465 4464 466 2416 468 1392 472 880 481 4336 482 2288 484 1264 488 752 527 7688 535 7432 539 6920 541 5896 542 3848 551 7304 555 6792 557 5768 558 3720 563 6536 565 5512 566 3464 569 5000 570 2952 572 1928 583 7240 587 6728 589 5704 590 3656 595 6472 597 5448 598 3400 601 4936 602 2888 604 1864 611 6344 613 5320 614 3272 617 4808 618 2760 620 1736 625 4552 626 2504 628 1480 632 968 647 7208 651 6696 653 5672 654 3624 659 6440 661 5416 662 3368 665 4904 666 2856 668 1832 675 6312 677 5288 678 3240 681 4776 682 2728 684 1704 689 4520 690 2472 692 1448 696 936 707 6248 709 5224 710 3176 713 4712 714 2664 716 1640 721 4456 722 2408 724 1384 728 872 737 4328 738 2280 740 1256 775 7192 779 6680 781 5656 782 3608 787 6424 789 5400 790 3352 793 4888 794 2840 796 1816 803 6296 805 5272 806 3224 809 4760 810 2712 812 1688 817 4504 818 2456 820 1432 824 920 835 6232 837 5208 838 3160 841 4696 842 2648 844 1624 849 4440 850 2392 852 1368 865 4312 866 2264 868 1240 899 6200 901 5176 902 3128 905 4664 906 2616 908 1592 913 4408 914 2360 916 1336 929 4280 930 2232 932 1208 961 4216 962 2168 964 1144 1039 7684 1047 7428 1051 6916 1053 5892 1054 3844 1063 7300 1067 6788 1069 5764 1070 3716 1075 6532 1077 5508 1078 3460 1081 4996 1082 2948 1084 1924 1095 7236 1099 6724 1101 5700 1102 3652 1107 6468 1109 5444 1110 3396 1113 4932 1114 2884 1116 1860 1123 6340 1125 5316 1126 3268 1129 4804 1130 2756 1132 1732 1137 4548 1138 2500 1140 1476 1159 7204 1163 6692 1165 5668 1166 3620 1171 6436 1173 5412 1174 3364 1177 4900 1178 2852 1180 1828 1187 6308 1189 5284 1190 3236 1193 4772 1194 2724 1196 1700 1201 4516 1202 2468 1204 1444 1219 6244 1221 5220 1222 3172 1225 4708 1226 2660 1228 1636 1233 4452 1234 2404 1236 1380 1249 4324 1250 2276 1287 7188 1291 6676 1293 5652 1294 3604 1299 6420 1301 5396 1302 3348 1305 4884 1306 2836 1308 1812 1315 6292 1317 5268 1318 3220 1321 4756 1322 2708 1324 1684 1329 4500 1330 2452 1332 1428 1347 6228 1349 5204 1350 3156 1353 4692 1354 2644 1356 1620 1361 4436 1362 2388 1377 4308 1378 2260 1411 6196 1413 5172 1414 3124 1417 4660 1418 2612 1420 1588 1425 4404 1426 2356 1441 4276 1442 2228 1473 4212 1474 2164 1543 7180 1547 6668 1549 5644 1550 3596 1555 6412 1557 5388 1558 3340 1561 4876 1562 2828 1564 1804 1571 6284 1573 5260 1574 3212 1577 4748 1578 2700 1580 1676 1585 4492 1586 2444 1603 6220 1605 5196 1606 3148 1609 4684 1610 2636 1617 4428 1618 2380 1633 4300 1634 2252 1667 6188 1669 5164 1670 3116 1673 4652 1674 2604 1681 4396 1682 2348 1697 4268 1698 2220 1729 4204 1730 2156 1795 6172 1797 5148 1798 3100 1801 4636 1802 2588 1809 4380 1810 2332 1825 4252 1826 2204 1857 4188 1858 2140 1921 4156 1922 2108 2063 7682 2071 7426 2075 6914 2077 5890 2078 3842 2087 7298 2091 6786 2093 5762 2094 3714 2099 6530 2101 5506 2102 3458 2105 4994 2106 2946 2119 7234 2123 6722 2125 5698 2126 3650 2131 6466 2133 5442 2134 3394 2137 4930 2138 2882 2147 6338 2149 5314 2150 3266 2153 4802 2154 2754 2161 4546 2162 2498 2183 7202 2187 6690 2189 5666 2190 3618 2195 6434 2197 5410 2198 3362 2201 4898 2202 2850 2211 6306 2213 5282 2214 3234 2217 4770 2218 2722 2225 4514 2226 2466 2243 6242 2245 5218 2246 3170 2249 4706 2250 2658 2257 4450 2258 2402 2273 4322 2311 7186 2315 6674 2317 5650 2318 3602 2323 6418 2325 5394 2326 3346 2329 4882 2330 2834 2339 6290 2341 5266 2342 3218 2345 4754 2346 2706 2353 4498 2354 2450 2371 6226 2373 5202 2374 3154 2377 4690 2378 2642 2385 4434 2401 4306 2435 6194 2437 5170 2438 3122 2441 4658 2442 2610 2449 4402 2465 4274 2497 4210 2567 7178 2571 6666 2573 5642 2574 3594 2579 6410 2581 5386 2582 3338 2585 4874 2586 2826 2595 6282 2597 5258 2598 3210 2601 4746 2602 2698 2609 4490 2627 6218 2629 5194 2630 3146 2633 4682 2641 4426 2657 4298 2691 6186 2693 5162 2694 3114 2697 4650 2705 4394 2721 4266 2753 4202 2819 6170 2821 5146 2822 3098 2825 4634 2833 4378 2849 4250 2881 4186 2945 4154 3079 7174 3083 6662 3085 5638 3086 3590 3091 6406 3093 5382 3094 3334 3097 4870 3107 6278 3109 5254 3110 3206 3113 4742 3121 4486 3139 6214 3141 5190 3145 4678 3153 4422 3169 4294 3203 6182 3205 5158 3209 4646 3217 4390 3233 4262 3265 4198 3331 6166 3333 5142 3337 4630 3345 4374 3361 4246 3393 4182 3457 4150 3587 6158 3589 5134 3593 4622 3601 4366 3617 4238 3649 4174 3713 4142 3841 4126 4111 7681 4119 7425 4123 6913 4125 5889 4135 7297 4139 6785 4141 5761 4147 6529 4149 5505 4153 4993 4167 7233 4171 6721 4173 5697 4179 6465 4181 5441 4185 4929 4195 6337 4197 5313 4201 4801 4209 4545 4231 7201 4235 6689 4237 5665 4243 6433 4245 5409 4249 4897 4259 6305 4261 5281 4265 4769 4273 4513 4291 6241 4293 5217 4297 4705 4305 4449 4359 7185 4363 6673 4365 5649 4371 6417 4373 5393 4377 4881 4387 6289 4389 5265 4393 4753 4401 4497 4419 6225 4421 5201 4425 4689 4483 6193 4485 5169 4489 4657 4615 7177 4619 6665 4621 5641 4627 6409 4629 5385 4633 4873 4643 6281 4645 5257 4649 4745 4675 6217 4677 5193 4739 6185 4741 5161 4867 6169 4869 5145 5127 7173 5131 6661 5133 5637 5139 6405 5141 5381 5155 6277 5157 5253 5187 6213 5251 6181 5379 6165 5635 6157 6151 7171 6155 6659 6163 6403 6179 6275 6211 5189 4681 4433 4321 3142 2634 2386 2274 1612 1364 1252 856 744 496 ] def /tab213 [ 3 6144 5 5120 6 3072 9 4608 10 2560 12 1536 17 4352 18 2304 20 1280 24 768 33 4224 34 2176 36 1152 40 640 48 384 65 4160 66 2112 68 1088 72 576 80 320 96 192 129 4128 130 2080 132 1056 136 544 144 288 257 4112 258 2064 260 1040 264 528 513 4104 514 2056 516 1032 1025 4100 1026 2052 2049 4098 4097 2050 1028 520 272 160 ] def /chars 10 array def 0 1 9 { /i exch def codewords i get dup 1286 le { tab513 exch get } { tab213 exch 1287 sub get } ifelse chars i 3 -1 roll put } for 9 -1 0 { /i exch def 2 i exp cvi fcs and 0 ne { chars i chars i get 8191 xor put } if } for % Conversion from characters to the OneCode encoding /barmap [ 7 2 4 3 1 10 0 0 9 12 2 8 5 5 6 11 8 9 3 1 0 1 5 12 2 5 1 8 4 4 9 11 6 3 8 10 3 9 7 6 5 11 1 4 8 5 2 12 9 10 0 2 7 1 6 7 3 6 4 9 0 3 8 6 6 4 2 7 1 1 9 9 7 10 5 2 4 0 3 8 6 2 0 4 8 11 1 0 9 8 3 12 2 6 7 7 5 1 4 10 1 12 6 9 7 3 8 0 5 8 9 7 4 6 2 10 3 4 0 5 8 4 5 7 7 11 1 9 6 0 9 6 0 6 4 8 2 1 3 2 5 9 8 12 4 11 6 1 9 5 7 4 3 3 1 2 0 7 2 0 1 3 4 1 6 10 3 5 8 7 9 4 2 11 5 6 0 8 7 12 4 2 8 1 5 10 3 0 9 3 0 9 6 5 2 4 7 8 1 7 5 0 4 5 2 3 0 10 6 12 9 2 3 11 1 6 8 8 7 9 5 4 0 11 1 5 2 2 9 1 4 12 8 3 6 6 7 0 3 7 4 7 7 5 0 12 1 11 2 9 9 0 6 8 5 3 3 10 8 2 ] def /bbs 65 array def /bhs 65 array def 0 1 64 { /i exch def /dec chars barmap i 4 mul get get 2 barmap i 4 mul 1 add get exp cvi and 0 ne def /asc chars barmap i 4 mul 2 add get get 2 barmap i 4 mul 3 add get exp cvi and 0 ne def dec not asc not and { bbs i 3 height mul 8 div put bhs i 2 height mul 8 div put } if dec not asc and { bbs i 3 height mul 8 div put bhs i 5 height mul 8 div put } if dec asc not and { bbs i 0 height mul 8 div put bhs i 5 height mul 8 div put } if dec asc and { bbs i 0 height mul 8 div put bhs i 8 height mul 8 div put } if } for % Return the arguments << /ren //renlinear /bbs bbs /bhs bhs /sbs [bhs length 1 sub {1.44 1.872} repeat 1.44] /txt txt /textxalign (left) /textfont /Helvetica /textyoffset 1 /textxoffset -0.3 /opt options >> dontdraw not //renlinear if end } bind def /onecode dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER onecode-- postscriptbarcode-2014-03-12/src/pdf417.ps000066400000000000000000000767621231007474100200150ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER pdf417-- % --REQUIRES preamble raiseerror renmatrix-- % --DESC: PDF417 % --EXAM: This is PDF417 % --EXOP: % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /pdf417 { 20 dict begin /options exch def /barcode exch def /dontdraw false def /compact false def /eclevel -1 def /columns 0 def /rows 0 def /rowmult 3 def /ccc false def /raw false def /parse false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /eclevel eclevel cvi def /columns columns cvi def /rows rows cvi def /rowmult rowmult cvr def % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if % Convert input into array of codewords raw { /datcws barcode length array def /i 0 def /j 0 def { % loop i barcode length eq {exit} if /cw barcode i 1 add 3 getinterval cvi def datcws j cw put /i i 4 add def /j j 1 add def } loop /datcws datcws 0 j getinterval def } { % Simple autoencoder from input to codewords using byte mode /barlen barcode length def barlen 6 mod 0 eq { /datcws barlen 6 idiv 5 mul 1 add array def datcws 0 924 put } { /datcws barlen 6 idiv 5 mul barlen 6 mod add 1 add array def datcws 0 901 put } ifelse % Rebase groups of 6 bytes splitting into 3 byte chunks 0 1 barlen 6 idiv 1 sub { /i exch def /msbs [ barcode i 6 mul 3 getinterval {} forall ] def /mscs [ msbs aload pop exch 256 mul add exch 65536 mul add 3 {dup 900 mod exch 900 idiv} repeat ] def /lsbs [barcode i 6 mul 3 add 3 getinterval {} forall] def /lscs [ lsbs aload pop exch 256 mul add exch 65536 mul add 3 {dup 900 mod exch 900 idiv} repeat ] def /cws 5 array def lscs 0 get mscs 0 get 316 mul add cws 4 2 index 900 mod put 900 idiv lscs 1 get add mscs 0 get 641 mul add mscs 1 get 316 mul add cws 3 2 index 900 mod put 900 idiv lscs 2 get add mscs 0 get 20 mul add mscs 1 get 641 mul add mscs 2 get 316 mul add cws 2 2 index 900 mod put 900 idiv lscs 3 get add mscs 1 get 20 mul add mscs 2 get 641 mul add cws 1 2 index 900 mod put 900 idiv mscs 2 get 20 mul add cws 0 3 -1 roll 900 mod put datcws i 5 mul 1 add cws putinterval } for % Add the remaining bytes to the end of the codewords /rem barlen 6 mod def rem 0 ne { datcws datcws length rem sub [ barcode barlen rem sub rem getinterval {} forall ] putinterval } if ccc {/datcws [920 datcws aload pop] def} if } ifelse % Determine the error correction level if unspecified /m datcws length def eclevel -1 eq { m 40 le {/eclevel 2 def} if m 41 ge m 160 le and {/eclevel 3 def} if m 161 ge m 320 le and {/eclevel 4 def} if m 321 ge {/eclevel 5 def} if } if % Reduce the error level so that it does not cause an excessive number of codewords /maxeclevel 928 1 sub m sub ln 2 ln div cvi 1 sub def eclevel maxeclevel gt {/eclevel maxeclevel def} if /k 2 eclevel 1 add exp cvi def % To determine size of matrix, number of columns if given by user... columns 0 eq {/columns m k add 3 div sqrt round cvi def} if columns 1 ge columns 30 le and {/c columns def} if % ... and rows is greater of those required and that given by user within limits /r m k add 1 add columns div ceiling cvi def % Required r rows lt rows 90 le and {/r rows def} if r 3 lt {/r 3 def} if % Opportunistically raise the error level if a better fit to the matrix is possible /maxeclevel c r mul 1 sub m sub ln 2 ln div cvi 1 sub 8 2 copy gt {exch} if pop def maxeclevel eclevel gt { /eclevel maxeclevel def /k 2 eclevel 1 add exp cvi def } if % Create codewords array with one extra working space element and add padding /n c r mul k sub def /cws c r mul 1 add array def cws 0 n put cws 1 datcws putinterval cws m 1 add [ n m sub 1 sub {900} repeat ] putinterval cws n [ k {0} repeat 0 ] putinterval % Calculate the log and anti-log tables /rsalog [ 1 928 {dup 3 mul 929 mod} repeat ] def /rslog 929 array def 1 1 928 {dup rsalog exch get exch rslog 3 1 roll put} for % Function to calculate the product in the field /rsprod { 2 copy 0 ne exch 0 ne and { rslog exch get exch rslog exch get add 928 mod rsalog exch get } { pop pop 0 } ifelse } bind def % Generate the coefficients /coeffs [ 1 k {0} repeat ] def 1 1 k { /i exch def coeffs i coeffs i 1 sub get put i 1 sub -1 1 { /j exch def coeffs j coeffs j 1 sub get coeffs j get rsalog i get rsprod add 929 mod put } for coeffs 0 coeffs 0 get rsalog i get rsprod put } for /coeffs coeffs 0 coeffs length 1 sub getinterval def coeffs length 1 sub -2 0 {coeffs exch 2 copy get 929 exch sub put} for % Derive the error codewords 0 1 n 1 sub { /t exch cws exch get cws n get add 929 mod def 0 1 k 1 sub { /j exch def cws n j add cws n j add 1 add get 929 t coeffs k j sub 1 sub get mul 929 mod sub add 929 mod put } for } for n 1 n k add { dup cws exch 929 cws 5 -1 roll get sub 929 mod put } for % Trim the working space from the end of the codewords /cws cws 0 cws length 1 sub getinterval def % Base 10 encoding of the bar space successions for the codewords in each cluster /clusters [ [ 120256 125680 128380 120032 125560 128318 108736 119920 108640 86080 108592 86048 110016 120560 125820 109792 120440 125758 88256 109680 88160 89536 110320 120700 89312 110200 120638 89200 110140 89840 110460 89720 110398 89980 128506 119520 125304 128190 107712 119408 125244 107616 119352 84032 107568 119324 84000 107544 83984 108256 119672 125374 85184 108144 119612 85088 108088 119582 85040 108060 85728 108408 119742 85616 108348 85560 108318 85880 108478 85820 85790 107200 119152 125116 107104 119096 125086 83008 107056 119068 82976 107032 82960 82952 83648 107376 119228 83552 107320 119198 83504 107292 83480 83468 83824 107452 83768 107422 83740 83900 106848 118968 125022 82496 106800 118940 82464 106776 118926 82448 106764 82440 106758 82784 106936 119006 82736 106908 82712 106894 82700 82694 106974 82830 82240 106672 118876 82208 106648 118862 82192 106636 82184 106630 82180 82352 82328 82316 82080 118830 106572 106566 82050 117472 124280 127678 103616 117360 124220 103520 117304 124190 75840 103472 75808 104160 117624 124350 76992 104048 117564 76896 103992 76848 76824 77536 104312 117694 77424 104252 77368 77340 77688 104382 77628 77758 121536 126320 128700 121440 126264 128670 111680 121392 126236 111648 121368 126222 111632 121356 103104 117104 124092 112320 103008 117048 124062 112224 121656 126366 93248 74784 102936 117006 93216 112152 93200 75456 103280 117180 93888 75360 103224 117150 93792 112440 121758 93744 75288 93720 75632 103356 94064 75576 103326 94008 112542 93980 75708 94140 75678 94110 121184 126136 128606 111168 121136 126108 111136 121112 126094 111120 121100 111112 111108 102752 116920 123998 111456 102704 116892 91712 74272 121244 116878 91680 74256 102668 91664 111372 102662 74244 74592 102840 116958 92000 74544 102812 91952 111516 102798 91928 74508 74502 74680 102878 92088 74652 92060 74638 92046 92126 110912 121008 126044 110880 120984 126030 110864 120972 110856 120966 110852 110850 74048 102576 116828 90944 74016 102552 116814 90912 111000 121038 90896 73992 102534 90888 110982 90884 74160 102620 91056 74136 102606 91032 111054 91020 74118 91014 91100 91086 110752 120920 125998 110736 120908 110728 120902 110724 110722 73888 102488 116782 90528 73872 102476 90512 110796 102470 90504 73860 90500 73858 73944 90584 90572 90566 120876 120870 110658 102444 73800 90312 90308 90306 101056 116080 123580 100960 116024 70720 100912 115996 70688 100888 70672 70664 71360 101232 116156 71264 101176 116126 71216 101148 71192 71180 71536 101308 71480 101278 71452 71612 71582 118112 124600 127838 105024 118064 124572 104992 118040 124558 104976 118028 104968 118022 100704 115896 123486 105312 100656 115868 79424 70176 118172 115854 79392 105240 100620 79376 70152 79368 70496 100792 115934 79712 70448 118238 79664 105372 100750 79640 70412 79628 70584 100830 79800 70556 79772 70542 70622 79838 122176 126640 128860 122144 126616 128846 122128 126604 122120 126598 122116 104768 117936 124508 113472 104736 126684 124494 113440 122264 126670 113424 104712 117894 113416 122246 104706 69952 100528 115804 78656 69920 100504 115790 96064 78624 104856 117966 96032 113560 122318 100486 96016 78600 104838 96008 69890 70064 100572 78768 70040 100558 96176 78744 104910 96152 113614 70022 78726 70108 78812 70094 96220 78798 122016 126552 128814 122000 126540 121992 126534 121988 121986 104608 117848 124462 113056 104592 126574 113040 122060 117830 113032 104580 113028 104578 113026 69792 100440 115758 78240 69776 100428 95136 78224 104652 100422 95120 113100 69764 95112 78212 69762 78210 69848 100462 78296 69836 95192 78284 69830 95180 78278 69870 95214 121936 126508 121928 126502 121924 121922 104528 117804 112848 104520 117798 112840 121958 112836 104514 112834 69712 100396 78032 69704 100390 94672 78024 104550 94664 112870 69698 94660 78018 94658 78060 94700 94694 126486 121890 117782 104484 104482 69672 77928 94440 69666 77922 99680 68160 99632 68128 99608 115342 68112 99596 68104 99590 68448 99768 115422 68400 99740 68376 99726 68364 68358 68536 99806 68508 68494 68574 101696 116400 123740 101664 116376 101648 116364 101640 116358 101636 67904 99504 115292 72512 67872 116444 115278 72480 101784 116430 72464 67848 99462 72456 101766 67842 68016 99548 72624 67992 99534 72600 101838 72588 67974 68060 72668 68046 72654 118432 124760 127918 118416 124748 118408 124742 118404 118402 101536 116312 105888 101520 116300 105872 118476 116294 105864 101508 105860 101506 105858 67744 99416 72096 67728 116334 80800 72080 101580 99398 80784 105932 67716 80776 72068 67714 72066 67800 99438 72152 67788 80856 72140 67782 80844 72134 67822 72174 80878 126800 128940 126792 128934 126788 126786 118352 124716 122576 126828 124710 122568 126822 122564 118338 122562 101456 116268 105680 101448 116262 114128 105672 118374 114120 122598 101442 114116 105666 114114 67664 99372 71888 67656 99366 80336 71880 101478 97232 80328 105702 67650 97224 114150 71874 97220 67692 71916 67686 80364 71910 97260 80358 97254 126760 128918 126756 126754 118312 124694 122472 126774 122468 118306 122466 101416 116246 105576 101412 113896 105572 101410 113892 105570 113890 67624 99350 71784 101430 80104 71780 67618 96744 80100 71778 96740 80098 96738 71798 96758 126738 122420 122418 105524 113780 113778 71732 79988 96500 96498 66880 66848 98968 66832 66824 66820 66992 66968 66956 66950 67036 67022 100000 99984 115532 99976 115526 99972 99970 66720 98904 69024 100056 98892 69008 100044 69000 100038 68996 66690 68994 66776 98926 69080 100078 69068 66758 69062 66798 69102 116560 116552 116548 116546 99920 102096 116588 115494 102088 116582 102084 99906 102082 66640 68816 66632 98854 73168 68808 66628 73160 68804 66626 73156 68802 66668 68844 66662 73196 68838 73190 124840 124836 124834 116520 118632 124854 118628 116514 118626 99880 115478 101992 116534 106216 101988 99874 106212 101986 106210 66600 98838 68712 99894 72936 68708 66594 81384 72932 68706 81380 72930 66614 68726 72950 81398 128980 128978 124820 126900 124818 126898 116500 118580 116498 122740 118578 122738 99860 101940 99858 106100 101938 114420 ] [ 128352 129720 125504 128304 129692 125472 128280 129678 125456 128268 125448 128262 125444 125792 128440 129758 120384 125744 128412 120352 125720 128398 120336 125708 120328 125702 120324 120672 125880 128478 110144 120624 125852 110112 120600 125838 110096 120588 110088 120582 110084 110432 120760 125918 89664 110384 120732 89632 110360 120718 89616 110348 89608 110342 89952 110520 120798 89904 110492 89880 110478 89868 90040 110558 90012 89998 125248 128176 129628 125216 128152 129614 125200 128140 125192 128134 125188 125186 119616 125360 128220 119584 125336 128206 119568 125324 119560 125318 119556 119554 108352 119728 125404 108320 119704 125390 108304 119692 108296 119686 108292 108290 85824 108464 119772 85792 108440 119758 85776 108428 85768 108422 85764 85936 108508 85912 108494 85900 85894 85980 85966 125088 128088 129582 125072 128076 125064 128070 125060 125058 119200 125144 128110 119184 125132 119176 125126 119172 119170 107424 119256 125166 107408 119244 107400 119238 107396 107394 83872 107480 119278 83856 107468 83848 107462 83844 83842 83928 107502 83916 83910 83950 125008 128044 125000 128038 124996 124994 118992 125036 118984 125030 118980 118978 106960 119020 106952 119014 106948 106946 82896 106988 82888 106982 82884 82882 82924 82918 124968 128022 124964 124962 118888 124982 118884 118882 106728 118902 106724 106722 82408 106742 82404 82402 124948 124946 118836 118834 106612 106610 124224 127664 129372 124192 127640 129358 124176 127628 124168 127622 124164 124162 117568 124336 127708 117536 124312 127694 117520 124300 117512 124294 117508 117506 104256 117680 124380 104224 117656 124366 104208 117644 104200 117638 104196 104194 77632 104368 117724 77600 104344 117710 77584 104332 77576 104326 77572 77744 104412 77720 104398 77708 77702 77788 77774 128672 129880 93168 128656 129868 92664 128648 129862 92412 128644 128642 124064 127576 129326 126368 124048 129902 126352 128716 127558 126344 124036 126340 124034 126338 117152 124120 127598 121760 117136 124108 121744 126412 124102 121736 117124 121732 117122 121730 103328 117208 124142 112544 103312 117196 112528 121804 117190 112520 103300 112516 103298 112514 75680 103384 117230 94112 75664 103372 94096 112588 103366 94088 75652 94084 75650 75736 103406 94168 75724 94156 75718 94150 75758 128592 129836 91640 128584 129830 91388 128580 91262 128578 123984 127532 126160 123976 127526 126152 128614 126148 123970 126146 116944 124012 121296 116936 124006 121288 126182 121284 116930 121282 102864 116972 111568 102856 116966 111560 121318 111556 102850 111554 74704 102892 92112 74696 102886 92104 111590 92100 74690 92098 74732 92140 74726 92134 128552 129814 90876 128548 90750 128546 123944 127510 126056 128566 126052 123938 126050 116840 123958 121064 116836 121060 116834 121058 102632 116854 111080 121078 111076 102626 111074 74216 102646 91112 74212 91108 74210 91106 74230 91126 128532 90494 128530 123924 126004 123922 126002 116788 120948 116786 120946 102516 110836 102514 110834 73972 90612 73970 90610 128522 123914 125978 116762 120890 102458 110714 123552 127320 129198 123536 127308 123528 127302 123524 123522 116128 123608 127342 116112 123596 116104 123590 116100 116098 101280 116184 123630 101264 116172 101256 116166 101252 101250 71584 101336 116206 71568 101324 71560 101318 71556 71554 71640 101358 71628 71622 71662 127824 129452 79352 127816 129446 79100 127812 78974 127810 123472 127276 124624 123464 127270 124616 127846 124612 123458 124610 115920 123500 118224 115912 123494 118216 124646 118212 115906 118210 100816 115948 105424 100808 115942 105416 118246 105412 100802 105410 70608 100844 79824 70600 100838 79816 105446 79812 70594 79810 70636 79852 70630 79846 129960 95728 113404 129956 95480 113278 129954 95356 95294 127784 129430 78588 128872 129974 95996 78462 128868 127778 95870 128866 123432 127254 124520 123428 126696 128886 123426 126692 124514 126690 115816 123446 117992 115812 122344 117988 115810 122340 117986 122338 100584 115830 104936 100580 113640 104932 100578 113636 104930 113634 70120 100598 78824 70116 96232 78820 70114 96228 78818 96226 70134 78838 129940 94968 113022 129938 94844 94782 127764 78206 128820 127762 95102 128818 123412 124468 123410 126580 124466 126578 115764 117876 115762 122100 117874 122098 100468 104692 100466 113140 104690 113138 69876 78324 69874 95220 78322 95218 129930 94588 94526 127754 128794 123402 124442 126522 115738 117818 121978 100410 104570 112890 69754 78074 94714 94398 123216 127148 123208 127142 123204 123202 115408 123244 115400 123238 115396 115394 99792 115436 99784 115430 99780 99778 68560 99820 68552 99814 68548 68546 68588 68582 127400 129238 72444 127396 72318 127394 123176 127126 123752 123172 123748 123170 123746 115304 123190 116456 115300 116452 115298 116450 99560 115318 101864 99556 101860 99554 101858 68072 99574 72680 68068 72676 68066 72674 68086 72694 129492 80632 105854 129490 80508 80446 127380 72062 127924 127378 80766 127922 123156 123700 123154 124788 123698 124786 115252 116340 115250 118516 116338 118514 99444 101620 99442 105972 101618 105970 67828 72180 67826 80884 72178 80882 97008 114044 96888 113982 96828 96798 129482 80252 130010 97148 80190 97086 127370 127898 128954 123146 123674 124730 126842 115226 116282 118394 122618 99386 101498 105722 114170 67706 71930 80378 96632 113854 96572 96542 80062 96702 96444 96414 96350 123048 123044 123042 115048 123062 115044 115042 99048 115062 99044 99042 67048 99062 67044 67042 67062 127188 68990 127186 123028 123316 123026 123314 114996 115572 114994 115570 98932 100084 98930 100082 66804 69108 66802 69106 129258 73084 73022 127178 127450 123018 123290 123834 114970 115514 116602 98874 99962 102138 66682 68858 73210 81272 106174 81212 81182 72894 81342 97648 114364 97592 114334 97564 97550 81084 97724 81054 97694 97464 114270 97436 97422 80990 97502 97372 97358 97326 114868 114866 98676 98674 66292 66290 123098 114842 115130 98618 99194 66170 67322 69310 73404 73374 81592 106334 81564 81550 73310 81630 97968 114524 97944 114510 97932 97926 81500 98012 81486 97998 97880 114478 97868 97862 81454 97902 97836 97830 69470 73564 73550 81752 106414 81740 81734 73518 81774 81708 81702 ] [ 109536 120312 86976 109040 120060 86496 108792 119934 86256 108668 86136 129744 89056 110072 129736 88560 109820 129732 88312 109694 129730 88188 128464 129772 89592 128456 129766 89340 128452 89214 128450 125904 128492 125896 128486 125892 125890 120784 125932 120776 125926 120772 120770 110544 120812 110536 120806 110532 84928 108016 119548 84448 107768 119422 84208 107644 84088 107582 84028 129640 85488 108284 129636 85240 108158 129634 85116 85054 128232 129654 85756 128228 85630 128226 125416 128246 125412 125410 119784 125430 119780 119778 108520 119798 108516 108514 83424 107256 119166 83184 107132 83064 107070 83004 82974 129588 83704 107390 129586 83580 83518 128116 83838 128114 125172 125170 119284 119282 107508 107506 82672 106876 82552 106814 82492 82462 129562 82812 82750 128058 125050 119034 82296 106686 82236 82206 82366 82108 82078 76736 103920 117500 76256 103672 117374 76016 103548 75896 103486 75836 129384 77296 104188 129380 77048 104062 129378 76924 76862 127720 129398 77564 127716 77438 127714 124392 127734 124388 124386 117736 124406 117732 117730 104424 117750 104420 104418 112096 121592 126334 92608 111856 121468 92384 111736 121406 92272 111676 92216 111646 92188 75232 103160 117118 93664 74992 103036 93424 112252 102974 93304 74812 93244 74782 93214 129332 75512 103294 129908 129330 93944 75388 129906 93820 75326 93758 127604 75646 128756 127602 94078 128754 124148 126452 124146 126450 117236 121844 117234 121842 103412 103410 91584 111344 121212 91360 111224 121150 91248 111164 91192 111134 91164 91150 74480 102780 91888 74360 102718 91768 111422 91708 74270 91678 129306 74620 129850 92028 74558 91966 127546 128634 124026 126202 116986 121338 102906 90848 110968 121022 90736 110908 90680 110878 90652 90638 74104 102590 91000 74044 90940 74014 90910 74174 91070 90480 110780 90424 110750 90396 90382 73916 90556 73886 90526 90296 110686 90268 90254 73822 90334 90204 90190 71136 101112 116094 70896 100988 70776 100926 70716 70686 129204 71416 101246 129202 71292 71230 127348 71550 127346 123636 123634 116212 116210 101364 101362 79296 105200 118140 79072 105080 118078 78960 105020 78904 104990 78876 78862 70384 100732 79600 70264 100670 79480 105278 79420 70174 79390 129178 70524 129466 79740 70462 79678 127290 127866 123514 124666 115962 118266 100858 113376 122232 126654 95424 113264 122172 95328 113208 122142 95280 113180 95256 113166 95244 78560 104824 117950 95968 78448 104764 95856 113468 104734 95800 78364 95772 78350 95758 70008 100542 78712 69948 96120 78652 69918 96060 78622 96030 70078 78782 96190 94912 113008 122044 94816 112952 122014 94768 112924 94744 112910 94732 94726 78192 104636 95088 78136 104606 95032 113054 95004 78094 94990 69820 78268 69790 95164 78238 95134 94560 112824 121950 94512 112796 94488 112782 94476 94470 78008 104542 94648 77980 94620 77966 94606 69726 78046 94686 94384 112732 94360 112718 94348 94342 77916 94428 77902 94414 94296 112686 94284 94278 77870 94318 94252 94246 68336 99708 68216 99646 68156 68126 68476 68414 127162 123258 115450 99834 72416 101752 116414 72304 101692 72248 101662 72220 72206 67960 99518 72568 67900 72508 67870 72478 68030 72638 80576 105840 118460 80480 105784 118430 80432 105756 80408 105742 80396 80390 72048 101564 80752 71992 101534 80696 71964 80668 71950 80654 67772 72124 67742 80828 72094 80798 114016 122552 126814 96832 113968 122524 96800 113944 122510 96784 113932 96776 113926 96772 80224 105656 118366 97120 80176 105628 97072 114076 105614 97048 80140 97036 80134 97030 71864 101470 80312 71836 97208 80284 71822 97180 80270 97166 67678 71902 80350 97246 96576 113840 122460 96544 113816 122446 96528 113804 96520 113798 96516 96514 80048 105564 96688 80024 105550 96664 113870 96652 80006 96646 71772 80092 71758 96732 80078 96718 96416 113752 122414 96400 113740 96392 113734 96388 96386 79960 105518 96472 79948 96460 79942 96454 71726 79982 96494 96336 113708 96328 113702 96324 96322 79916 96364 79910 96358 96296 113686 96292 96290 79894 96310 66936 99006 66876 66846 67006 68976 100028 68920 99998 68892 68878 66748 69052 66718 69022 73056 102072 116574 73008 102044 72984 102030 72972 72966 68792 99934 73144 68764 73116 68750 73102 66654 68830 73182 81216 106160 118620 81184 106136 118606 81168 106124 81160 106118 81156 81154 72880 101980 81328 72856 101966 81304 106190 81292 72838 81286 68700 72924 68686 81372 72910 81358 114336 122712 126894 114320 122700 114312 122694 114308 114306 81056 106072 118574 97696 81040 106060 97680 114380 106054 97672 81028 97668 81026 97666 72792 101934 81112 72780 97752 81100 72774 97740 81094 97734 68654 72814 81134 97774 114256 122668 114248 122662 114244 114242 80976 106028 97488 80968 106022 97480 114278 97476 80962 97474 72748 81004 72742 97516 80998 97510 114216 122646 114212 114210 80936 106006 97384 80932 97380 80930 97378 72726 80950 97398 114196 114194 80916 97332 80914 97330 66236 66206 67256 99166 67228 67214 66142 67294 69296 100188 69272 100174 69260 69254 67164 69340 67150 69326 73376 102232 116654 73360 102220 73352 102214 73348 73346 69208 100142 73432 102254 73420 69190 73414 67118 69230 73454 106320 118700 106312 118694 106308 106306 73296 102188 81616 106348 102182 81608 73284 81604 73282 81602 69164 73324 69158 81644 73318 81638 122792 126934 122788 122786 106280 118678 114536 106276 114532 106274 114530 73256 102166 81512 73252 98024 81508 73250 98020 81506 98018 69142 73270 81526 98038 122772 122770 106260 114484 106258 114482 73236 81460 73234 97908 81458 97906 122762 106250 114458 73226 81434 97850 66396 66382 67416 99246 67404 67398 66350 67438 69456 100268 69448 100262 69444 69442 67372 69484 67366 69478 102312 116694 102308 102306 69416 100246 73576 102326 73572 69410 73570 67350 69430 73590 118740 118738 102292 106420 102290 106418 69396 73524 69394 81780 73522 81778 118730 102282 106394 69386 73498 81722 66476 66470 67496 99286 67492 67490 66454 67510 100308 100306 67476 69556 67474 69554 116714 ] ] def % Return the 17 bits for a codeword in a given cluster /cwtobits { clusters exch get exch get /v exch def [ 17 {0} repeat v 2 17 string cvrs {48 sub} forall ] dup length 17 sub 17 getinterval } bind def % Populate bitmap for the image compact { /rwid 17 c mul 17 add 17 add 1 add def } { /rwid 17 c mul 17 add 17 add 17 add 18 add def } ifelse /pixs rwid r mul array def 0 1 r 1 sub { /i exch def i 3 mod 0 eq { /lcw i 3 idiv 30 mul r 1 sub 3 idiv add def /rcw i 3 idiv 30 mul c add 1 sub def } if i 3 mod 1 eq { /lcw i 3 idiv 30 mul eclevel 3 mul add r 1 sub 3 mod add def /rcw i 3 idiv 30 mul r 1 sub 3 idiv add def } if i 3 mod 2 eq { /lcw i 3 idiv 30 mul c add 1 sub def /rcw i 3 idiv 30 mul eclevel 3 mul add r 1 sub 3 mod add def } if pixs rwid i mul [ 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 0 0 lcw i 3 mod cwtobits {} forall cws c i mul c getinterval { i 3 mod cwtobits {} forall } forall compact { 1 } { rcw i 3 mod cwtobits {} forall 1 1 1 1 1 1 1 0 1 0 0 0 1 0 1 0 0 1 } ifelse ] putinterval } for % Return the arguments << /ren //renmatrix /pixs pixs /pixx rwid /pixy r /height r 72 div rowmult mul /width rwid 72 div /opt options >> dontdraw not //renmatrix if end } bind def /pdf417 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER pdf417-- postscriptbarcode-2014-03-12/src/pharmacode.ps000066400000000000000000000076201231007474100210760ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER pharmacode-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Pharmaceutical Binary Code % --EXAM: 117480 % --EXOP: showborder % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /pharmacode { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /height 8 2.835 mul 72 div def /nwidth 0.5 2.835 mul def /wwidth 1.5 2.835 mul def /swidth 1.0 2.835 mul def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /height height cvr def /nwidth nwidth cvr def /wwidth wwidth cvr def /swidth swidth cvr def % Validate the input barcode length 1 lt barcode length 6 gt or { /bwipp.pharmacodeBadLength (Pharmacode must be 1 to 6 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.pharmacodeBadCharacter (Pharmacode must contain only digits) //raiseerror exec } if } forall barcode cvi dup 3 lt exch 131070 gt or { /bwipp.pharmacodeBadValue (Pharmacode value must be between 3 and 131070) //raiseerror exec } if % Create the human readable text /txt barcode length array def 0 1 barcode length 1 sub { /i exch def txt i [barcode i 1 getinterval 0 0 () 0] put } for % Convert the integer into the paramacode string /barcode barcode cvi 1 add 2 17 string cvrs def /barcode barcode 1 barcode length 1 sub getinterval def /barlen barcode length def % Length of the code /sbs barlen 2 mul array def 0 1 barlen 1 sub { /i exch def /enc barcode i 1 getinterval def enc (0) eq { sbs i 2 mul nwidth put } { sbs i 2 mul wwidth put } ifelse sbs i 2 mul 1 add swidth put } for % Return the arguments << /ren //renlinear /sbs sbs /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] /txt txt /textxalign (center) /opt options >> dontdraw not //renlinear if end } bind def /pharmacode dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER pharmacode-- postscriptbarcode-2014-03-12/src/pharmacode2.ps000066400000000000000000000100621231007474100211520ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER pharmacode2-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Two-track Pharmacode % --EXAM: 117480 % --EXOP: includetext showborder % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /pharmacode2 { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /height 4 def % Height of short bars in millimetres % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /height height cvr def % Validate the input barcode length 1 lt barcode length 8 gt or { /bwipp.pharmacode2BadLength (Two-track Pharmacode must be 1 to 6 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.pharmacode2badCharacter (Two-track Pharmacode must contain only digits) //raiseerror exec } if } forall barcode cvi dup 4 lt exch 64570080 gt or { /bwipp.pharmacode2badValue (Two-track Pharmacode value must be between 4 and 64570080) //raiseerror exec } if % Create the human readable text /txt barcode length array def 0 1 barcode length 1 sub { /i exch def txt i [barcode i 1 getinterval 0 0 () 0] put } for /encstr 16 string def /bhs 16 array def /bbs 16 array def /sbs 32 array def /bar 1 25.4 div height mul def % bar height (mm) /spc 1 25.4 div 72 mul def % bar width & spacing (1mm) % Convert number into a base3 representation /i 15 def /val barcode cvi def { % loop val 0 eq {exit} if val 3 mod dup [3 1 2] exch get val exch sub 3 idiv /val exch def encstr i [2 0 1] 4 -1 roll get put /i i 1 sub def } loop /encstr encstr i 1 add 15 i sub getinterval def % Generate the bar pattern 0 1 encstr length 1 sub { /i exch def encstr i get dup bhs i bar [1 1 2] 5 -1 roll get mul put bbs i [0 bar 0] 4 -1 roll get put } for % Return the arguments << /ren //renlinear /bhs bhs /bbs bbs /sbs [encstr length 2 mul {spc} repeat] /txt txt /textxalign (center) /textyoffset 4 /opt options >> dontdraw not //renlinear if end } bind def /pharmacode2 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER pharmacode2-- postscriptbarcode-2014-03-12/src/planet.ps000066400000000000000000000126631231007474100202610ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER planet-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: USPS PLANET % --EXAM: 01234567890 % --EXOP: includetext includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /planet { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /validatecheck false def /includecheckintext false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 0.125 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def /barlen barcode length validatecheck {1 sub} if def % Validate the input barlen 11 ne barlen 13 ne and { /bwipp.planetBadLength (USPS PLANET must be 11 or 13 digits excluding check digit) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.planetBadCharacter (USPS PLANET must contain only digits) //raiseerror exec } if } forall % Create a string of the available characters /barchars (0123456789) def % Calculate the checksum /checksum 0 def 0 1 barlen 1 sub { /i exch def /checksum checksum barcode i get 48 sub add def } for /checksum 10 checksum 10 mod sub 10 mod def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.planetBadCheckDigit (Incorrect USPS PLANET check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def } if % Create an array containing the character mappings /encs [ (22555) (55522) (55252) (55225) (52552) (52525) (52255) (25552) (25525) (25255) (5) (5) ] def /bhs barlen 5 mul 7 add array def /txt barlen 1 add array def % Put start character /enc encs 10 get def /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs 0 heights putinterval % Put encoded digit into sbs 0 1 barlen 1 sub { /i exch def /enc encs barcode i get 48 sub get def /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs i 5 mul 1 add heights putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 5 mul 1 add 3.312 mul textyoffset textfont textsize] put } for % Put the checksum character /enc encs checksum get def /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs barlen 5 mul 1 add heights putinterval includecheckintext { txt barlen [barchars checksum 1 getinterval barlen 5 mul 1 add 3.312 mul textyoffset textfont textsize] put } { txt barlen [( ) barlen 5 mul 1 add 72 mul 25 div textyoffset textfont textsize] put } ifelse % Put end character /enc encs 11 get def /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs barlen 5 mul 6 add heights putinterval % Return the arguments << /ren //renlinear /bhs bhs /bbs [bhs length {0} repeat] /sbs [bhs length 1 sub {1.44 1.872} repeat 1.44] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /planet dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER planet-- postscriptbarcode-2014-03-12/src/plessey.ps000066400000000000000000000137661231007474100204670ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER plessey-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Plessey UK % --EXAM: 01234ABCD % --EXOP: includetext includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /plessey { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /validatecheck false def /includecheckintext false def /unidirectional false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Create a string of the available characters /barchars (0123456789ABCDEF) def /charvals 16 dict def 0 1 15 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.plesseyBadCharacter (Plessey must contain only digits and letters A B C D E F) //raiseerror exec } if } for /barlen barcode length validatecheck {2 sub} if def % Calculate the checksums /checkbits barlen 4 mul 8 add array def checkbits barlen 4 mul [ 0 0 0 0 0 0 0 0 ] putinterval 0 1 barlen 1 sub { /i exch def /indx charvals barcode i 1 getinterval get def checkbits i 4 mul [ indx 1 and indx -1 bitshift 1 and indx -2 bitshift 1 and indx -3 bitshift ] putinterval } for /checksalt [ 1 1 1 1 0 1 0 0 1 ] def 0 1 barlen 4 mul 1 sub { /i exch def checkbits i get 1 eq { 0 1 8 { /j exch def checkbits i j add checkbits i j add get checksalt j get xor put } for } if } for /checkval 0 def 0 1 7 { /i exch def /checkval checkval 2 i exp cvi checkbits barlen 4 mul i add get mul add def } for /checksum1 checkval 15 and def /checksum2 checkval -4 bitshift def validatecheck { barcode barlen get barchars checksum1 get ne barcode barlen 1 add get barchars checksum2 get ne or { /bwipp.plesseyBadCheckDigits (Incorrect Plessey check digits provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def } if % Create an array containing the character mappings /encs [ (14141414) (32141414) (14321414) (32321414) (14143214) (32143214) (14323214) (32323214) (14141432) (32141432) (14321432) (32321432) (14143232) (32143232) (14323232) (32323232) (32321432) (541412323) (323) ] def /sbs barlen 8 mul unidirectional {27} {33} ifelse add string def /txt barlen 2 add array def % Put start character sbs 0 encs 16 get putinterval 0 1 barlen 1 sub { /i exch def /indx charvals barcode i 1 getinterval get def sbs i 8 mul 8 add encs indx get putinterval txt i [barcode i 1 getinterval i 20 mul 20 add textyoffset textfont textsize] put } for % Put the checksum characters sbs barlen 8 mul 8 add encs checksum1 get putinterval sbs barlen 8 mul 16 add encs checksum2 get putinterval includecheckintext { txt barlen [barchars checksum1 1 getinterval barlen 20 mul 20 add textyoffset textfont textsize] put txt barlen 1 add [barchars checksum2 1 getinterval barlen 1 add 20 mul 20 add textyoffset textfont textsize] put } { txt barlen [( ) barlen 20 mul 20 add textyoffset textfont textsize] put txt barlen 1 add [( ) barlen 1 add 20 mul 20 add textyoffset textfont textsize] put } ifelse % Put end character sbs barlen 8 mul 24 add encs unidirectional {18} {17} ifelse get putinterval % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /plessey dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER plessey-- postscriptbarcode-2014-03-12/src/posicode.ps000066400000000000000000000337661231007474100206120ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER posicode-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: PosiCode % --EXAM: ABC123 % --EXOP: version=b inkspread=-0.5 parsefnc includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /posicode { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textxoffset 0 def /textyoffset -7 def /height 1 def /encoding (auto) def /version (a) def /checkoffset 0 def /raw false def /parse false def /parsefnc false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /encoding encoding cvlit def /version version cvlit def /checkoffset checkoffset cvi def /height height cvr def % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if /barlen barcode length def % Special function characters /la0 -1 def /la1 -2 def /la2 -3 def /sf0 -4 def /sf1 -5 def /sf2 -6 def /fn1 -7 def /fn2 -8 def /fn3 -9 def /fn4 -10 def % Character maps for each state << /normal [ % 0 1 2 0 1 2 0 1 2 [ (0) (^) (') ] [ (1) (;) 27 ] [ (2) (<) 28 ] % 0-2 [ (3) (=) 29 ] [ (4) (>) 30 ] [ (5) (?) 31 ] % 3-5 [ (6) (@) (!) ] [ (7) ([) (") ] [ (8) 92 (#) ] % 6-8 [ (9) (]) (&) ] [ (A) (a) 1 ] [ (B) (b) 2 ] % 9-11 [ (C) (c) 3 ] [ (D) (d) 4 ] [ (E) (e) 5 ] % 12-14 [ (F) (f) 6 ] [ (G) (g) 7 ] [ (H) (h) 8 ] % 15-17 [ (I) (i) 9 ] [ (J) (j) 10 ] [ (K) (k) 11 ] % 18-20 [ (L) (l) 12 ] [ (M) (m) 13 ] [ (N) (n) 14 ] % 21-23 [ (O) (o) 15 ] [ (P) (p) 16 ] [ (Q) (q) 17 ] % 24-26 [ (R) (r) 18 ] [ (S) (s) 19 ] [ (T) (t) 20 ] % 27-29 [ (U) (u) 21 ] [ (V) (v) 22 ] [ (W) (w) 23 ] % 30-32 [ (X) (x) 24 ] [ (Y) (y) 25 ] [ (Z) (z) 26 ] % 33-35 [ (-) (_) 40 ] [ (.) (`) 41 ] [ ( ) 127 0 ] % 36-38 [ ($) ({) (*) ] [ (/) (|) (,) ] [ (+) (}) (:) ] % 39-41 [ (%) (~) fn1 ] [ la1 la0 fn2 ] [ sf1 sf0 fn3 ] % 42-44 [ sf2 sf2 fn4 ] % 45 ] /limited [ [ (0) -98 -98 ] [ (1) -98 -98 ] [ (2) -98 -98 ] % 0-2 [ (3) -98 -98 ] [ (4) -98 -98 ] [ (5) -98 -98 ] % 3-5 [ (6) -98 -98 ] [ (7) -98 -98 ] [ (8) -98 -98 ] % 6-8 [ (9) -98 -98 ] [ (A) -98 -98 ] [ (B) -98 -98 ] % 9-11 [ (C) -98 -98 ] [ (D) -98 -98 ] [ (E) -98 -98 ] % 12-14 [ (F) -98 -98 ] [ (G) -98 -98 ] [ (H) -98 -98 ] % 15-17 [ (I) -98 -98 ] [ (J) -98 -98 ] [ (K) -98 -98 ] % 18-20 [ (L) -98 -98 ] [ (M) -98 -98 ] [ (N) -98 -98 ] % 21-23 [ (O) -98 -98 ] [ (P) -98 -98 ] [ (Q) -98 -98 ] % 24-26 [ (R) -98 -98 ] [ (S) -98 -98 ] [ (T) -98 -98 ] % 27-29 [ (U) -98 -98 ] [ (V) -98 -98 ] [ (W) -98 -98 ] % 30-32 [ (X) -98 -98 ] [ (Y) -98 -98 ] [ (Z) -98 -98 ] % 33-35 [ (-) -98 -98 ] [ (.) -98 -98 ] % 36-37 ] >> version (a) eq version (b) eq or {/normal} {/limited} ifelse get /charmaps exch def % Invert charmaps to give character to value maps for each state /charvals [ charmaps length dict charmaps length dict charmaps length dict ] def 0 1 charmaps length 1 sub { /i exch def /encs charmaps i get def 0 1 2 { /j exch def encs j get dup type /stringtype eq {0 get} if % convert string to ASCII if required charvals j get exch i put } for } for /set0 charvals 0 get def /set1 charvals 1 get def /set2 charvals 2 get def raw {/encoding (raw) def} if encoding (raw) eq { /cws barlen array def /i 0 def /j 0 def { % loop i barlen eq {exit} if /cw barcode i 1 add 3 getinterval cvi def cws j cw put /i i 4 add def /j j 1 add def } loop /cws cws 0 j getinterval def /text () def } if encoding (auto) eq { /fncvals << (FNC1) fn1 (FNC2) fn2 (FNC3) fn3 (FNC4) fn4 >> def % Convert input into bytes accounting for FNC characters /msg barlen array def /text barlen string def /i 0 def /j 0 def { i barlen eq {exit} if /char barcode i get def text j char put parsefnc char 94 eq and i barlen 4 sub lt and { barcode i 1 add get 94 ne { /char fncvals barcode i 1 add 4 getinterval get def text j ( ) putinterval /i i 4 add def } { /i i 1 add def } ifelse } if msg j char put /i i 1 add def /j j 1 add def } loop /msg msg 0 j getinterval def /msglen msg length def /text text 0 j getinterval def % Convert the input message to codewords /enc { exch get cws exch j exch put /j j 1 add def } bind def /cws barcode length 2 mul array def /i 0 def /j 0 def /cset (set0) def { i msglen eq {exit} if { % common exit % Read next two characters /char1 msg i get def /char2 i 1 add msglen lt {msg i 1 add get} {-99} ifelse def % If current mode is sufficient then directly encode cset load char1 known { char1 cset load enc /i i 1 add def exit } if % If char1 is in set2 then shift encode set2 char1 known { sf2 cset load enc char1 set2 enc /i i 1 add def exit } if % If char2 is also not in this set then latch else shift encode cset load char2 known not { cset (set0) eq { la1 cset load enc /cset (set1) def } { la0 cset load enc /cset (set0) def } ifelse exit } { cset (set0) eq { sf1 cset load enc char1 set1 enc } { sf0 cset load enc char1 set0 enc } ifelse /i i 1 add def exit } ifelse exit } loop } loop /cws cws 0 j getinterval def } if % auto encoding % Create an array containing the character mappings << % ";"=11, "<"=12 /a [ (141112) (131212) (121312) (111412) (131113) (121213) (111313) (121114) (111214) (111115) (181111) (171211) (161311) (151411) (141511) (131611) (121711) (111811) (171112) (161212) (151312) (141412) (131512) (121612) (111712) (161113) (151213) (141313) (131413) (121513) (111613) (151114) (141214) (131314) (121414) (111514) (141115) (131215) (121315) (111415) (131116) (121216) (111316) (121117) (111217) (111118) (1<111112) (111111111;1) ] /b [ (151213) (141313) (131413) (121513) (141214) (131314) (121414) (131215) (121315) (121216) (191212) (181312) (171412) (161512) (151612) (141712) (131812) (121912) (181213) (171313) (161413) (151513) (141613) (131713) (121813) (171214) (161314) (151414) (141514) (131614) (121714) (161215) (151315) (141415) (131515) (121615) (151216) (141316) (131416) (121516) (141217) (131317) (121417) (131218) (121318) (121219) (1<121312) (121212121<1) ] /limiteda [ (111411) (111312) (111213) (111114) (121311) (121212) (121113) (141111) (131211) (131112) (171111) (161211) (151311) (141411) (131511) (121611) (111711) (161112) (151212) (141312) (131412) (121512) (111612) (151113) (141213) (131313) (121413) (111513) (141114) (131214) (121314) (111414) (131115) (121215) (111315) (121116) (111216) (111117) (151111) (1) ] /limitedb [ (121512) (121413) (121314) (121215) (131412) (131313) (131214) (151212) (141312) (141213) (181212) (171312) (161412) (151512) (141612) (131712) (121812) (171213) (161313) (151413) (141513) (131613) (121713) (161214) (151314) (141414) (131514) (121614) (151215) (141315) (131415) (121515) (141216) (131316) (121416) (131217) (121317) (121218) (141212) (1) ] >> version get /encs exch def /c2w [ [ 495 330 210 126 70 35 15 5 ] [ 165 120 84 56 35 20 10 4 ] [ 45 36 28 21 15 10 6 3 ] [ 9 8 7 6 5 4 3 2 ] [ 1 1 1 1 1 1 1 1 ] ] def /v 0 def cws { /cw exch def 6 { cw v xor 1 and 0 ne { /v v 7682 xor def } if /v v -1 bitshift def /cw cw -1 bitshift def } repeat } forall /v v checkoffset add def version (limiteda) eq version (limitedb) eq or { /v v 1023 and def v 824 gt v 853 lt and { /v v 292 add def } if } { /v v 1023 and 45 add def } ifelse /d [ 2 2 2 2 2 2 ] def /r 0 def /c 0 def /w 0 def /sum 0 def { sum v eq {exit} if /t sum c2w r get c get add def t v eq { /w w 1 add def d r w 2 add put /sum t def } if t v gt { d r w 2 add put /r r 1 add def /w 0 def } if t v lt { /c c 1 add def /w w 1 add def /sum t def } if } loop 20 0 1 4 {d exch get sub} for d exch 5 exch put version (b) eq version (limitedb) eq or { /d [ d {1 add} forall ] def } if /cbs (111111111111) 12 string copy def 5 -1 0 { /i exch def cbs 5 i sub 2 mul 1 add d i get 47 add put } for % Concatenate the space bar successions /sbs cws length 6 mul 31 add string def encs encs length 2 sub get dup sbs exch 0 exch putinterval length /j exch def 0 1 cws length 1 sub { /i exch def sbs j encs cws i get get putinterval /j j 6 add def } for sbs j cbs putinterval /j j 12 add def encs encs length 1 sub get dup sbs exch j exch putinterval length j add /j exch def /sbs sbs 0 j getinterval def % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] /txt [ [text textxoffset textyoffset textfont textsize] ] /textxalign (center) /opt options >> dontdraw not //renlinear if end } bind def /posicode dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER posicode-- postscriptbarcode-2014-03-12/src/postnet.ps000066400000000000000000000126601231007474100204670ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER postnet-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: USPS POSTNET % --EXAM: 01234 % --EXOP: includetext includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /postnet { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /validatecheck false def /includecheckintext false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 0.125 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def /barlen barcode length validatecheck {1 sub} if def % Validate the input barlen 5 ne barlen 9 ne and barlen 11 ne and { /bwipp.postnetBadLength (USPS POSTNET must be 5, 9 or 11 digits excluding check digit) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.postnetBadCharacter (USPS POSTNET must contain only digits) //raiseerror exec } if } forall % Create a string of the available characters /barchars (0123456789) def /checksum 0 def 0 1 barlen 1 sub { /i exch def /checksum checksum barcode i get 48 sub add def } for /checksum 10 checksum 10 mod sub 10 mod def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.postnetBadCheckDigit (Incorrect USPS POSTNET check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def } if % Create an array containing the character mappings /encs [ (55222) (22255) (22525) (22552) (25225) (25252) (25522) (52225) (52252) (52522) (5) (5) ] def /bhs barlen 5 mul 7 add array def /txt barlen 1 add array def % Put start character /enc encs 10 get def /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs 0 heights putinterval % Put encoded digit into sbs 0 1 barlen 1 sub { /i exch def /enc encs barcode i get 48 sub get def /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs i 5 mul 1 add heights putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 5 mul 1 add 3.312 mul textyoffset textfont textsize] put } for % Put the checksum character /enc encs checksum get def /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs barlen 5 mul 1 add heights putinterval includecheckintext { txt barlen [barchars checksum 1 getinterval barlen 5 mul 1 add 3.312 mul textyoffset textfont textsize] put } { txt barlen [( ) barlen 5 mul 1 add 72 mul 25 div textyoffset textfont textsize] put } ifelse % Put end character /enc encs 11 get def /heights enc length array def 0 1 enc length 1 sub { /j exch def heights j enc j 1 getinterval cvi height mul 5 div put } for bhs barlen 5 mul 6 add heights putinterval % Return the arguments << /ren //renlinear /bhs bhs /bbs [bhs length {0} repeat] /sbs [bhs length 1 sub {1.44 1.872} repeat 1.44] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /postnet dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER postnet-- postscriptbarcode-2014-03-12/src/preamble.ps000066400000000000000000000027421231007474100205620ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN RESOURCE preamble-- currentglobal true setglobal /Generic /Category findresource dup length 1 add dict copy dup /InstanceType /setpacking where {pop /packedarraytype} {/arraytype} ifelse put /uk.co.terryburton.bwipp exch /Category defineresource pop setglobal % --END RESOURCE preamble-- postscriptbarcode-2014-03-12/src/ps.head000066400000000000000000000023041231007474100176660ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript - Version XXXX-XX-XX % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. postscriptbarcode-2014-03-12/src/pzn.ps000066400000000000000000000103321231007474100175740ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER pzn-- % --REQUIRES preamble raiseerror renlinear code39-- % --DESC: Pharmazentralnummer (PZN) % --EXAM: 123456 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /code39 dup /uk.co.terryburton.bwipp findresource put begin /pzn { 20 dict begin /options exch def % We are given an options string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable code32 text /textfont /Courier def /textsize 10 def /textyoffset -7 def /textxoffset 0 def /height 1 def /pzn8 false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /textxoffset textxoffset cvr def /height height cvr def % Validate the input pzn8 { barcode length 7 ne barcode length 8 ne and { /bwipp.pzn8badLength (PZN8 must be 7 or 8 digits) //raiseerror exec } if } { barcode length 6 ne barcode length 7 ne and { /bwipp.pzn7badLength (PZN7 must be 6 or 7 digits) //raiseerror exec } if } ifelse barcode { dup 48 lt exch 57 gt or { /bwipp.pznBadCharacter (PZN must contain only digits) //raiseerror exec } if } forall % Calculate check digit /msglen pzn8 {9} {8} ifelse def /checksum 0 def 0 1 msglen 3 sub { /i exch def barcode i get 48 sub i pzn8 {1} {2} ifelse add mul checksum add /checksum exch def } for /checksum checksum 11 mod def checksum 10 eq { /bwipp.pznBadInputSequence (Incorrect PZN input sequence provided) //raiseerror exec } if barcode length msglen 1 sub eq { barcode msglen 2 sub get checksum 48 add ne { /bwipp.pznBadCheckDigit (Incorrect PZN check digit provided) //raiseerror exec } if } if msglen string dup 0 45 put dup 1 barcode putinterval dup msglen 1 sub checksum 48 add put /msg exch def % Get the result of encoding with code39 options (dontdraw) true put /args msg options //code39 exec def % format HRI /text msglen 5 add string def text 0 (PZN - ) putinterval text 6 msg 1 msglen 1 sub getinterval putinterval args (txt) [ [text textxoffset textyoffset textfont textsize] ] put args (textxalign) (center) put args (opt) options put args dontdraw not //renlinear if end } bind def /pzn dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER pzn-- postscriptbarcode-2014-03-12/src/qrcode.ps000066400000000000000000001234071231007474100202520ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER qrcode-- % --REQUIRES preamble raiseerror renmatrix-- % --DESC: QR Code % --EXAM: http://www.terryburton.co.uk/barcodewriter/ % --EXOP: eclevel=M % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /qrcode { 20 dict begin /options exch def /barcode exch def /dontdraw false def /format (full) def % full or micro /version (unset) def /eclevel (unset) def % L, M, Q or H /encoding (unset) def /raw false def /parse false def /parsefnc false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if /barlen barcode length def % Convert input into bytes accounting for FNC characters /fn1 -1 def /fncvals << (FNC1) fn1 >> def /msg barlen array def /i 0 def /j 0 def { i barlen eq {exit} if /char barcode i get def parsefnc char 94 eq and i barlen 4 sub lt and { barcode i 1 add get 94 ne { /char fncvals barcode i 1 add 4 getinterval get def /i i 4 add def } { /i i 1 add def } ifelse } if msg j char put /i i 1 add def /j j 1 add def } loop /msg msg 0 j getinterval def /msglen msg length def % If FNC1 in first position then escape % as %% /fnc1first false def msglen 0 gt { msg 0 get fn1 eq { /fnc1first true def /msg [ msg 1 msglen 1 sub getinterval { dup 37 eq {dup} if } forall ] def /msglen msg length def } if } if % Default error correction level eclevel (unset) eq {/eclevel format (full) eq {(M)} {(L)} ifelse def} if % Convert from input into message bitstream raw {/encoding (raw) def} if encoding (raw) eq { /msgbits barcode def } { % Symbol capacities /fullcaps << /numeric << /L [ 41 77 127 187 255 322 370 461 552 652 % 1-L - 10-L 772 883 1022 1101 1250 1408 1548 1725 1903 2061 % 11-L - 20-L 2232 2409 2620 2812 3057 3283 3517 3669 3909 4158 % 21-L - 30-L 4417 4686 4965 5253 5529 5836 6153 6479 6743 7089 ] % 31-L - 40-L /M [ 34 63 101 149 202 255 293 365 432 513 % 1-M - 10-M 604 691 796 871 991 1082 1212 1346 1500 1600 % 11-M - 20-M 1708 1872 2059 2188 2395 2544 2701 2857 3035 3289 % 21-M - 30-M 3486 3693 3909 4134 4343 4588 4775 5039 5313 5596 ] % 31-M - 40-M /Q [ 27 48 77 111 144 178 207 259 312 364 % 1-Q - 10-Q 427 489 580 621 703 775 876 948 1063 1159 % 11-Q - 20-Q 1224 1358 1468 1588 1718 1804 1933 2085 2181 2358 % 21-Q - 30-Q 2473 2670 2805 2949 3081 3244 3417 3599 3791 3993 ] % 31-Q - 40-Q /H [ 17 34 58 82 106 139 154 202 235 288 % 1-H - 10-H 331 374 427 468 530 602 674 746 813 919 % 11-H - 20-H 969 1056 1108 1228 1286 1425 1501 1581 1677 1782 % 21-H - 30-H 1897 2022 2157 2301 2361 2524 2625 2735 2927 3057 ] % 31-H - 40-H >> /alphanumeric << /L [ 25 47 77 114 154 195 224 279 335 395 % 1-L - 10-L 468 535 619 667 758 854 938 1046 1153 1249 % 11-L - 20-L 1352 1460 1588 1704 1853 1990 2132 2223 2369 2520 % 21-L - 30-L 2677 2840 3009 3183 3351 3537 3729 3927 4087 4296 ] % 31-L - 40-L /M [ 20 38 61 90 122 154 178 221 262 311 % 1-M - 10-M 366 419 483 528 600 656 734 816 909 970 % 11-M - 20-M 1035 1134 1248 1326 1451 1542 1637 1732 1839 1994 % 21-M - 30-M 2113 2238 2369 2506 2632 2780 2894 3054 3220 3391 ] % 31-M - 40-M /Q [ 16 29 47 67 87 108 125 157 189 221 % 1-Q - 10-Q 259 296 352 376 426 470 531 574 644 702 % 11-Q - 20-Q 742 823 890 963 1041 1094 1172 1263 1322 1429 % 21-Q - 30-Q 1499 1618 1700 1787 1867 1966 2071 2181 2298 2420 ] % 31-Q - 40-Q /H [ 10 20 35 50 64 84 93 122 143 174 % 1-H - 10-H 200 227 259 283 321 365 408 452 493 557 % 11-H - 20-H 587 640 672 744 779 864 910 958 1016 1080 % 21-H - 30-H 1150 1226 1307 1394 1431 1530 1591 1658 1774 1852 ] % 31-H - 40-H >> /byte << /L [ 17 32 53 78 106 134 154 192 230 271 % 1-L - 10-L 321 367 425 458 520 586 644 718 792 858 % 11-L - 20-L 929 1003 1091 1171 1273 1367 1465 1528 1628 1732 % 21-L - 30-L 1840 1952 2068 2188 2303 2431 2563 2699 2809 2953 ] % 31-L - 40-L /M [ 14 26 42 62 84 106 122 152 180 213 % 1-M - 10-M 251 287 331 362 412 450 504 560 624 666 % 11-M - 20-M 711 779 857 911 997 1059 1125 1190 1264 1370 % 21-M - 30-M 1452 1538 1628 1722 1809 1911 1989 2099 2213 2331 ] % 31-M - 40-M /Q [ 11 20 32 46 60 74 86 108 130 151 % 1-Q - 10-Q 177 203 241 258 292 322 364 394 442 482 % 11-Q - 20-Q 509 565 611 661 715 751 805 868 908 982 % 21-Q - 30-Q 1030 1112 1168 1228 1283 1351 1423 1499 1579 1663 ] % 31-Q - 40-Q /H [ 7 14 24 34 44 58 64 84 98 119 % 1-H - 10-H 137 155 177 194 220 250 280 310 338 382 % 11-H - 20-H 403 439 461 511 535 593 625 658 698 742 % 21-H - 30-H 790 842 898 958 983 1051 1093 1139 1219 1273 ] % 31-H - 40-H >> /kanji << /L [ 10 20 32 48 65 82 95 118 141 167 % 1-L - 10-L 198 226 262 282 320 361 397 442 488 528 % 11-L - 20-L 572 618 672 721 784 842 902 940 1002 1066 % 21-L - 30-L 1132 1201 1273 1347 1417 1496 1577 1661 1729 1817 ] % 31-L - 40-L /M [ 8 16 26 38 52 65 75 93 111 131 % 1-M - 10-M 155 177 204 223 254 277 310 345 384 410 % 11-M - 20-M 438 480 528 561 614 652 692 732 778 843 % 21-M - 30-M 894 947 1002 1060 1113 1176 1224 1292 1362 1435 ] % 31-M - 40-M /Q [ 7 12 20 28 37 45 53 66 80 93 % 1-Q - 10-Q 109 125 149 159 180 198 224 243 272 297 % 11-Q - 20-Q 314 348 376 407 440 462 496 534 559 604 % 21-Q - 30-Q 634 684 719 756 790 832 876 923 972 1024 ] % 31-Q - 40-Q /H [ 4 8 15 21 27 36 39 52 60 74 % 1-H - 10-H 85 96 109 120 136 154 173 191 208 235 % 11-H - 20-H 248 270 284 315 330 365 385 405 430 457 % 21-H - 30-H 486 518 553 590 605 647 673 701 750 784 ] % 31-H - 40-H >> >> def % M1 M2 M3 M4 M1 M2 M3 M4 M1 M2 M3 M4 M1 M2 M3 M4 /microcaps << /numeric << /L [ 5 10 23 35 ] /M [ -1 8 18 30 ] /Q [ -1 -1 -1 21 ] /H [ -1 -1 -1 -1 ] >> /alphanumeric << /L [ -1 6 14 21 ] /M [ -1 5 11 18 ] /Q [ -1 -1 -1 13 ] /H [ -1 -1 -1 -1 ] >> /byte << /L [ -1 -1 9 15 ] /M [ -1 -1 7 13 ] /Q [ -1 -1 -1 9 ] /H [ -1 -1 -1 -1 ] >> /kanji << /L [ -1 -1 6 9 ] /M [ -1 -1 4 8 ] /Q [ -1 -1 -1 5 ] /H [ -1 -1 -1 -1 ] >> >> def /encvals << /numeric 0 /alphanumeric 1 /byte 2 /kanji 3 >> def /encs << /numeric /encnumeric /alphanumeric /encalphanumeric /byte /encbyte /kanji /enckanji >> def % N A B K /mids [ (0001) (0010) (0100) (1000) ] def /mids << /M1 [ () -1 -1 -1 ] /M2 [ (0) (1) -1 -1 ] /M3 [ (00) (01) (10) (11) ] /M4 [ (000) (001) (010) (011) ] 1 1 40 {2 string 10 exch cvrs mids} for >> def % N A B K /cc1to9 [ 10 9 8 8 ] def /cc10to26 [ 12 11 16 10 ] def /cc27to40 [ 14 13 16 12 ] def /cclens << /M1 [ 3 -1 -1 -1 ] /M2 [ 4 3 -1 -1 ] /M3 [ 5 4 4 3 ] /M4 [ 6 5 5 4 ] 1 1 9 { 2 string 10 exch cvrs cc1to9 } for 10 1 26 { 2 string 10 exch cvrs cc10to26 } for 27 1 40 { 2 string 10 exch cvrs cc27to40 } for >> def % Alphanumeric character to value map /charmap (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:) def /charvals 44 dict def 0 1 44 {dup charmap exch get exch charvals 3 1 roll put} for /encnumeric { /in exch def /out in length 10 mul 3 idiv 1 add string def /i 0 def /j 0 def { i in length eq {exit} if i in length 2 sub lt { (0000000000) 10 string copy dup in i 3 getinterval 0 exch {exch 10 mul 48 sub add} forall 2 10 string cvrs dup length 10 exch sub exch putinterval /i i 3 add def } { i in length 2 sub eq { % Two final digits (0000000) 7 string copy dup in i 2 getinterval 0 exch {exch 10 mul 48 sub add} forall 2 7 string cvrs dup length 7 exch sub exch putinterval /i i 2 add def } { % One final digit (0000) 4 string copy dup in i 1 getinterval 0 exch {exch 10 mul 48 sub add} forall 2 4 string cvrs dup length 4 exch sub exch putinterval /i i 1 add def } ifelse } ifelse dup out exch j exch putinterval length j add /j exch def } loop out 0 j getinterval } bind def /encalphanumeric { /in exch def fnc1first { % FNC1 as % /in [ in { dup -1 eq {pop 37} if } forall ] def } if /out in length 11 mul 2 idiv 1 add string def /i 0 def /j 0 def { i in length eq {exit} if i in length 1 sub lt { (00000000000) 11 string copy dup charvals in i get get 45 mul charvals in i 1 add get get add 2 11 string cvrs dup length 11 exch sub exch putinterval /i i 2 add def } { % Final character (000000) 6 string copy dup charvals in i get get 2 6 string cvrs dup length 6 exch sub exch putinterval /i i 1 add def } ifelse dup out exch j exch putinterval length j add /j exch def } loop out 0 j getinterval } bind def /encbyte { /in exch def fnc1first { % FNC1 as GS /in [ in { dup -1 eq {pop 29} if } forall ] def } if /out in length 8 mul string def 0 1 in length 1 sub { /i exch def (00000000) 8 string copy dup in i get cvi 2 8 string cvrs dup length 8 exch sub exch putinterval out i 8 mul 3 -1 roll putinterval } for out } bind def /enckanji { /in exch def /out in length 2 idiv 13 mul string def /i 0 def /j 0 def { i in length eq {exit} if in i get 256 mul in i 1 add get add dup 16#E040 lt {16#8140} {16#C140} ifelse sub dup -8 bitshift 16#C0 mul exch 16#00FF and add (0000000000000) 13 string copy dup 3 -1 roll 2 13 string cvrs dup length 13 exch sub exch putinterval dup out exch j exch putinterval length j add /j exch def /i i 2 add def } loop out } bind def % Determine a compact encoding for the data encoding (unset) eq { /numericokay true def /alphanumericokay true def /kanjiokay true def fnc1first {/kanjiokay false def} if msglen 2 mod 0 ne {/kanjiokay false def} if 0 1 msglen 1 sub { /i exch def /barchar msg i get def barchar 48 lt barchar 57 gt or {/numericokay false def} if charvals barchar known not {/alphanumericokay false def} if i 2 mod 0 eq { barchar 16#81 lt barchar 16#9F gt or barchar 16#E0 lt barchar 16#EB gt or and { /kanjiokay false def } if } if } for /encoding (byte) def kanjiokay {/encoding (kanji) def} if alphanumericokay {/encoding (alphanumeric) def} if numericokay {/encoding (numeric) def} if } if % Determine smallest symbol version to hold given amount of data /numchars msglen encoding (kanji) eq {2 idiv} if def fnc1first {/numchars numchars 1 add def} if % Workaround due to extended mode header version (unset) eq { /caps format (full) eq {fullcaps} {microcaps} ifelse encoding get eclevel get def /i 1 def { numchars caps i 1 sub get le {exit} if /i i 1 add def } loop /version i 10 2 string cvrs def format (micro) eq { /version (M ) 2 string copy dup version 1 exch putinterval def } if } if % Opportunistically raise the error correction level for a fit to the same symbol /caps format (full) eq {fullcaps} {microcaps} ifelse encoding get def /verval format (full) eq {version cvi 1 sub} {version 1 get 49 sub} ifelse def eclevel (L) eq {numchars caps /M get verval get le {/eclevel (M) def} if} if eclevel (M) eq {numchars caps /Q get verval get le {/eclevel (Q) def} if} if eclevel (Q) eq {numchars caps /H get verval get le {/eclevel (H) def} if} if % Set the control character data for the version /mid mids version get encvals encoding get get def fnc1first {/mid (0101 ) 8 string copy dup 4 mid putinterval def} if /cclen cclens version get encvals encoding get get def % Create the bitstream as mode_id character_count encoded_data /enc msg encs encoding get load exec def (0000000000000000) 0 cclen getinterval cclen string copy dup msglen encoding (kanji) eq {2 idiv} if cvi 2 cclen string cvrs dup length cclen exch sub exch putinterval /cc exch def /msgbits mid length cclen add enc length add string def msgbits 0 mid putinterval msgbits mid length cc putinterval msgbits mid length cclen add enc putinterval } ifelse % Lookup the most appropriate symbol specification /metrics [ % format vers size align modules error codewords error correction blocks % L M Q H L1 L2 M1 M2 Q1 Q2 H1 H2 [ (micro) (M1) 11 98 99 36 [ 2 99 99 99 ] [ 1 0 -1 -1 -1 -1 -1 -1 ] ] [ (micro) (M2) 13 98 99 80 [ 5 6 99 99 ] [ 1 0 1 0 -1 -1 -1 -1 ] ] [ (micro) (M3) 15 98 99 132 [ 6 8 99 99 ] [ 1 0 1 0 -1 -1 -1 -1 ] ] [ (micro) (M4) 17 98 99 192 [ 8 10 14 99 ] [ 1 0 1 0 1 0 -1 -1 ] ] [ (full) (1) 21 98 99 208 [ 7 10 13 17 ] [ 1 0 1 0 1 0 1 0 ] ] [ (full) (2) 25 18 99 359 [ 10 16 22 28 ] [ 1 0 1 0 1 0 1 0 ] ] [ (full) (3) 29 22 99 567 [ 15 26 36 44 ] [ 1 0 1 0 2 0 2 0 ] ] [ (full) (4) 33 26 99 807 [ 20 36 52 64 ] [ 1 0 2 0 2 0 4 0 ] ] [ (full) (5) 37 30 99 1079 [ 26 48 72 88 ] [ 1 0 2 0 2 2 2 2 ] ] [ (full) (6) 41 34 99 1383 [ 36 64 96 112 ] [ 2 0 4 0 4 0 4 0 ] ] [ (full) (7) 45 22 38 1568 [ 40 72 108 130 ] [ 2 0 4 0 2 4 4 1 ] ] [ (full) (8) 49 24 42 1936 [ 48 88 132 156 ] [ 2 0 2 2 4 2 4 2 ] ] [ (full) (9) 53 26 46 2336 [ 60 110 160 192 ] [ 2 0 3 2 4 4 4 4 ] ] [ (full) (10) 57 28 50 2768 [ 72 130 192 224 ] [ 2 2 4 1 6 2 6 2 ] ] [ (full) (11) 61 30 54 3232 [ 80 150 224 264 ] [ 4 0 1 4 4 4 3 8 ] ] [ (full) (12) 65 32 58 3728 [ 96 176 260 308 ] [ 2 2 6 2 4 6 7 4 ] ] [ (full) (13) 69 34 62 4256 [ 104 198 288 352 ] [ 4 0 8 1 8 4 12 4 ] ] [ (full) (14) 73 26 46 4651 [ 120 216 320 384 ] [ 3 1 4 5 11 5 11 5 ] ] [ (full) (15) 77 26 48 5243 [ 132 240 360 432 ] [ 5 1 5 5 5 7 11 7 ] ] [ (full) (16) 81 26 50 5867 [ 144 280 408 480 ] [ 5 1 7 3 15 2 3 13 ] ] [ (full) (17) 85 30 54 6523 [ 168 308 448 532 ] [ 1 5 10 1 1 15 2 17 ] ] [ (full) (18) 89 30 56 7211 [ 180 338 504 588 ] [ 5 1 9 4 17 1 2 19 ] ] [ (full) (19) 93 30 58 7931 [ 196 364 546 650 ] [ 3 4 3 11 17 4 9 16 ] ] [ (full) (20) 97 34 62 8683 [ 224 416 600 700 ] [ 3 5 3 13 15 5 15 10 ] ] [ (full) (21) 101 28 50 9252 [ 224 442 644 750 ] [ 4 4 17 0 17 6 19 6 ] ] [ (full) (22) 105 26 50 10068 [ 252 476 690 816 ] [ 2 7 17 0 7 16 34 0 ] ] [ (full) (23) 109 30 54 10916 [ 270 504 750 900 ] [ 4 5 4 14 11 14 16 14 ] ] [ (full) (24) 113 28 54 11796 [ 300 560 810 960 ] [ 6 4 6 14 11 16 30 2 ] ] [ (full) (25) 117 32 58 12708 [ 312 588 870 1050 ] [ 8 4 8 13 7 22 22 13 ] ] [ (full) (26) 121 30 58 13652 [ 336 644 952 1110 ] [ 10 2 19 4 28 6 33 4 ] ] [ (full) (27) 125 34 62 14628 [ 360 700 1020 1200 ] [ 8 4 22 3 8 26 12 28 ] ] [ (full) (28) 129 26 50 15371 [ 390 728 1050 1260 ] [ 3 10 3 23 4 31 11 31 ] ] [ (full) (29) 133 30 54 16411 [ 420 784 1140 1350 ] [ 7 7 21 7 1 37 19 26 ] ] [ (full) (30) 137 26 52 17483 [ 450 812 1200 1440 ] [ 5 10 19 10 15 25 23 25 ] ] [ (full) (31) 141 30 56 18587 [ 480 868 1290 1530 ] [ 13 3 2 29 42 1 23 28 ] ] [ (full) (32) 145 34 60 19723 [ 510 924 1350 1620 ] [ 17 0 10 23 10 35 19 35 ] ] [ (full) (33) 149 30 58 20891 [ 540 980 1440 1710 ] [ 17 1 14 21 29 19 11 46 ] ] [ (full) (34) 153 34 62 22091 [ 570 1036 1530 1800 ] [ 13 6 14 23 44 7 59 1 ] ] [ (full) (35) 157 30 54 23008 [ 570 1064 1590 1890 ] [ 12 7 12 26 39 14 22 41 ] ] [ (full) (36) 161 24 50 24272 [ 600 1120 1680 1980 ] [ 6 14 6 34 46 10 2 64 ] ] [ (full) (37) 165 28 54 25568 [ 630 1204 1770 2100 ] [ 17 4 29 14 49 10 24 46 ] ] [ (full) (38) 169 32 58 26896 [ 660 1260 1860 2220 ] [ 4 18 13 32 48 14 42 32 ] ] [ (full) (39) 173 26 54 28256 [ 720 1316 1950 2310 ] [ 20 4 40 7 43 22 10 67 ] ] [ (full) (40) 177 30 58 29648 [ 750 1372 2040 2430 ] [ 19 6 18 31 34 34 20 61 ] ] ] def /eclval (LMQH) eclevel search pop length exch pop exch pop def /i 0 def { % loop /m metrics i get def /frmt m 0 get def % Format of the symbol /vers m 1 get def % Version of symbol /size m 2 get def % Length of side /asp2 m 3 get def % Position of second alignment symbol /asp3 m 4 get def % Position of third alignment symbol /nmod m 5 get def % Number of modules /ncws nmod 8 idiv def % Total number of codewords /rbit nmod 8 mod def % Number of remainder bits /lc4b false def % Last data codeword is 4 bits long size 11 eq size 15 eq or { % Adjustments for M1 and M3 symbols /ncws ncws 1 add def /rbit 0 def /lc4b true def } if /ecws m 6 get eclval get def % Number of error correction codewords /dcws ncws ecws sub def % Number of data codewords /dmod dcws 8 mul lc4b {4} {0} ifelse sub def % Number of data modules /ecb1 m 7 get eclval 2 mul get def % First error correction blocks /ecb2 m 7 get eclval 2 mul 1 add get def % Second error correction blocks /okay true def format frmt ne {/okay false def} if % The format must match that supplied version (unset) ne version vers ne and {/okay false def} if % The version must match that supplied msgbits length dmod gt {/okay false def} if % Bitstream must fit into data modules ecb1 -1 eq ecb2 -1 eq or {/okay false def} if % Error correction level must be valid okay {exit} if /i i 1 add def } loop /format frmt def /version vers def /dcpb dcws ecb1 ecb2 add idiv def % Base data codewords per block /ecpb ncws ecb1 ecb2 add idiv dcpb sub def % Error correction codewords per block % Complete the message bits by adding the terminator, truncated if neccessary /terms << /M1 (000) /M2 (00000) /M3 (0000000) /M4 (000000000) >> def /term terms version known {terms version get} {(0000)} ifelse def /term term 0 dmod msgbits length sub term length 2 copy gt {exch} if pop getinterval def msgbits length term length add string dup 0 msgbits putinterval dup msgbits length term putinterval /msgbits exch def % Expand the message bits by adding padding as necessary /pad dmod string def 0 1 pad length 1 sub {pad exch 48 put} for pad 0 msgbits putinterval /padstrs [ (11101100) (00010001) ] def /padnum 0 def msgbits length 8 div ceiling 8 mul cvi 8 dmod lc4b {5} {1} ifelse sub { pad exch padstrs padnum get putinterval /padnum padnum 1 add 2 mod def } for % Evaluate the padded message into codewords /cws dcws array def 0 1 cws length 1 sub { /c exch def /bpcw 8 def lc4b c cws length 1 sub eq and {/bpcw 4 def} if /cwb pad c 8 mul bpcw getinterval def /cw 0 def 0 1 bpcw 1 sub { /i exch def /cw cw 2 bpcw i sub 1 sub exp cvi cwb i get 48 sub mul add def } for cws c cw put } for % Calculate the log and anti-log tables /rsalog [ 1 255 { dup 2 mul dup 256 ge {285 xor} if } repeat ] def /rslog 256 array def 1 1 255 {dup rsalog exch get exch rslog 3 1 roll put} for % Function to calculate the product in the field /rsprod { 2 copy 0 ne exch 0 ne and { rslog exch get exch rslog exch get add 255 mod rsalog exch get } { pop pop 0 } ifelse } bind def % Generate the coefficients for the Reed-Solomon algorithm /coeffs [ 1 ecpb {0} repeat ] def 0 1 ecpb 1 sub { /i exch def coeffs i 1 add coeffs i get put i -1 1 { /j exch def coeffs j coeffs j 1 sub get coeffs j get rsalog i get rsprod xor put } for coeffs 0 coeffs 0 get rsalog i get rsprod put } for /coeffs coeffs 0 coeffs length 1 sub getinterval def % Reed-Solomon algorithm to derive the error correction codewords /rscodes { /rscws exch def /rsnd rscws length def /rscws [ rscws {} forall ecpb {0} repeat ] def 0 1 rsnd 1 sub { /m exch def /k rscws m get def 0 1 ecpb 1 sub { /j exch def rscws m j add 1 add coeffs ecpb j sub 1 sub get k rsprod rscws m j add 1 add get xor put } for } for rscws rsnd ecpb getinterval } bind def % Divide codewords into two groups of blocks and calculate the error correction codewords /dcwsb ecb1 ecb2 add array def /ecwsb ecb1 ecb2 add array def 0 1 ecb1 1 sub { % First group of blocks has smaller number of data codewords /i exch def dcwsb i cws i dcpb mul dcpb getinterval put ecwsb i dcwsb i get rscodes put } for 0 1 ecb2 1 sub { % Second group of blocks has larger number of data codewords /i exch def dcwsb ecb1 i add cws ecb1 dcpb mul i dcpb 1 add mul add dcpb 1 add getinterval put ecwsb ecb1 i add dcwsb ecb1 i add get rscodes put } for % Reassemble the codewords /cws ncws array def /cw 0 def 0 1 dcpb { % Interleave the data codeword blocks /i exch def 0 1 ecb1 ecb2 add 1 sub { /j exch def i dcwsb j get length lt { % Ignore the end of short blocks cws cw dcwsb j get i get put /cw cw 1 add def } if } for } for 0 1 ecpb 1 sub { % Interleave the error codeword blocks /i exch def 0 1 ecb1 ecb2 add 1 sub { /j exch def cws cw ecwsb j get i get put /cw cw 1 add def } for } for % Extend codewords by one if there are remainder bits rbit 0 gt { /pad cws length 1 add array def pad 0 cws putinterval pad pad length 1 sub 0 put /cws pad def } if % Fixups for the short final data byte in M1 and M3 symbols lc4b { dcws 1 sub 1 ncws 2 sub { /i exch def cws i cws i get 15 and 4 bitshift put cws i cws i 1 add get -4 bitshift 15 and cws i get or put } for cws ncws 1 sub cws ncws 1 sub get 15 and 4 bitshift put } if % Create the bitmap /pixs [ size size mul {-1} repeat ] def /qmv {size mul add} bind def % Finder patterns /fpat [ [ 1 1 1 1 1 1 1 0 ] [ 1 0 0 0 0 0 1 0 ] [ 1 0 1 1 1 0 1 0 ] [ 1 0 1 1 1 0 1 0 ] [ 1 0 1 1 1 0 1 0 ] [ 1 0 0 0 0 0 1 0 ] [ 1 1 1 1 1 1 1 0 ] [ 0 0 0 0 0 0 0 0 ] ] def 0 1 fpat length 1 sub { /y exch def 0 1 fpat 0 get length 1 sub { /x exch def /fpb fpat y get x get def pixs x y qmv fpb put format (full) eq { pixs size x sub 1 sub y qmv fpb put pixs x size y sub 1 sub qmv fpb put } if } for } for % Alignment patterns /algnpat [ [ 1 1 1 1 1 ] [ 1 0 0 0 1 ] [ 1 0 1 0 1 ] [ 1 0 0 0 1 ] [ 1 1 1 1 1 ] ] def /putalgnpat { /py exch def /px exch def 0 1 4 { /pb exch def 0 1 4 { /pa exch def pixs px pa add py pb add qmv algnpat pb get pa get put } for } for } bind def asp2 2 sub asp3 asp2 sub size 13 sub { /i exch def i 4 putalgnpat 4 i putalgnpat } for asp2 2 sub asp3 asp2 sub size 9 sub { /x exch def asp2 2 sub asp3 asp2 sub size 9 sub { /y exch def x y putalgnpat } for } for % Timing patterns format (full) eq { 8 1 size 9 sub { /i exch def pixs i 6 qmv i 1 add 2 mod put pixs 6 i qmv i 1 add 2 mod put } for } { 8 1 size 1 sub { /i exch def pixs i 0 qmv i 1 add 2 mod put pixs 0 i qmv i 1 add 2 mod put } for } ifelse % Format information modules format (full) eq { /formatmap [ [ [ 0 8 ] [ 8 size 1 sub ] ] [ [ 1 8 ] [ 8 size 2 sub ] ] [ [ 2 8 ] [ 8 size 3 sub ] ] [ [ 3 8 ] [ 8 size 4 sub ] ] [ [ 4 8 ] [ 8 size 5 sub ] ] [ [ 5 8 ] [ 8 size 6 sub ] ] [ [ 7 8 ] [ 8 size 7 sub ] ] [ [ 8 8 ] [ size 8 sub 8 ] ] [ [ 8 7 ] [ size 7 sub 8 ] ] [ [ 8 5 ] [ size 6 sub 8 ] ] [ [ 8 4 ] [ size 5 sub 8 ] ] [ [ 8 3 ] [ size 4 sub 8 ] ] [ [ 8 2 ] [ size 3 sub 8 ] ] [ [ 8 1 ] [ size 2 sub 8 ] ] [ [ 8 0 ] [ size 1 sub 8 ] ] ] def } { /formatmap [ [ [ 1 8 ] ] [ [ 2 8 ] ] [ [ 3 8 ] ] [ [ 4 8 ] ] [ [ 5 8 ] ] [ [ 6 8 ] ] [ [ 7 8 ] ] [ [ 8 8 ] ] [ [ 8 7 ] ] [ [ 8 6 ] ] [ [ 8 5 ] ] [ [ 8 4 ] ] [ [ 8 3 ] ] [ [ 8 2 ] ] [ [ 8 1 ] ] ] def } ifelse formatmap { { {} forall qmv pixs exch 0 put } forall } forall % Version information modules size 45 ge { /versionmap [ [ [ size 9 sub 5 ] [ 5 size 9 sub ] ] [ [ size 10 sub 5 ] [ 5 size 10 sub ] ] [ [ size 11 sub 5 ] [ 5 size 11 sub ] ] [ [ size 9 sub 4 ] [ 4 size 9 sub ] ] [ [ size 10 sub 4 ] [ 4 size 10 sub ] ] [ [ size 11 sub 4 ] [ 4 size 11 sub ] ] [ [ size 9 sub 3 ] [ 3 size 9 sub ] ] [ [ size 10 sub 3 ] [ 3 size 10 sub ] ] [ [ size 11 sub 3 ] [ 3 size 11 sub ] ] [ [ size 9 sub 2 ] [ 2 size 9 sub ] ] [ [ size 10 sub 2 ] [ 2 size 10 sub ] ] [ [ size 11 sub 2 ] [ 2 size 11 sub ] ] [ [ size 9 sub 1 ] [ 1 size 9 sub ] ] [ [ size 10 sub 1 ] [ 1 size 10 sub ] ] [ [ size 11 sub 1 ] [ 1 size 11 sub ] ] [ [ size 9 sub 0 ] [ 0 size 9 sub ] ] [ [ size 10 sub 0 ] [ 0 size 10 sub ] ] [ [ size 11 sub 0 ] [ 0 size 11 sub ] ] ] def } { /versionmap [] def } ifelse versionmap { { {} forall qmv pixs exch 0 put } forall } forall % Solitary dark module in full symbols format (full) eq { pixs 8 size 8 sub qmv 1 put } if % Calculate the mask patterns format (full) eq { /maskfuncs [ {add 2 mod} bind {exch pop 2 mod} bind {pop 3 mod} bind {add 3 mod} bind {2 idiv exch 3 idiv add 2 mod} bind {mul dup 2 mod exch 3 mod add} bind {mul dup 2 mod exch 3 mod add 2 mod} bind {2 copy mul 3 mod 3 1 roll add 2 mod add 2 mod} bind ] def } { /maskfuncs [ {exch pop 2 mod} bind {2 idiv exch 3 idiv add 2 mod} bind {mul dup 2 mod exch 3 mod add 2 mod} bind {2 copy mul 3 mod 3 1 roll add 2 mod add 2 mod} bind ] def } ifelse /masks maskfuncs length array def 0 1 masks length 1 sub { /m exch def /mask size size mul array def 0 1 size 1 sub { /j exch def 0 1 size 1 sub { /i exch def i j maskfuncs m get exec 0 eq pixs i j qmv get -1 eq and {1} {0} ifelse mask i j qmv 3 -1 roll put } for } for masks m mask put } for % Walk the symbol placing the bitstream /posx size 1 sub def /posy size 1 sub def /dir -1 def % -1 is upwards, 1 is downwards /col 1 def % 0 is left bit, 1 is right bit /num 0 def { % loop posx 0 lt {exit} if pixs posx posy qmv get -1 eq { cws num 8 idiv get 7 num 8 mod sub neg bitshift 1 and pixs posx posy qmv 3 -1 roll put /num num 1 add def } if col 1 eq { /col 0 def /posx posx 1 sub def } { /col 1 def /posx posx 1 add def /posy posy dir add def posy 0 lt posy size ge or { % Turn around at top and bottom /dir dir -1 mul def /posy posy dir add def /posx posx 2 sub def % Hop over the timing pattern in full size symbols format (full) eq posx 6 eq and {/posx posx 1 sub def} if } if } ifelse } loop % Evaluate runlength encoded rows or columns in full symbols /evalfulln1n3 { /scrle exch def % Detect runs of 5 or more like modules /scr1 0 scrle { dup 5 ge {add 2 sub dup} if pop } forall def % Detect 1:1:3:1:1 ratio next to 4 modules of whitespace /scr3 0 def 3 2 scrle length 3 sub { % Scan odd (dark) runs within bounds /j exch def scrle j get 3 mod 0 eq { % Multiple of 3 black modules /fact scrle j get 3 idiv def scrle j 2 sub 5 getinterval {fact eq} forall and exch pop and and { j 3 eq j 4 add scrle length ge or { % At either extent of run /scr3 scr3 40 add def } { % Bounded by dark modules scrle j 3 sub get 4 ge scrle j 3 add get 4 ge or { /scr3 scr3 40 add def } if } ifelse } if } if } for scr1 scr3 } bind def % Evaluation algorithm for full symbols /evalfull { /sym exch def /n1 0 def /n2 0 def /n3 0 def /rle size 1 add array def /lastpairs size array def /thispairs size array def /sizeadd1 size 1 add def 0 1 size 1 sub { /i exch def % Runlength encode (light, dark, light, ...) and evaluate each column mark 0 0 i size dup dup mul 1 sub { sym exch get exch 1 index eq {exch 1 add exch} {1 exch} ifelse } for pop rle 0 counttomark 2 sub getinterval astore evalfulln1n3 n3 add /n3 exch def n1 add /n1 exch def pop % Runlength encode (light, dark, light, ...) and evaluate each row /symrow sym i size mul size getinterval def mark 0 0 symrow { exch 1 index eq {exch 1 add exch} {1 exch} ifelse } forall pop rle 0 counttomark 2 sub getinterval astore evalfulln1n3 n3 add /n3 exch def n1 add /n1 exch def pop % Count and score same coloured blocks /lastpairs thispairs /thispairs lastpairs def def symrow 0 get 1 eq {0} {1} ifelse symrow {exch 1 index add exch} forall pop thispairs astore pop i 0 gt { mark lastpairs aload pop thispairs aload pop n2 size { exch sizeadd1 index add 3 and 0 eq {3 add} if } repeat /n2 exch def cleartomark } if } for % Score dark/light imbalance /dark 0 sym {add} forall def /n4 dark 100 mul size dup mul div 50 sub abs 5 div cvi 10 mul def n1 n2 add n3 add n4 add } bind def % Evaluation algorithm for micro symbols /evalmicro { /sym exch def /dkrhs 0 def /dkbot 0 def 1 1 size 1 sub { /i exch def /dkrhs dkrhs sym size 1 sub i qmv get add def /dkbot dkbot sym i size 1 sub qmv get add def } for dkrhs dkbot le { dkrhs 16 mul dkbot add neg } { dkbot 16 mul dkrhs add neg } ifelse } bind def % Evaluate the masked symbols to find the most suitable /bestscore 999999999 def 0 1 masks length 1 sub { /m exch def /masksym size size mul array def 0 1 size size mul 1 sub { /i exch def masksym i pixs i get masks m get i get xor put } for format (full) eq { masksym evalfull /score exch def } { masksym evalmicro /score exch def } ifelse score bestscore lt { /bestsym masksym def /bestmaskval m def /bestscore score def } if } for /pixs bestsym def % Add the format information format (full) eq { /fmtvals [ 16#5412 16#5125 16#5e7c 16#5b4b 16#45f9 16#40ce 16#4f97 16#4aa0 16#77c4 16#72f3 16#7daa 16#789d 16#662f 16#6318 16#6c41 16#6976 16#1689 16#13be 16#1ce7 16#19d0 16#0762 16#0255 16#0d0c 16#083b 16#355f 16#3068 16#3f31 16#3a06 16#24b4 16#2183 16#2eda 16#2bed ] def /ecid (MLHQ) eclevel search pop length exch pop exch pop def /fmtval fmtvals ecid 3 bitshift bestmaskval add get def } { /fmtvals [ 16#4445 16#4172 16#4e2b 16#4b1c 16#55ae 16#5099 16#5fc0 16#5af7 16#6793 16#62a4 16#6dfd 16#68ca 16#7678 16#734f 16#7c16 16#7921 16#06de 16#03e9 16#0cb0 16#0987 16#1735 16#1202 16#1d5b 16#186c 16#2508 16#203f 16#2f66 16#2a51 16#34e3 16#31d4 16#3e8d 16#3bba ] def /symid [ [0] [1 2] [3 4] [5 6 7] ] size 11 sub 2 idiv get eclval get def /fmtval fmtvals symid 2 bitshift bestmaskval add get def } ifelse 0 1 formatmap length 1 sub { /i exch def formatmap i get { pixs exch {} forall qmv fmtval 14 i sub neg bitshift 1 and put } forall } for % Add the version information size 45 ge { /vervals [ 16#07c94 16#085bc 16#09a99 16#0a4d3 16#0bbf6 16#0c762 16#0d847 16#0e60d 16#0f928 16#10b78 16#1145d 16#12a17 16#13532 16#149a6 16#15683 16#168c9 16#177ec 16#18ec4 16#191e1 16#1afab 16#1b08e 16#1cc1a 16#1d33f 16#1ed75 16#1f250 16#209d5 16#216fd 16#228ba 16#2379f 16#24b0b 16#2542e 16#26a64 16#27541 16#28c69 ] def /verval vervals size 17 sub 4 idiv 7 sub get def 0 1 versionmap length 1 sub { /i exch def versionmap i get { pixs exch {} forall qmv verval 17 i sub neg bitshift 1 and put } forall } for } if % Return the arguments << /ren //renmatrix /pixs pixs /pixx size /pixy size /height size 2 mul 72 div /width size 2 mul 72 div /opt options >> dontdraw not //renmatrix if end } bind def /qrcode dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER qrcode-- postscriptbarcode-2014-03-12/src/raiseerror.ps000066400000000000000000000031501231007474100211420ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN RESOURCE raiseerror-- % --REQUIRES preamble-- /setpacking where {pop currentpacking true setpacking} if 1 dict begin /raiseerror { $error exch /errorinfo exch put $error exch /errorname exch put $error /command null put $error /newerror true put handleerror quit } bind def /raiseerror dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END RESOURCE raiseerror-- postscriptbarcode-2014-03-12/src/rationalizedCodabar.ps000066400000000000000000000157531231007474100227420ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER rationalizedCodabar-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Codabar % --EXAM: A0123456789B % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /rationalizedCodabar { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /altstartstop false def /includecheck false def % Enable/disable checkdigit /validatecheck false def /includetext false def % Enable/disable text /includecheckintext false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Create an array containing the character mappings /encs [ (11111331) (11113311) (11131131) (33111111) (11311311) (31111311) (13111131) (13113111) (13311111) (31131111) (11133111) (11331111) (31113131) (31311131) (31313111) (11313131) (11331311) (13131131) (11131331) (11133311) ] def % Create a string of the available characters altstartstop { /barchars (0123456789-$:/.+TN*E) def } { /barchars (0123456789-$:/.+ABCD) def } ifelse /charvals 20 dict def 0 1 19 {charvals exch dup barchars exch 1 getinterval exch put} for /bodyvals 16 dict def 0 1 15 {bodyvals exch dup barchars exch 1 getinterval exch put} for /ssvals 4 dict def 16 1 19 {ssvals exch dup barchars exch 1 getinterval exch put} for % Validate the input barcode 0 1 getinterval ssvals exch known not barcode barcode length 1 sub 1 getinterval ssvals exch known not or { altstartstop { /bwipp.rationalizedCodabarBadAltStartStop (Codabar start and stop characters must be one of E N T or *) //raiseerror exec } { /bwipp.rationalizedCodabarBadStartStop (Codabar start and stop characters must be one of A B C or D) //raiseerror exec } ifelse } if 1 1 barcode length 2 sub { barcode exch 1 getinterval bodyvals exch known not { /bwipp.rationalizedCodabarBadCharacter (Codabar body must contain only digits and symbols - $ : / . +) //raiseerror exec } if } for /barlen barcode length validatecheck {1 sub} if def /checksum 0 def 0 1 barlen 2 sub { barcode exch 1 getinterval charvals exch get checksum add /checksum exch def } for barcode barcode length 1 sub 1 getinterval charvals exch get checksum add /checksum exch def /checksum 16 checksum 16 mod sub 16 mod def validatecheck { barcode barlen 1 sub get barchars checksum get ne { /bwipp.rationalizedCodabarBadCheckDigit (Incorrect Codabar check digit provided) //raiseerror exec } if barlen string dup 0 barcode 0 barlen 1 sub getinterval putinterval dup barlen 1 sub barcode barlen 1 getinterval putinterval /barcode exch def /includecheck true def } if /sbs barlen includecheck {1 add} if 8 mul string def /txt barlen includecheck {1 add} if array def /xpos 0 def 0 1 barlen 2 sub { /i exch def /indx charvals barcode i 1 getinterval get def /enc encs indx get def sbs i 8 mul enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval xpos textyoffset textfont textsize] put 0 1 7 { % xpos+=width of the character /xpos exch enc exch get 48 sub xpos add def } for } for % Put the checksum character and stop character includecheck { % Put the checksum character sbs barlen 8 mul 8 sub encs checksum get putinterval includecheckintext { txt barlen 1 sub [barchars checksum 1 getinterval xpos textyoffset textfont textsize] put } { txt barlen 1 sub [( ) xpos textyoffset textfont textsize] put } ifelse 0 1 7 { % xpos+=width of the character /xpos exch encs checksum get exch get 48 sub xpos add def } for % Put the end character /indx charvals barcode barlen 1 sub 1 getinterval get def /enc encs indx get def % Get the indxth encoding sbs barlen 8 mul enc putinterval % Put encoded digit into sbs txt barlen [barcode barlen 1 sub 1 getinterval xpos textyoffset textfont textsize] put } { % Put the end character /indx charvals barcode barlen 1 sub 1 getinterval get def /enc encs indx get def % Get the indxth encoding sbs barlen 8 mul 8 sub enc putinterval % Put encoded digit into sbs txt barlen 1 sub [barcode barlen 1 sub 1 getinterval xpos textyoffset textfont textsize] put } ifelse % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /rationalizedCodabar dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER rationalizedCodabar-- postscriptbarcode-2014-03-12/src/raw.ps000066400000000000000000000053441231007474100175650ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER raw-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Custom 1D symbology % --EXAM: 331132131313411122131311333213114131131221323 % --EXOP: height=0.5 % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /raw { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /height height cvr def % Validate input barcode { dup 49 lt exch 57 gt or { /bwipp.rawBadCharacter (Raw must contain only digits 1 to 9) //raiseerror exec } if } forall % Return the arguments << /ren //renlinear /sbs [barcode {48 sub} forall] /bhs [barcode length 1 add 2 idiv {height} repeat] /bbs [barcode length 1 add 2 idiv {0} repeat] /opt options >> dontdraw not //renlinear if end } bind def /raw dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER raw-- postscriptbarcode-2014-03-12/src/renlinear.ps000066400000000000000000000221271231007474100207510ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN RENDERER renlinear-- % --REQUIRES preamble raiseerror-- /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put begin /renlinear { 20 dict begin % Confine variables to local scope /args exch def % We are given some arguments % Default options /sbs [] def /bhs [] def /bbs [] def /txt [] def /barcolor (unset) def /includetext false def /textcolor (unset) def /textxalign (unset) def /textyalign (unset) def /textfont (Courier) def /textsize 10 def /textxoffset 0 def /textyoffset 0 def /textgaps 0 def /alttext () def /bordercolor (unset) def /backgroundcolor (unset) def /inkspread 0.15 def /width 0 def /barratio 1 def /spaceratio 1 def /showborder false def /borderleft 10 def /borderright 10 def /bordertop 1 def /borderbottom 1 def /borderwidth 0.5 def /guardwhitespace false def /guardleftpos 0 def /guardleftypos 0 def /guardrightpos 0 def /guardrightypos 0 def /guardwidth 6 def /guardheight 7 def % Apply the renderer options and the user options args {def} forall opt {def} forall /barcolor barcolor cvlit def /textcolor textcolor cvlit def /textxalign textxalign cvlit def /textyalign textyalign cvlit def /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /textgaps textgaps cvr def /alttext alttext cvlit def /bordercolor bordercolor cvlit def /backgroundcolor backgroundcolor cvlit def /inkspread inkspread cvr def /width width cvr def /barratio barratio cvr def /spaceratio spaceratio cvr def /borderleft borderleft cvr def /borderright borderright cvr def /bordertop bordertop cvr def /borderbottom borderbottom cvr def /borderwidth borderwidth cvr def /guardleftpos guardleftpos cvr def /guardleftypos guardleftypos cvr def /guardrightpos guardrightpos cvr def /guardrightypos guardrightypos cvr def /guardwidth guardwidth cvr def /guardheight guardheight cvr def % Create bar elements and put them into the bars array /bars sbs length 1 add 2 idiv array def /x 0.00 def /maxh 0 def 0 1 sbs length 1 add 2 idiv 2 mul 2 sub { /i exch def i 2 mod 0 eq { % i is even /d sbs i get barratio mul barratio sub 1 add def % d=digit*r-r+1 sbs i get 0 ne { /h bhs i 2 idiv get 72 mul def % Height from bhs /c d 2 div x add def % Centre of the bar = x + d/2 /y bbs i 2 idiv get 72 mul def % Baseline from bbs /w d inkspread sub def % bar width = digit - inkspread bars i 2 idiv [h c y w] put % Add the bar entry h y add maxh gt {/maxh h y add def} if } { bars i 2 idiv -1 put % Dummy entry } ifelse } { /d sbs i get spaceratio mul spaceratio sub 1 add def % d=digit*r-r+1 } ifelse /x x d add def % x+=d } for gsave currentpoint translate % Force symbol to given width width 0 ne { width 72 mul x div 1 scale } if % Set RGB or CMYK color depending on length of given hex string /setanycolor { /anycolor exch def anycolor length 6 eq { (< >) 8 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setrgbcolor } if anycolor length 8 eq { (< >) 10 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setcmykcolor } if } bind def % Display the border and background newpath borderleft neg borderbottom neg moveto x borderleft add borderright add 0 rlineto 0 maxh borderbottom add bordertop add rlineto x borderleft add borderright add neg 0 rlineto 0 maxh borderbottom add bordertop add neg rlineto closepath backgroundcolor (unset) ne { gsave backgroundcolor setanycolor fill grestore } if showborder { gsave bordercolor (unset) ne { bordercolor setanycolor } if borderwidth setlinewidth stroke grestore } if % Display the bars for elements in the bars array gsave 0 setlinecap barcolor (unset) ne { barcolor setanycolor } if bars { dup -1 ne { aload pop newpath setlinewidth moveto 0 exch rlineto stroke } { pop } ifelse } forall grestore % Display the text for elements in the text array textcolor (unset) ne { textcolor setanycolor } if includetext { textxalign (unset) eq textyalign (unset) eq and alttext () eq and { /s 0 def /fn () def txt { {} forall 2 copy s ne exch fn ne or { 2 copy /s exch def /fn exch def exch findfont exch scalefont setfont } { pop pop } ifelse moveto show } forall } { textfont findfont textsize scalefont setfont alttext () eq { /txt [ txt { 0 get {} forall } forall ] def /tstr txt length string def 0 1 txt length 1 sub { dup txt exch get tstr 3 1 roll put } for } { /tstr alttext def } ifelse % Find true ascent of font tstr length 0 eq { 0 } { gsave newpath 0 0 moveto (0) false charpath pathbbox 4 1 roll pop pop pop grestore currentfont /PaintType known {currentfont /PaintType get 2 eq} {false} ifelse currentfont /StrokeWidth known and { currentfont /StrokeWidth get 2 div 0 exch currentfont /FontMatrix get dtransform dup mul exch dup mul add sqrt add } if } ifelse /textascent exch def /textwidth tstr stringwidth pop tstr length 1 sub textgaps mul add def /textxpos textxoffset x textwidth sub 2 div add def textxalign (left) eq { /textxpos textxoffset def } if textxalign (right) eq { /textxpos x textxoffset sub textwidth sub def } if textxalign (offleft) eq { /textxpos textwidth textxoffset add neg def } if textxalign (offright) eq { /textxpos x textxoffset add def } if textxalign (justify) eq textwidth x lt and { /textxpos 0 def /textgaps x textwidth sub tstr length 1 sub div def } if /textypos textyoffset textascent add 1 add neg def textyalign (above) eq { /textypos textyoffset maxh add 1 add def } if textyalign (center) eq { /textypos textyoffset maxh textascent sub 2 div add def } if textxpos textypos moveto textgaps 0 tstr ashow } ifelse } if % Display the guard elements guardwhitespace { 0.75 setlinewidth guardleftpos 0 ne { newpath guardleftpos neg guardwidth add guardleftypos guardwidth 2 div add moveto guardwidth neg guardheight -2 div rlineto guardwidth guardheight -2 div rlineto stroke } if guardrightpos 0 ne { newpath guardrightpos x add guardwidth sub guardrightypos guardheight 2 div add moveto guardwidth guardheight -2 div rlineto guardwidth neg guardheight -2 div rlineto stroke } if } if grestore end } bind def /renlinear dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END RENDERER renlinear-- postscriptbarcode-2014-03-12/src/renmatrix.ps000066400000000000000000000060111231007474100207750ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN RENDERER renmatrix-- % --REQUIRES preamble raiseerror-- /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put begin /renmatrix { 20 dict begin /args exch def % Default options /width 1 def /height 1 def /barcolor (unset) def /backgroundcolor (unset) def % Apply the renderer options and the user options args {def} forall opt {def} forall /width width cvr def /height height cvr def /barcolor barcolor cvlit def /backgroundcolor backgroundcolor cvlit def % Set RGB or CMYK color depending on length of given hex string /setanycolor { /anycolor exch def anycolor length 6 eq { (< >) 8 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setrgbcolor } if anycolor length 8 eq { (< >) 10 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setcmykcolor } if } bind def % Draw the image gsave currentpoint translate width pixx div 72 mul height pixy div 72 mul scale 0 0 moveto pixx 0 lineto pixx pixy lineto 0 pixy lineto closepath backgroundcolor (unset) ne { gsave backgroundcolor setanycolor fill grestore } if barcolor (unset) ne { barcolor setanycolor } if /xyget {pixx mul add get} bind def newpath 0 1 pixs length 1 sub { dup pixx mod /x exch def pixx idiv /y exch def pixs x y xyget 1 eq { x pixy y sub 1 sub moveto 0 1 rlineto 1 0 rlineto 0 -1 rlineto -1 0 rlineto closepath } if } for fill grestore end } bind def /renmatrix dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END RENDERER renmatrix-- postscriptbarcode-2014-03-12/src/renmaximatrix.ps000066400000000000000000000065371231007474100216710ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN RENDERER renmaximatrix-- % --REQUIRES preamble raiseerror-- /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put begin /renmaximatrix { 20 dict begin /args exch def % We are given some arguments % Default options /barcolor (unset) def /backgroundcolor (unset) def % Apply the renderer options and the user options args {def} forall opt {def} forall /barcolor barcolor cvlit def /backgroundcolor backgroundcolor cvlit def % Set RGB or CMYK color depending on length of given hex string /setanycolor { /anycolor exch def anycolor length 6 eq { (< >) 8 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setrgbcolor } if anycolor length 8 eq { (< >) 10 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setcmykcolor } if } bind def gsave currentpoint translate 2.4945 dup scale % from 1pt to 1.88mm 0 0 moveto 30 0 lineto 30 29 lineto 0 29 lineto closepath backgroundcolor (unset) ne { gsave backgroundcolor setanycolor fill grestore } if barcolor (unset) ne { barcolor setanycolor } if 0.5 0.5774 translate newpath pixs { dup /x exch 30 mod def /y exch 30 idiv def y 2 mod 0 eq {x} {x 0.5 add} ifelse 32 y sub 0.8661 mul moveto 0 0.5774 rmoveto -0.5 -0.2887 rlineto 0 -0.5774 rlineto 0.5 -0.2887 rlineto 0.5 0.2887 rlineto 0 0.5774 rlineto -0.5 0.2887 rlineto closepath } forall fill % Plot the locator symbol newpath 14 13.8576 0.5774 0 360 arc closepath 14 13.8576 1.3359 360 0 arcn closepath fill newpath 14 13.8576 2.1058 0 360 arc closepath 14 13.8576 2.8644 360 0 arcn closepath fill newpath 14 13.8576 3.6229 0 360 arc closepath 14 13.8576 4.3814 360 0 arcn closepath fill grestore end } bind def /renmaximatrix dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END RENDERER renmaximatrix-- postscriptbarcode-2014-03-12/src/royalmail.ps000066400000000000000000000132621231007474100207630ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER royalmail-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Royal Mail 4 State Customer Code % --EXAM: LE28HS9Z % --EXOP: includetext barcolor=FF0000 % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /royalmail { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /validatecheck false def /includecheckintext false def /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 0.175 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Create a string of the available characters /barchars (ZUVWXY501234B6789AHCDEFGNIJKLMTOPQRS) def /charvals 36 dict def 0 1 35 {charvals exch dup barchars exch 1 getinterval exch put} for % Validate the input 0 1 barcode length 1 sub { barcode exch 1 getinterval charvals exch known not { /bwipp.royalmailBadCharacter (RM4SCC must contain only capital letters and digits) //raiseerror exec } if } for /barlen barcode length validatecheck {1 sub} if def /checksumrow 0 def /checksumcol 0 def 0 1 barlen 1 sub { /i exch def /indx charvals barcode i 1 getinterval get def /checksumrow checksumrow indx 6 idiv add def /checksumcol checksumcol indx 6 mod add def } for /checksum checksumrow 6 mod 6 mul checksumcol 6 mod add def validatecheck { barcode barlen get barchars checksum get ne { /bwipp.royalmailBadCheckDigit (Incorrect RM4SCC check digit provided) //raiseerror exec } if /barcode barcode 0 barlen getinterval def } if % Create an array containing the character mappings /encs [ (3300) (2211) (2301) (2310) (3201) (3210) (1122) (0033) (0123) (0132) (1023) (1032) (1302) (0213) (0303) (0312) (1203) (1212) (1320) (0231) (0321) (0330) (1221) (1230) (3102) (2013) (2103) (2112) (3003) (3012) (3120) (2031) (2121) (2130) (3021) (3030) (2) (3) ] def /encstr barlen 4 mul 6 add string def /txt barlen 1 add array def % Put start character encstr 0 encs 36 get putinterval 0 1 barlen 1 sub { /i exch def /indx charvals barcode i 1 getinterval get def encstr i 4 mul 1 add encs indx get putinterval txt i [barcode i 1 getinterval i 4 mul 1 add 3.312 mul textyoffset textfont textsize] put } for % Put the checksum character encstr barlen 4 mul 1 add encs checksum get putinterval includecheckintext { txt barlen [barchars checksum 1 getinterval barlen 4 mul 1 add 3.312 mul textyoffset textfont textsize] put } { txt barlen [( ) barlen 4 mul 1 add 3.312 mul textyoffset textfont textsize] put } ifelse % Put end character encstr barlen 4 mul 5 add encs 37 get putinterval /bbs encstr length array def /bhs encstr length array def 0 1 encstr length 1 sub { /i exch def /enc encstr i 1 getinterval def enc (0) eq { bbs i 3 height mul 8 div put bhs i 2 height mul 8 div put } if enc (1) eq { bbs i 0 height mul 8 div put bhs i 5 height mul 8 div put } if enc (2) eq { bbs i 3 height mul 8 div put bhs i 5 height mul 8 div put } if enc (3) eq { bbs i 0 height mul 8 div put bhs i 8 height mul 8 div put } if } for % Return the arguments << /ren //renlinear /bbs bbs /bhs bhs /sbs [bhs length 1 sub {1.44 1.872} repeat 1.44] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /royalmail dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER royalmail-- postscriptbarcode-2014-03-12/src/sample000066400000000000000000000111121231007474100176220ustar00rootroot00000000000000%!PS % We call the procedures like this: /Helvetica findfont 10 scalefont setfont 30 480 moveto (CODE 39) (includecheck includetext) /code39 /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (Code 39) show 385 180 moveto (THIS IS CODE 93) (includecheck includetext) /code93 /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (Code 93) show 375 380 moveto (\(00\)030123456789012340|\(02\)13012345678909\(37\)24\(10\)1234567ABCDEFG) (ccversion=c includetext) /gs1-128composite /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (GS1-128 Composite) show 150 700 moveto (0123456789) (includecheck includetext) /interleaved2of5 /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (Interleaved 2 of 5) show 215 280 moveto ((01)24012345678905) (includetext) /databartruncated /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (DataBar Truncated) show 250 230 moveto ((01)24012345678905) () /databarstacked /uk.co.terryburton.bwipp findresource exec 0 -10 rmoveto (DataBar Stacked) show 220 540 moveto ((01)15012345678907) () /databarlimited /uk.co.terryburton.bwipp findresource exec 0 -10 rmoveto (DataBar Limited) show 220 480 moveto ((10)12A) () /databarexpanded /uk.co.terryburton.bwipp findresource exec 0 -10 rmoveto (DataBar Expanded) show 215 328 moveto (117480) (includetext) /pharmacode /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (Pharmacode) show 30 280 moveto (01234567) (includetext includecheck) /code2of5 /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (Code 2 of 5) show 165 580 moveto (0124589) << /includetext true /includecheck true /barcolor (AA0000) /textyoffset -8 /textcolor (008888) /backgroundcolor (2020FF0F) /showborder true /bordercolor (0000FF) >> /code11 /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (Code 11) show 30 380 moveto (A0123456789B) (includecheck includetext) /rationalizedCodabar /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (Rationalized Codabar) show 420 700 moveto (977147396801 05) (includetext guardwhitespace) /ean13 /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (EAN-13) show 41 700 moveto (01335583) (includetext guardwhitespace) /ean8 /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (EAN-8) show 37 580 moveto (78858101497) (includetext) /upca /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (UPC-A) show 315 700 moveto (0425261) (includetext) /upce /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (UPC-E) show 405 580 moveto (978-1-86074-271 54495) (includetext) /isbn /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (ISBN) show 345 495 moveto (0123456709498765432101234567891) (includetext) /onecode /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (OneCode) show 215 435 moveto (01234) (includetext) /postnet /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (Postnet) show 215 390 moveto (LE28HS9Z) (includetext) /royalmail /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (Royal Mail) show 400 145 moveto (1231FZ13XHS) (includetext) /kix /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (KIX) show 335 535 moveto (6540123789-A-K-Z) (includetext textxalign=center) /japanpost /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (JapanPost) show 385 112 moveto (5956439111ABA 9) (includetext) /auspost /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (AusPost) show 348 280 moveto (123456) (includecheck includetext) /msi /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (MSI) show 30 180 moveto (123AB) (includetext) /plessey /uk.co.terryburton.bwipp findresource exec 0 -17 rmoveto (Plessey) show 47 115 moveto (10012345678902) (includetext) /itf14 /uk.co.terryburton.bwipp findresource exec -15 -20 rmoveto (ITF-14) show 245 105 moveto (http://lwn.net) () /qrcode /uk.co.terryburton.bwipp findresource exec 0 -10 rmoveto (QR Code) show 483 280 moveto ([\)>^03001^02996152382802^029840^029001^0291Z00004951^029UPSN^02906X610^029159^0291234567^0291/1^029^029Y^029634 ALPHA DR^029PITTSBURGH^029PA^029^004) (mode=2 parse) /maxicode /uk.co.terryburton.bwipp findresource exec 0 -10 rmoveto (MaxiCode) show 245 170 moveto (This is PDF417) (columns=2 barcolor=442222 backgroundcolor=AABBCC) /pdf417 /uk.co.terryburton.bwipp findresource exec 0 -10 rmoveto (PDF417) show 290 580 moveto (http://www.terryburton.co.uk/barcodewriter/) (rows=48 columns=48) /datamatrix /uk.co.terryburton.bwipp findresource exec 0 -10 rmoveto (Data Matrix) show 315 105 moveto (This is Aztec Code) (format=compact layers=3) /azteccode /uk.co.terryburton.bwipp findresource exec 0 -10 rmoveto (Aztec Code) show showpage postscriptbarcode-2014-03-12/src/sscc18.ps000066400000000000000000000102221231007474100200670ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER sscc18-- % --REQUIRES preamble raiseerror renlinear code128-- % --DESC: SSCC-18 % --EXAM: (00)006141411234567890 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /code128 dup /uk.co.terryburton.bwipp findresource put begin /sscc18 { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textxoffset 0 def /textyoffset -7 def /height 1 def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /height height cvr def % Validate the input barcode 0 4 getinterval (\(00\)) ne { /bwipp.sscc18badAI (SSCC-18 must begin with (00) application identifier) //raiseerror exec } if barcode length 21 ne barcode length 22 ne and { /bwipp.sscc18badLength (SSCC-18 must be 17 or 18 digits) //raiseerror exec } if barcode 4 barcode length 4 sub getinterval { dup 48 lt exch 57 gt or { /bwipp.sscc18badCharacter (SSCC-18 must contain only digits) //raiseerror exec } if } forall % Calculate checksum and add to end of barcode /checksum 0 def 0 1 16 { /i exch def /checksum checksum barcode i 4 add get 48 sub i 2 mod 0 eq {3 mul} if add def } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 22 eq { barcode 21 get checksum 48 add ne { /bwipp.sscc18badCheckDigit (Incorrect SSCC-18 check digit provided) //raiseerror exec } if } if 22 string dup 0 barcode putinterval dup 21 checksum 48 add put /barcode exch def /sscc barcode 4 18 getinterval def % Compose input to code128 /text barcode def /barcode 25 string def barcode 0 (^FNC100) putinterval barcode 7 sscc putinterval % Get the result of encoding with code128 options (dontdraw) true put options (parsefnc) true put /args barcode options //code128 exec def args (txt) [ [text textxoffset textyoffset textfont textsize] ] put args (textxalign) (center) put args (opt) options put args dontdraw not //renlinear if end } bind def /sscc18 dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER sscc18-- postscriptbarcode-2014-03-12/src/symbol.ps000066400000000000000000000065361231007474100203050ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER symbol-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Miscellaneous symbols % --EXAM: fima % --EXOP: backgroundcolor=DD000011 % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /symbol { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /symbols << /fima { /sbs [2.25 2.25 2.25 11.25 2.25 11.25 2.25 2.25 2.25] def /bhs [.625 .625 .625 .625 .625] def /bbs [0 0 0 0 0] def } bind /fimb { /sbs [2.25 6.75 2.25 2.25 2.25 6.25 2.25 2.25 2.25 6.75 2.25] def /bhs [.625 .625 .625 .625 .625 .625] def /bbs [0 0 0 0 0 0] def } bind /fimc { /sbs [2.25 2.25 2.25 6.75 2.25 6.75 2.25 6.75 2.25 2.25 2.25] def /bhs [.625 .625 .625 .625 .625 .625] def /bbs [0 0 0 0 0 0] def } bind /fimd { /sbs [2.25 2.25 2.25 2.25 2.25 6.75 2.25 6.75 2.25 2.25 2.25 2.25 2.25] def /bhs [.625 .625 .625 .625 .625 .625 .625] def /bbs [0 0 0 0 0 0 0] def } bind >> def % Valiate input symbols barcode known not { /bwipp.symbolUnknownSymbol (Unknown symbol name provided) //raiseerror exec } if symbols barcode get exec % Return the arguments << /ren //renlinear /sbs sbs /bhs bhs /bbs bbs /opt options >> dontdraw not //renlinear if end } bind def /symbol dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER symbol-- postscriptbarcode-2014-03-12/src/telepen.ps000066400000000000000000000172501231007474100204270ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER telepen-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Telepen % --EXAM: 123456 % --EXOP: numeric includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put begin /telepen { 20 dict begin % Confine variables to local scope /options exch def % We are given an option string /barcode exch def % We are given a barcode string /numeric false def /dontdraw false def /includetext false def % Enable/disable text /textfont /Courier def /textsize 10 def /textyoffset -7 def /height 1 def /parse false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textyoffset textyoffset cvr def /height height cvr def % Parse ordinals of the form ^NNN to ASCII parse { /msg barcode length string def /j 0 def barcode { % loop (^) search { dup msg exch j exch putinterval length j add 1 add /j exch def pop dup 0 3 getinterval cvi msg exch j 1 sub exch put dup length 3 sub 3 exch getinterval } { dup msg exch j exch putinterval length j add /j exch def /barcode msg 0 j getinterval def exit } ifelse } loop } if % Create an array containing the character mappings /encs [ (31313131) (1131313111) (33313111) (1111313131) (3111313111) (11333131) (13133131) (111111313111) (31333111) (1131113131) (33113131) (1111333111) (3111113131) (1113133111) (1311133111) (111111113131) (3131113111) (11313331) (333331) (111131113111) (31113331) (1133113111) (1313113111) (1111113331) (31131331) (113111113111) (3311113111) (1111131331) (311111113111) (1113111331) (1311111331) (11111111113111) (31313311) (1131311131) (33311131) (1111313311) (3111311131) (11333311) (13133311) (111111311131) (31331131) (1131113311) (33113311) (1111331131) (3111113311) (1113131131) (1311131131) (111111113311) (3131111131) (1131131311) (33131311) (111131111131) (3111131311) (1133111131) (1313111131) (111111131311) (3113111311) (113111111131) (3311111131) (111113111311) (311111111131) (111311111311) (131111111311) (11111111111131) (3131311111) (11313133) (333133) (111131311111) (31113133) (1133311111) (1313311111) (1111113133) (313333) (113111311111) (3311311111) (11113333) (311111311111) (11131333) (13111333) (11111111311111) (31311133) (1131331111) (33331111) (1111311133) (3111331111) (11331133) (13131133) (111111331111) (3113131111) (1131111133) (33111133) (111113131111) (3111111133) (111311131111) (131111131111) (111111111133) (31311313) (113131111111) (3331111111) (1111311313) (311131111111) (11331313) (13131313) (11111131111111) (3133111111) (1131111313) (33111313) (111133111111) (3111111313) (111313111111) (131113111111) (111111111313) (313111111111) (1131131113) (33131113) (11113111111111) (3111131113) (113311111111) (131311111111) (111111131113) (3113111113) (11311111111111) (331111111111) (111113111113) (31111111111111) (111311111113) (131111111113) (1111111111111111) ] def /barlen barcode length def % Length of the code /sbs barlen 16 mul 48 add string def /txt barlen array def % Put the start character ASCII 95 /enc encs 95 get def sbs 0 enc putinterval /l enc length def /checksum 0 def /i 0 def /j 0 def { % loop i barlen eq {exit} if numeric { % numeric mode: 00-99 & 0X-9X barcode i get 16 gt { /np barcode i 2 getinterval def np 1 1 getinterval (X) eq { % X in even position amongst digits /indx np 0 1 getinterval cvi 17 add def } { /indx np cvi 27 add def } ifelse txt j [np j 16 mul 16 add textyoffset textfont textsize] put /i i 2 add def } { /indx barcode i get def txt j [( ) j 16 mul 16 add textyoffset textfont textsize] put /i i 1 add def } ifelse } { % ASCII mode /indx barcode i get def indx 32 ge indx 126 le and { txt j [barcode i 1 getinterval j 16 mul 16 add textyoffset textfont textsize] put } { txt j [( ) j 16 mul 16 add textyoffset textfont textsize] put } ifelse /i i 1 add def } ifelse /checksum checksum indx add def /enc encs indx get def sbs l enc putinterval % Put encoded digit into sbs /l l enc length add def /j j 1 add def } loop % Put the checksum character /checksum 127 checksum 127 mod sub 127 mod def /enc encs checksum get def sbs l enc putinterval /l l enc length add def % Put the end character ASCII 122 /enc encs 122 get def sbs l enc putinterval /l l enc length add def % Shrink sbs and txt to fit exactly /sbs sbs 0 l getinterval def /txt txt 0 j getinterval def % Return the arguments << /ren //renlinear /sbs [sbs {48 sub} forall] /bhs [sbs length 1 add 2 idiv {height} repeat] /bbs [sbs length 1 add 2 idiv {0} repeat] includetext { /txt txt } if /opt options >> dontdraw not //renlinear if end } bind def /telepen dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER telepen-- postscriptbarcode-2014-03-12/src/uk.co.terryburton.bwipp.upr000066400000000000000000000101721231007474100237100ustar00rootroot00000000000000PS-Resources-1.0 Category uk.co.terryburton.bwipp . Category uk.co.terryburton.bwipp=Category/uk.co.terryburton.bwipp . uk.co.terryburton.bwipp raiseerror=uk.co.terryburton.bwipp/raiseerror renlinear=uk.co.terryburton.bwipp/renlinear renmatrix=uk.co.terryburton.bwipp/renmatrix renmaximatrix=uk.co.terryburton.bwipp/renmaximatrix ean5=uk.co.terryburton.bwipp/ean5 ean2=uk.co.terryburton.bwipp/ean2 ean13=uk.co.terryburton.bwipp/ean13 ean8=uk.co.terryburton.bwipp/ean8 upca=uk.co.terryburton.bwipp/upca upce=uk.co.terryburton.bwipp/upce isbn=uk.co.terryburton.bwipp/isbn ismn=uk.co.terryburton.bwipp/ismn issn=uk.co.terryburton.bwipp/issn code128=uk.co.terryburton.bwipp/code128 gs1-128=uk.co.terryburton.bwipp/gs1-128 ean14=uk.co.terryburton.bwipp/ean14 sscc18=uk.co.terryburton.bwipp/sscc18 code39=uk.co.terryburton.bwipp/code39 code39ext=uk.co.terryburton.bwipp/code39ext code32=uk.co.terryburton.bwipp/code32 pzn=uk.co.terryburton.bwipp/pzn code93=uk.co.terryburton.bwipp/code93 code93ext=uk.co.terryburton.bwipp/code93ext interleaved2of5=uk.co.terryburton.bwipp/interleaved2of5 itf14=uk.co.terryburton.bwipp/itf14 identcode=uk.co.terryburton.bwipp/identcode leitcode=uk.co.terryburton.bwipp/leitcode databaromni=uk.co.terryburton.bwipp/databaromni databarstacked=uk.co.terryburton.bwipp/databarstacked databarstackedomni=uk.co.terryburton.bwipp/databarstackedomni databartruncated=uk.co.terryburton.bwipp/databartruncated databarlimited=uk.co.terryburton.bwipp/databarlimited databarexpanded=uk.co.terryburton.bwipp/databarexpanded databarexpandedstacked=uk.co.terryburton.bwipp/databarexpandedstacked pharmacode=uk.co.terryburton.bwipp/pharmacode pharmacode2=uk.co.terryburton.bwipp/pharmacode2 code2of5=uk.co.terryburton.bwipp/code2of5 code11=uk.co.terryburton.bwipp/code11 bc412=uk.co.terryburton.bwipp/bc412 rationalizedCodabar=uk.co.terryburton.bwipp/rationalizedCodabar onecode=uk.co.terryburton.bwipp/onecode postnet=uk.co.terryburton.bwipp/postnet planet=uk.co.terryburton.bwipp/planet royalmail=uk.co.terryburton.bwipp/royalmail auspost=uk.co.terryburton.bwipp/auspost kix=uk.co.terryburton.bwipp/kix japanpost=uk.co.terryburton.bwipp/japanpost msi=uk.co.terryburton.bwipp/msi plessey=uk.co.terryburton.bwipp/plessey telepen=uk.co.terryburton.bwipp/telepen posicode=uk.co.terryburton.bwipp/posicode codablockf=uk.co.terryburton.bwipp/codablockf code16k=uk.co.terryburton.bwipp/code16k code49=uk.co.terryburton.bwipp/code49 channelcode=uk.co.terryburton.bwipp/channelcode flattermarken=uk.co.terryburton.bwipp/flattermarken raw=uk.co.terryburton.bwipp/raw daft=uk.co.terryburton.bwipp/daft symbol=uk.co.terryburton.bwipp/symbol pdf417=uk.co.terryburton.bwipp/pdf417 micropdf417=uk.co.terryburton.bwipp/micropdf417 datamatrix=uk.co.terryburton.bwipp/datamatrix qrcode=uk.co.terryburton.bwipp/qrcode maxicode=uk.co.terryburton.bwipp/maxicode azteccode=uk.co.terryburton.bwipp/azteccode codeone=uk.co.terryburton.bwipp/codeone gs1-cc=uk.co.terryburton.bwipp/gs1-cc ean13composite=uk.co.terryburton.bwipp/ean13composite ean8composite=uk.co.terryburton.bwipp/ean8composite upcacomposite=uk.co.terryburton.bwipp/upcacomposite upcecomposite=uk.co.terryburton.bwipp/upcecomposite databaromnicomposite=uk.co.terryburton.bwipp/databaromnicomposite databarstackedcomposite=uk.co.terryburton.bwipp/databarstackedcomposite databarstackedomnicomposite=uk.co.terryburton.bwipp/databarstackedomnicomposite databartruncatedcomposite=uk.co.terryburton.bwipp/databartruncatedcomposite databarlimitedcomposite=uk.co.terryburton.bwipp/databarlimitedcomposite databarexpandedcomposite=uk.co.terryburton.bwipp/databarexpandedcomposite databarexpandedstackedcomposite=uk.co.terryburton.bwipp/databarexpandedstackedcomposite gs1-128composite=uk.co.terryburton.bwipp/gs1-128composite gs1datamatrix=uk.co.terryburton.bwipp/gs1datamatrix gs1qrcode=uk.co.terryburton.bwipp/gs1qrcode hibccode39=uk.co.terryburton.bwipp/hibccode39 hibccode128=uk.co.terryburton.bwipp/hibccode128 hibcdatamatrix=uk.co.terryburton.bwipp/hibcdatamatrix hibcpdf417=uk.co.terryburton.bwipp/hibcpdf417 hibcmicropdf417=uk.co.terryburton.bwipp/hibcmicropdf417 hibcqrcode=uk.co.terryburton.bwipp/hibcqrcode hibccodablockf=uk.co.terryburton.bwipp/hibccodablockf . postscriptbarcode-2014-03-12/src/upca.ps000066400000000000000000000201571231007474100177230ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER upca-- % --REQUIRES preamble raiseerror renlinear ean5 ean2-- % --DESC: UPC-A % --EXAM: 416000336108 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /ean2 dup /uk.co.terryburton.bwipp findresource put dup /ean5 dup /uk.co.terryburton.bwipp findresource put begin /upca { 20 dict begin /options exch def /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textxoffset -7 def /textyoffset -4 def /height 1 def /addongap 12 def /addontextfont (unset) def /addontextsize (unset) def /addontextxoffset (unset) def /addontextyoffset (unset) def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /height height cvr def /addongap addongap cvr def addontextfont (unset) ne {/addontextfont addontextfont cvlit def} if addontextsize (unset) ne {/addontextsize addontextsize cvr def} if addontextxoffset (unset) ne {/addontextxoffset addontextxoffset cvr def} if addontextyoffset (unset) ne {/addontextyoffset addontextyoffset cvr def} if % Split off the addon barcode ( ) search { /barcode exch def pop /addon exch def } { pop /addon () def } ifelse % Validate the input barcode length 11 ne barcode length 12 ne and { /bwipp.upcAbadLength (UPC-A must be 11 or 12 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.upcAbadCharacter (UPC-A must contain only digits) //raiseerror exec } if } forall addon length 0 ne addon length 2 ne and addon length 5 ne and { /bwipp.upcAbadAddOnLength (Add-on for UPC-A must be 2 or 5 digits) //raiseerror exec } if % Add checksum digit to barcode /pad 12 string def % Create pad one bigger than barcode /checksum 0 def 0 1 10 { /i exch def /barchar barcode i get 48 sub def i 2 mod 0 ne { /checksum checksum barchar add def } { /checksum checksum barchar 3 mul add def } ifelse } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 12 eq { barcode 11 get checksum 48 add ne { /bwipp.upcAbadCheckDigit (Incorrect UPC-A check digit provided) //raiseerror exec } if } if pad 0 barcode putinterval % Add barcode to the start of the pad pad 11 checksum 48 add put % Put ascii for checksum at end of pad /barcode pad def % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (111) (11111) (111) ] def % Create a string of the available characters /barchars (0123456789) def /sbs 59 string def /txt 12 array def % Put the start character sbs 0 encs 10 get putinterval % Left side 0 1 5 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 4 mul 3 add enc putinterval % Put encoded digit into sbs i 0 eq { % First digit is before the guard bars txt 0 [barcode 0 1 getinterval textxoffset textyoffset textfont textsize 2 sub] put } { txt i [barcode i 1 getinterval i 7 mul 11 add textxoffset add textyoffset textfont textsize] put } ifelse } for % Put the middle character sbs 6 4 mul 3 add encs 11 get putinterval % Right side 6 1 11 { % Lookup the encoding for the each barcode character /i exch def barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding sbs i 4 mul 8 add enc putinterval % Put encoded digit into sbs i 11 eq { % Last digit is after guard bars txt 11 [barcode 11 1 getinterval textxoffset 103 add textyoffset textfont textsize 2 sub] put } { txt i [barcode i 1 getinterval i 7 mul textxoffset add 15 add textyoffset textfont textsize] put } ifelse } for % Put the end character sbs 56 encs 12 get putinterval /sbs [sbs {48 sub} forall] def includetext { /bhs [4{height}repeat 10{height .075 sub}repeat height height 10{height .075 sub}repeat 4{height}repeat] def /bbs [0 0 0 0 10{.075}repeat 0 0 10{.075}repeat 0 0 0 0] def } { /bhs [30{height}repeat] def /bbs [30{0}repeat] def /txt [] def } ifelse /guardrightypos 0 def % Append the addon addon () ne { /addopts << /dontdraw true /includetext true /height height 0.15 sub /textxoffset addontextxoffset (unset) ne {addontextxoffset} {95 addongap add} ifelse addontextyoffset (unset) ne {/textyoffset addontextyoffset} if /textsize addontextsize (unset) ne {addontextsize} {textsize} ifelse /textfont addontextfont (unset) ne {addontextfont} {textfont} ifelse >> def addon length 2 eq {addon addopts //ean2 exec} if addon length 5 eq {addon addopts //ean5 exec} if /addcode exch def /sbs [sbs aload pop addongap addcode (sbs) get aload pop] def /bhs [bhs aload pop addcode (bhs) get {.075 sub} forall] def /bbs [bbs aload pop addcode (bbs) get {.075 add} forall] def /txt [txt aload pop addcode (txt) get aload pop] def /guardrightypos height 72 mul 6 sub def } if % Return the arguments << /ren //renlinear /sbs sbs /bhs bhs /bbs bbs /txt txt /opt options /guardrightpos 10 /guardrightypos guardrightypos /borderbottom 5 >> dontdraw not //renlinear if end } bind def /upca dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER upca-- postscriptbarcode-2014-03-12/src/upcacomposite.ps000066400000000000000000000062661231007474100216530ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER upcacomposite-- % --REQUIRES preamble raiseerror renlinear renmatrix ean5 ean2 upca micropdf417 pdf417 gs1-cc-- % --DESC: UPC-A Composite % --EXAM: 416000336108|(99)1234-abcd % --EXOP: includetext % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 2 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /upca dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /upcacomposite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse gsave options (lintype) (ean13) put options (inkspread) (0) put options (dontdraw) true put % Plot the linear part linear options //upca exec //renlinear exec % Plot the separator -1 72 rmoveto << /ren //renmatrix /pixs [ 0 1 93 {0} repeat 1 0 1 0 93 {0} repeat 0 1 0 1 93 {0} repeat 1 0 ] /pixx 97 /pixy 3 /height 6 72 div /width 97 72 div /opt options >> //renmatrix exec % Plot the 2D part -2 6 rmoveto comp options //gs1-cc exec //renmatrix exec grestore end } bind def /upcacomposite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER upcacomposite-- postscriptbarcode-2014-03-12/src/upce.ps000066400000000000000000000220241231007474100177220ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER upce-- % --REQUIRES preamble raiseerror renlinear ean5 ean2-- % --DESC: UPC-E % --EXAM: 00123457 % --EXOP: includetext % --RNDR: renlinear /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /ean2 dup /uk.co.terryburton.bwipp findresource put dup /ean5 dup /uk.co.terryburton.bwipp findresource put begin /upce { 20 dict begin /options exch def % We are given an option string /barcode exch def % We are given a barcode string /dontdraw false def /includetext false def % Enable/disable text /textfont /Helvetica def /textsize 12 def /textxoffset -7 def /textyoffset -4 def /height 1 def /addongap 12 def /addontextfont (unset) def /addontextsize (unset) def /addontextxoffset (unset) def /addontextyoffset (unset) def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall /textfont textfont cvlit def /textsize textsize cvr def /textxoffset textxoffset cvr def /textyoffset textyoffset cvr def /height height cvr def /addongap addongap cvr def addontextfont (unset) ne {/addontextfont addontextfont cvlit def} if addontextsize (unset) ne {/addontextsize addontextsize cvr def} if addontextxoffset (unset) ne {/addontextxoffset addontextxoffset cvr def} if addontextyoffset (unset) ne {/addontextyoffset addontextyoffset cvr def} if % Split off the addon barcode ( ) search { /barcode exch def pop /addon exch def } { pop /addon () def } ifelse % Validate the input barcode length 7 ne barcode length 8 ne and { /bwipp.upcEbadLength (UPC-E must be 7 or 8 digits) //raiseerror exec } if barcode { dup 48 lt exch 57 gt or { /bwipp.upcEbadCharacter (UPC-E must contain only digits) //raiseerror exec } if } forall addon length 0 ne addon length 2 ne and addon length 5 ne and { /bwipp.upcEbadAddOnLength (Add-on for UPC-E must be 2 or 5 digits) //raiseerror exec } if % Ensure 0 or 1 number systems barcode 0 get dup 48 ne exch 49 ne and { /bwipp.upcEbadNumberSystem (UPC-E must have number system 0 or 1) //raiseerror exec } if % Create an array containing the character mappings /encs [ (3211) (2221) (2122) (1411) (1132) (1231) (1114) (1312) (1213) (3112) (111) (111111) ] def % Create a string of the available characters /barchars (0123456789) def /mirrormaps [ (000111) (001011) (001101) (001110) (010011) (011001) (011100) (010101) (010110) (011010) ] def % Derive the equivalent UPC-A for its checksum /upcacode (00000000000) 11 string copy def upcacode 0 barcode 0 get put barcode 6 get 48 sub 2 le { upcacode 1 barcode 1 2 getinterval putinterval upcacode 3 barcode 6 1 getinterval putinterval upcacode 8 barcode 3 3 getinterval putinterval } if barcode 6 get 48 sub 3 eq { upcacode 1 barcode 1 3 getinterval putinterval upcacode 9 barcode 4 2 getinterval putinterval } if barcode 6 get 48 sub 4 eq { upcacode 1 barcode 1 4 getinterval putinterval upcacode 10 barcode 5 1 getinterval putinterval } if barcode 6 get 48 sub 5 ge { upcacode 1 barcode 1 5 getinterval putinterval upcacode 10 barcode 6 1 getinterval putinterval } if /checksum 0 def 0 1 10 { /i exch def /barchar upcacode i get 48 sub def i 2 mod 0 ne { /checksum checksum barchar add def } { /checksum checksum barchar 3 mul add def } ifelse } for /checksum 10 checksum 10 mod sub 10 mod def barcode length 8 eq { barcode 7 get checksum 48 add ne { /bwipp.upcEbadCheckDigit (Incorrect UPC-E check digit provided) //raiseerror exec } if } if /pad 8 string def pad 0 barcode putinterval % Add barcode to the start of the pad pad 7 checksum 48 add put % Put ascii for checksum at end of pad /barcode pad def /txt 8 array def txt 0 [barcode 0 1 getinterval textxoffset textyoffset textfont textsize 2 sub] put % Determine the mirror map based on checksum /mirrormap mirrormaps checksum get def % Invert the mirrormap if we are using a non-zero number system barcode 0 get 48 eq { /invt mirrormap length string def 0 1 mirrormap length 1 sub { /i exch def mirrormap i get 48 eq { invt i 49 put } { invt i 48 put } ifelse } for /mirrormap invt def } if /sbs 33 string def % Put the start character sbs 0 encs 10 get putinterval 1 1 6 { /i exch def % Lookup the encoding for the each barcode character barcode i 1 getinterval barchars exch search pop % Discard true leaving pre length /indx exch def % indx is the length of pre pop pop % Discard seek and post /enc encs indx get def % Get the indxth encoding mirrormap i 1 sub get 49 eq { % Reverse enc if 1 in this position in mirrormap /enclen enc length def /revenc enclen string def 0 1 enclen 1 sub { /j exch def /char enc j get def revenc enclen j sub 1 sub char put } for /enc revenc def } if sbs i 1 sub 4 mul 3 add enc putinterval % Put encoded digit into sbs txt i [barcode i 1 getinterval i 1 sub 7 mul 11 add textxoffset add textyoffset textfont textsize] put } for txt 7 [barcode 7 1 getinterval 6 7 mul 18 add textxoffset add textyoffset textfont textsize 2 sub] put % Put the end character sbs 27 encs 11 get putinterval /sbs [sbs {48 sub} forall] def includetext { /bhs [height height 12{height .075 sub}repeat height height height] def /bbs [0 0 12{.075}repeat 0 0 0] def } { /bhs [17{height}repeat] def /bbs [17{0}repeat] def /txt [] def } ifelse /guardrightypos 0 def % Append the addon addon () ne { /addopts << /dontdraw true /includetext true /height height 0.15 sub /textxoffset addontextxoffset (unset) ne {addontextxoffset} {51 addongap add} ifelse addontextyoffset (unset) ne {/textyoffset addontextyoffset} if /textsize addontextsize (unset) ne {addontextsize} {textsize} ifelse /textfont addontextfont (unset) ne {addontextfont} {textfont} ifelse >> def addon length 2 eq {addon addopts //ean2 exec} if addon length 5 eq {addon addopts //ean5 exec} if /addcode exch def /sbs [sbs aload pop addongap addcode (sbs) get aload pop] def /bhs [bhs aload pop addcode (bhs) get {.075 sub} forall] def /bbs [bbs aload pop addcode (bbs) get {.075 add} forall] def /txt [txt aload pop addcode (txt) get aload pop] def /guardrightypos height 72 mul 6 sub def } if % Return the arguments << /ren //renlinear /sbs sbs /bhs bhs /bbs bbs /txt txt /opt options /guardrightpos 10 /guardrightypos guardrightypos /borderbottom 5 >> dontdraw not //renlinear if end } bind def /upce dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER upce-- postscriptbarcode-2014-03-12/src/upcecomposite.ps000066400000000000000000000067511231007474100216560ustar00rootroot00000000000000%!PS % Barcode Writer in Pure PostScript % http://www.terryburton.co.uk/barcodewriter/ % % Copyright (c) 2004-2014 Terry Burton % % $Id$ % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated % documentation files (the "Software"), to deal in the % Software without restriction, including without % limitation the rights to use, copy, modify, merge, % publish, distribute, sublicense, and/or sell copies of % the Software, and to permit persons to whom the Software % is furnished to do so, subject to the following % conditions: % % The above copyright notice and this permission notice % shall be included in all copies or substantial portions % of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY % KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO % THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A % PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL % THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, % DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. % --BEGIN ENCODER upcecomposite-- % --REQUIRES preamble raiseerror renlinear renmatrix ean5 ean2 upce micropdf417 pdf417 gs1-cc-- % --DESC: UPC-E Composite % --EXAM: 00123457|(15)021231 % --EXOP: includetext % --RNDR: renlinear renmatrix /setpacking where {pop currentpacking true setpacking} if 2 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put dup /upce dup /uk.co.terryburton.bwipp findresource put dup /gs1-cc dup /uk.co.terryburton.bwipp findresource put dup /renlinear dup /uk.co.terryburton.bwipp findresource put dup /renmatrix dup /uk.co.terryburton.bwipp findresource put begin /upcecomposite { 20 dict begin % Confine variables to local scope /options exch def /barcode exch def /dontdraw false def % Parse the input options options type /stringtype eq { 1 dict begin options { token false eq {exit} if dup length string cvs (=) search true eq {cvlit exch pop exch def} {cvlit true def} ifelse } loop currentdict end /options exch def } if options {def} forall % Split the linear and composite parts barcode (|) search { /linear exch def pop /comp exch def } { pop } ifelse % Define the separator /sep << /ren //renmatrix /pixs [ 0 1 49 {0} repeat 1 0 1 0 49 {0} repeat 0 1 0 1 49 {0} repeat 1 0 ] /pixx 53 /pixy 3 /height 6 72 div /width 53 72 div /opt options >> def gsave options (lintype) (upce) put options (inkspread) (0) put options (dontdraw) true put % Plot the linear part linear options //upce exec //renlinear exec % Plot the separator -1 72 rmoveto << /ren //renmatrix /pixs [ 0 1 49 {0} repeat 1 0 1 0 49 {0} repeat 0 1 0 1 49 {0} repeat 1 0 ] /pixx 53 /pixy 3 /height 6 72 div /width 53 72 div /opt options >> //renmatrix exec % Plot the 2D part -2 6 rmoveto comp options //gs1-cc exec //renmatrix exec grestore end } bind def /upcecomposite dup load /uk.co.terryburton.bwipp defineresource pop end /setpacking where {pop setpacking} if % --END ENCODER upcecomposite-- postscriptbarcode-2014-03-12/tests/000077500000000000000000000000001231007474100167755ustar00rootroot00000000000000postscriptbarcode-2014-03-12/tests/run_tests000077500000000000000000000003101231007474100207430ustar00rootroot00000000000000#!/bin/bash set -e TESTDIR=$(dirname $0) $TESTDIR/test_monolithic/run $TESTDIR/test_monolithic_package/run $TESTDIR/test_resource/run $TESTDIR/test_packaged_resource/run echo "All tests passed." postscriptbarcode-2014-03-12/tests/test_monolithic/000077500000000000000000000000001231007474100222015ustar00rootroot00000000000000postscriptbarcode-2014-03-12/tests/test_monolithic/run000077500000000000000000000003511231007474100227320ustar00rootroot00000000000000#!/bin/bash TEST=$(dirname $0) echo -n "Running $TEST: " gs -dNOPAUSE -dSAFER -dQUIET -dBATCH -sDEVICE=nullpage build/monolithic/barcode_with_sample.ps if [ $? -eq 0 ]; then echo "PASS" exit 0 else echo "FAIL" exit 1 fi postscriptbarcode-2014-03-12/tests/test_monolithic_package/000077500000000000000000000000001231007474100236545ustar00rootroot00000000000000postscriptbarcode-2014-03-12/tests/test_monolithic_package/run000077500000000000000000000003611231007474100244060ustar00rootroot00000000000000#!/bin/bash TEST=$(dirname $0) echo -n "Running $TEST: " gs -dNOPAUSE -dSAFER -dQUIET -dBATCH -sDEVICE=nullpage build/monolithic_package/barcode_with_sample.ps if [ $? -eq 0 ]; then echo "PASS" exit 0 else echo "FAIL" exit 1 fi postscriptbarcode-2014-03-12/tests/test_packaged_resource/000077500000000000000000000000001231007474100235025ustar00rootroot00000000000000postscriptbarcode-2014-03-12/tests/test_packaged_resource/run000077500000000000000000000005001231007474100242270ustar00rootroot00000000000000#!/bin/bash TEST=$(dirname $0) echo -n "Running $TEST: " if gs --version | grep -q '^7\.'; then echo "SKIPPED GS too old" exit 0 fi cd build/packaged_resource/Resource && gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=nullpage -P ../sample.ps if [ $? -eq 0 ]; then echo "PASS" exit 0 else echo "FAIL" exit 1 fi postscriptbarcode-2014-03-12/tests/test_resource/000077500000000000000000000000001231007474100216635ustar00rootroot00000000000000postscriptbarcode-2014-03-12/tests/test_resource/run000077500000000000000000000004671231007474100224240ustar00rootroot00000000000000#!/bin/bash TEST=$(dirname $0) echo -n "Running $TEST: " if gs --version | grep -q '^7\.'; then echo "SKIPPED GS too old" exit 0 fi cd build/resource/Resource && gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=nullpage -P ../sample.ps if [ $? -eq 0 ]; then echo "PASS" exit 0 else echo "FAIL" exit 1 fi