CBD 2000 Software Reference Manual (CBDSMEN0033)
CBD 2000 Software Reference Manual (CBDSMEN0033)
Release: 3
SOFTWARE REFERENCE MANUAL page 1/21
CBD 2000
Chequebook Printer
Release: 3
Table of Contents
1 REQUIREMENTS..............................................................................................................4
6.2 Terminology..................................................................................................................16
1 Requirements
The CBD2000 is based on the CBD1000 HT and implements, instead of the previous printing
solution, 3 Inkjet printers. The paper transport speed in the printing area remains of 254mm / s.
The three printers are placed in between the pressure rollers of the current CBD1000 (to
facilitate the upgrade) and has been prepared to print the following heights:
The CBD2000 is based on the CBD1000 HT and implements, instead of the previous printing
solution, 3 Inkjet printers. The paper transport speed in the printing area remains of 254mm / s.
The three printers are placed in between the pressure rollers of the current CBD1000 (to
facilitate the upgrade) and has been prepared to print the following heights:
CBD 2000 Kit (upgraded from CBD1000 with special upgrading kit):
- Printer 1: covering an area of 1/2 inch in the upper part of the document
- Printer 2: covering an area of 1/2 inch in the upper part of the document, with the lowest
pixel aligned to the to highest pixel of Printer 1.
It means these 2 printheads together (fixed one to the other) can cover a total area of 1 inch, in
the upper part of the document. They can be used to print any text or logo in this area of 1 inch
height for the total length of the document.
The assembly of the 2 printheads has 13 mm of manual vertical adjustment, i.e. allowing to
cover 1” area from 47 up to 85 mm (13 + 25.4 mm).
Further the 2 printheads can print in the same area a QR code up to 1 inch size. Using them to
print a smaller QR code, i.e. a QR Code of 16.5 mm you can vary (just by software) the QR
code vertical position within the total area of 1 inch - I.e. in total 9 mm vertical adjustment
allowed inside the 1” area.
Further a new version CBD2000 – native, not upgradable from CBD1000 HT – has fully
manual adjustment of printing height:
- Printer 1 & 2: The assembly of the 2 printheads can be manually adjustable allowing to cover
1” area from 15 up to 85 mm.
- Printer 3: It is manually adjustable in height to print in a 1/2 inch area movable from 5 mm up
to 85 mm.
CBDSMEN0033 March 05, 2018
Release: 3
SOFTWARE REFERENCE MANUAL page 5/21
The Commands A, B, C, D, for the documents production, on CBD2000 have just 2 fields:
<String1> and <Codeline>
The fields <String2> and <String3> related to the printers 2 and 3 are no more present.
For testing purpose new commands FA, FB, FC, FD have been introduced:
They allow to feed one of the 4 kinds of documents (with or without MICR encoding)
without any data for the printers:
A new command “XJC” has been instead introduced to handle the Ink-Jet print-heads cleaning
(spitting cycle). It is suggested to command a spitting cycle after 4 hours the machine is on
stand by without any printing.
Two new offset parameters have been introduced to allow an alignment correction between the
first 2 printers (for combined use). The 2 related commands are:
XOO for horizontal adjustment
XOV for vertical adjustment (Not active – reserved for future implementations)
Default value is “7” for both [range: from 1 to 15].
For XOO: increment of one unit moves the printing of 2nd printer (upper one) to the left of
1/300” (= 0.85 mm)
The present setting can be checked, as for CBD1000, with order @M, as for following example:
@M
XOH0 XOM0 XOL0 XOS0 XOB0 XOF0 XOT0 XOR10 XOC5 XOO7 XOV7
A new Option setting <Option “Z”> has been introduced to take in account the different
position of the 3rd printer in different machine versions:
OZN -> distance between 1st and 3rd printer = 93,15 mm (CBD2000 Upgrading Kit)
OZY -> distance between 1st and 3rd printer = 99,35 mm (new CBD2000 - native)
By default, this option is disabled (OZN)
The present "Options" setting can be checked with order @F, as for following example:
@F
OAY OBN OCN ODN OGN OIY OLN OMN OPN OQY ORY OUY OVN OXN OZN
CBDSMEN0033 March 05, 2018
Release: 3
SOFTWARE REFERENCE MANUAL page 7/21
PREFIX PAYLOAD
BV Variable bitmap
BC barcode
BD bold
RB RBD Descriptor
RBD file is the booklet page template that can be generated with Rotodraw software -
Please refer to CJD 3000 service manual for an overview on Rotodraw and its usage.
The RBD file is always needed and up to 3 variable bitmaps per booklet can be added..
The TJP.DLL automatically transform RBD file as generated by Rotodraw into Base64 format,
see chapter 4 (function EndInit takes RBD file in input and performs this action)
RYB file is a proprietary image format, the support library TJP.DLL automatically creates
this format, see chapter 4 :
- function LoadInitBitmap, followed by function EndInit, takes a bitmap as an input and
generates RYB file already encoded in Base64 format (to send by using command “I”)
– function LoadDocumentBarcode, followed by EndDocument, takes a barcode text and
parameters, and generates the barcode as a bitmap in RYB format already encoded in Base64
format (to send inside command “A”)
BLD file contains the page variable text; TJP.DLL supports generating this format, see
chapter 4 (function LoadDocumentField, repeatedly called for each variable text field in the
page, followed by EndDocument function generates the BLD file already encoded in Base64.
BLD file is always needed even if no variable fields are filled in, one optional barcode image
can be added.
The encoding of the data in BASE64 and the addition of the terminator (ASCII 2EH) is handled
by the tjp.dll library.
CBDSMEN0033 March 05, 2018
Release: 3
SOFTWARE REFERENCE MANUAL page 8/21
The RBD file and the variable bitmaps can be sent before the commands for documents
production (commands A, B, C, D) by the command “I” that on CBD1000 sends a string to the
first printer.
The RYB file for barcode and the BLD file can be sent by the current commands (CBD1000)
for documents production (of course without the strings for printers 2 and 3):
Inside the DDO, the decoding of the command, and the data transmission to the printer is
possible when a frame of data is available. Frames are prepared by the command interpreter
starting from the command A, B, C, D. When resources permit, a frame is associated with a
thread of execution and production of the document can begin.
Warning: BLD file must always be the first command in the string!
The type of document, together with the association of the marks, the thresholds for the
thickness control, and the feeder from which the document is taken, is determined by the
CBD1000 command A, B, C or D.
The document that will be printed by the printer is instead the one contained in the BOLD file
(BLD), which may reflect one of the four types encoded by the CBD1000.
CBDSMEN0033 March 05, 2018
Release: 3
SOFTWARE REFERENCE MANUAL page 9/21
Initialization:
the initialization to define the type of barcode that may be used is made by the
method SetBarcode().
The CBD2000 needs to know the size of the documents to process (see commands “L” and
“H”), but also in the RBD file is present the size of the document and the two settings must be
in agreement.
For this purpose it has been added the method
GetDimensions() which extracts size of the document from the RBD file.
The data string to initialize the printer is obtained by the following sequence of methods:
1. StartInit()
2. LoadInitBitmap()
3. EndInit()
The function “LoadInitBitmap()” may be absent, or repeated up to three times, to define zero or
more variable bitmaps.
The Id of the bitmap will always be different and correspond to a volatile bitmap file defined in
the RBD file.
The function “EndInit” requires the RBD file and returns the requested data string to send with
command “I”.
Similarly for the commands that control of the documents production “A”, “B”, “C”, “D”:
The string must be inserted in place of the data to the printer, for example:
“A <string> | <codeline> |”
The string for the printer is obtained by the following sequence of methods:
1. StartDocument()
2. LoadDocumentField()
3. LoadDocumentBarcode()
4. EndDocument()
The function “LoadDocumentField()” must be repeated for each variable field to be defined,
i.e. that has been defined in the RBD file to which the BOLD refers.
The function “LoadDocumentBarcode()”, instead, can be present only once and must
correspond to a variable bitmap field that must always be present in the RBD file.
CBDSMEN0033 March 05, 2018
Release: 3
SOFTWARE REFERENCE MANUAL page 10/21
SetBarcode
This method defines the bar-code encoder behaviour.
HRESULT WINAPI SetBarcode(
BYTE *barcodedef
);
Parameters
barcodedef The length of this array is depending on the encoder type.
Barcodedef[0] Selects the encoder type, It must be 1 (QR encoder).
Barcodedef[1] Set the correction level. Range from 0 to 3. (zero is the lowest).
Barcodedef[2] Set the QR code version. Range from 1 to 15 (zero is the
smaller).
Barcodedef[3] Set the encode mode. It must be 2 (8 bit data).
Return value
If the function succeeds, the return value is zero.
If the function fails, the return value is the error code.
StartInit
This method starts the printer initialization string creation. It clears all the loaded bitmaps.
HRESULT WINAPI StartInit(void);
Parameters
none
Return value
Zero
LoadInitBitmap
Parameters
LpBmpFilename The file name of the windows bitmap file. The string is Null-terminated.
uId Id of the volatile bitmap. Range from 1 to 4 for a maximum of 3 bitmaps.
Return value
If the function succeeds, the return value is zero.
If the function fails, the return value is the error code.
CBDSMEN0033 March 05, 2018
Release: 3
SOFTWARE REFERENCE MANUAL page 11/21
EndInit
TThis method returns the printer initialization string.
HRESULT WINAPI EndInit(
LPWSTR lpRbdFilename,
LPSTR lpBuffer,
UINT uSize
);
Parameters
LpRbdFilename The file name of the RBD file. The string is Null-terminated.
lpBuffer A pointer to the buffer to receive the printer init string.
uSize The maximum size of the buffer in TCHARs. The buffer length must include
room for a terminating null character.
Return value
If the function succeeds, the return value is zero.
If the function fails, the return value is the error code.
StartDocument
This method starts the document printer string creation. It clears the loaded bar-code.
HRESULT WINAPI StartDocument(void);
Parameters
none
Return value
Zero
LoadDocumentField
This method loads a variable field in the printer data.
HRESULT WINAPI LoadDocumentField(
LPWSTR lpField,
UINT uId
);
Parameters
LpField The value of the field. The string is Null-terminated.
uId Id of the field as numbered in the RBD file (Range 1 - 8)
Return value
If the function succeeds, the return value is zero.
If the function fails, the return value is the error code.
CBDSMEN0033 March 05, 2018
Release: 3
SOFTWARE REFERENCE MANUAL page 12/21
LoadDocumentBarcode
Load a barcode in the printer data.
HRESULT WINAPI LoadDocumentBarcode(
LPWSTR lpBarcodeData,
UINT uId,
UINT uZoom
);
Parameters
lpBarcodeData Data for the barcode. The length and the allowed character are encoder
dependent.
uId Id of the volatile bitmap. Range from 1 to 4, only one barcode is allowed.
uZoom The zoom factor for the bar-code. Range from 3 to 5.
Return value
If the function succeeds, the return value is zero.
If the function fails, the return value is the error code.
Please note: if the barcode does not fit the printing area will be entirely skipped.
EndDocument
This method generates the printer data.
HRESULT WINAPI EndDocument(
TCHAR wDocType,
LPSTR lpBuffer,
UINT uSize
);
Parameters
wDocType The type of the document:
“A” cheque
“B” last cover
“C” front cover
“D” order form (if different document are defined in the RBD file, use this
document anyway).
lpBuffer A pointer to the buffer to receive the printer string.
uSize The maximum size of the buffer in TCHARs. The buffer length must
include room for a terminating null character.
Return value
If the function succeeds, the return value is zero.
If the function fails, the return value is the error code.
CBDSMEN0033 March 05, 2018
Release: 3
SOFTWARE REFERENCE MANUAL page 13/21
GetDimensions
This method reads the cheque size embedded in RBD files.
HRESULT WINAPI GetDimensions(
LPWSTR lpRbdFilename,
LPDWORD lpWidth,
LPDWORD lpHeight
);
Parameters
lpRbdFilename The file name of the RBD file. The string is Null-terminated.
lpWidth A pointer to the buffer to receive the document width in tenth of a
millimeter.
lpHeight A pointer to the buffer to receive the document height in tenth of a
millimeter.
Return value
If the function succeeds, the return value is zero and the values pointed by lpWidth and
lpHeight are assigned.
If the function fails, the return value is the error code.
ErrorCodes
Error Mnemonic Description
Codes
0 TJP_SUCCESS The function succeeded.
(-1) TJP_ERROF_MEMORY Memory allocation failure.
(-2) TJP_ERR_INVALID_BUFFER The buffer pointer does not point to accessible memory or
the size of the buffer is invalid for the operation.
(-3) TJP_ERR_INVALID_VALUE A parameter value is out of range.
(-4) TJP_ERR_INTERNAL_ERROR An internal inconsistency occurred.
(-5) TJP_ERR_OPEN_FILE_ERROR An error was occurred while opening a file.
(-6) TJP_ERR_INVALID_BC_DEF The bar-code definition is invalid.
(-7) TJP_ERR_BC_CREATION An error was occurred while creating the required bitmap.
(-8) TJP_ERR_LOAD_BMP The bitmap cannot be imported.
(-9) TJP_ERR_SAVE_RYG The bitmap cannot be converted to the internal format.
(-10) TJP_ERR_FILE_SIZE A file cannot be processed due to the printer constraints.
(-11) TJP_ERR_ENC_LOAD BASE64 encoder failed while loading a file.
(-12) TJP_ERR_ENC_CONV BASE64 encoder failed.
(-13) TJP_ERR_ENC_SAVE BASE64 encoder failed while saving a file.
(-14) TJP_ERR_SIZE_BMP Bitmap size exceeded the printer constraints.
CBDSMEN0033 March 05, 2018
Release: 3
SOFTWARE REFERENCE MANUAL page 14/21
QR codes are a specific 2D barcodes that have the capability to store a large
amount of information in a small footprint size. This small paper walks you
through the most important topics for mastering the technology with the
highest proficiency for practical applications
6.1.1 Version
The version ranging from 1 to 40 determines the “size of the QR code” that is how
many “small squares” are present in the QR code. This small black or white
squares are called “modules”. The version by itself does not imply a specific
dimension because the module size itself is variable according to a zoom factor.
module
L Recovers 7% of data
6.2 Terminology
The following image reports some more terminology.
The following comparison of a 367 byte English text and a version 12, correction L, zoom 4 QR
code that contains it show how dense the information can be (489 bytes per square inch).
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Integer commodo augue libero, et
rutrum leo suscipit non. Cras fringilla nunc mi, et
sollicitudin lacus vestibulum eget. Ut volutpat id
leo in lobortis. Nulla egestas arcu non ante
vehicula, quis laoreet odio finibus. Proin ultrices
fermentum ipsum, sed convallis massa. Quisque
hendrerit nulla metus, ac amet.
From this paragraph it is evident that choosing the QR code format is a compromise between
the required density of information and the resiliency. A denser QR code is more difficult to
read and more sensitive to damage. If you need a very dense code you have to make sure that
the printing quality and the reading technology are both up to the expectations.
6.4.1 Paper
Paper for inkjet printing shall have a very controlled water absorption rate. If absorption rate is
too low, ink spreads on the surface and does not dry fast enough, if absorption rate is too high,
this is not a problem by itself but it becomes a problem if ink tends to spread inside the paper
fibers creating blurry images.
If letters or pictures are placed around a QR Code, the required margin cannot be secured.
This kind of code is difficult or impossible to read. The QR code shall always be printed on a
white or very light colored background and a free space around it shall be guaranteed. There is
no precise guideline of how wide the white space shall be and it depends on reader technology
but keeping a reasonable amount of white space around is absolutely a must.
CBDSMEN0033 March 05, 2018
Release: 3
SOFTWARE REFERENCE MANUAL page 19/21
If you place letters or pictures on an area overlapping a QR Code, the contrast between the
bright and dark areas becomes indistinct. This kind of code is difficult or impossible to read.
For CIS based scanners the relevant parameter is the resolution normally expressed in dots per
inch or dpi.
It is recommended a resolution of at least 300 dpi. Also it is required to print QR code with at
least zoom 5.
QR code with zoom 4 can be readable at 300 dpi but with some difficulties. In case of zoom 4 it
should be preferable a resolution at 600 dpi.
Finally, in case of scanner resolution of 200 dpi the QR code should be at least zoom 6.
The software is also very important for the performance. Rototype uses Zxing library for PC
based decoding as being the most effective at several tests but often a CIS based image requires
preprocessing to achieve best results. Preprocessing might include brightness and contrast
adaptations, blur, resize with different interpolation mechanisms depending on the
characteristics of the original image.
CBDSMEN0033 March 05, 2018
Release: 3
SOFTWARE REFERENCE MANUAL page 21/21
This one below is a 300 dpi scanned QR code printed by CBD with zoom 4.
The one below is the same QR code scanned at 150 dpi; the visual quality is unacceptable. This
specific code is readable but the dependability is not acceptable. The same can be stated for 200
dpi which is even worse because it is not an integer submultiple of the 300 dpi resolution used
at printing time.