Prints a barcode symbol to printer. The barcode symbol is specified by the parameters of this method. Please use the method between the Printer.BeginDoc and Printer.EndDoc methods.
function Print(Data: TBytes; BarColor, SpaceColor: TAlphaColor; ShowQuietZone: Boolean; Left, Top, Module: Single; Angle: Single = 0; Opacity: Single = 1; BarcodeWidth: Single = 0; BarcodeHeight: Single = 0): Integer; overload; virtual;
Prints a barcode symbol that is specified by the parameters of this method to the printer.
Data: TBytes; Specifies the barcode text. It is of type TBytes (it is in fact a byte array).
You can specify a block of binary (bytes) data to the parameter, in order to encode it into a barcode symbol.
For the TBarcodeFmx2D_RSS14 and TBarcodeFmx2D_RSSLimited components, if the property AutoCheckDigit is set to true, the check digit doesn't need to be included in the parameter, otherwise the check digit can be specified by you in the parameter.
BarColor: TAlphaColor; In general, the Inversed property is set to false. In this case, the parameters specifies the color for all bars (Stacked 2D barcode symbology and Linear 1D barcode symbology) or dark modules (Matrix 2D barcode symbology) in the barcode symbol.
If the Inversed property is set to true, it specifies the color for all spaces (Stacked 2D barcode symbology and Linear 1D barcode symbology) or light modules (Matrix 2D barcode symbology) in the barcode symbol. Also, if the ShowQuietZone parameter value is set to true, the leading quiet zone, trailing quiet zone, top quiet zone, and bottom quiet zone are printed using the color.
The alpha channel of the BarColor parameter is supported.
See also the "BarColor" property.
SpaceColor: TAlphaColor; In general, the Inversed property is set to false. In this case, the parameters specifies the color for all spaces (Stacked 2D barcode symbology and Linear 1D barcode symbology) or light modules (Matrix 2D barcode symbology) in the barcode symbol. Also, if the ShowQuietZone parameter value is set to true, the leading quiet zone, trailing quiet zone, top quiet zone, and bottom quiet zone are printed using the color.
If the Inversed property is set to true, it specifies the color for all bars (Stacked 2D barcode symbology and Linear 1D barcode symbology) or dark modules (Matrix 2D barcode symbology) in the barcode symbol.
The alpha channel of the SpaceColor parameter is supported.
See also the "SpaceColor" property.
ShowQuietZone: Boolean; Specifies whether to print the leading quiet zone, trailing quiet zone, top quiet zone, and bottom quiet zone in the barcode symbol. If the parameter value is set to true, these quiet zones are printed. Otherwise, they don't be printed. You can use the LeadingQuietZone, TrailingQuietZone, TopQuietZone, and BottomQuietZone properties to specify the size of these quiet zones in modules. See diagram (the SpaceColor parameter is set to claSilver in order to accentuate the quiet zones):
For the TBarcodeFmx2D_Code16K barcode component, leading quiet zone and trailing quiet zone will be printed always, even if the ShowQuietZone parameter value is set to false. See diagram (the SpaceColor parameter is set to claSilver in order to accentuate the quiet zones):
In general, the Inversed property is set to false. In this case, these quiet zones are printed using the color specified by SpaceColor parameter. If the Inversed property is set to true, these quiet zones are printed using the color specified by BarColor parameter.
See also the "ShowQuietZone" property.
Left: Single; Specifies the margin between the rotated barcode symbol and the left side of the paper in millimeters in the horizontal direction. If the quiet zones are printed (please read the ShowQuietZone parameter about whether or not the quiet zones will be printed), they are included in the barcode symbol. See diagram (the SpaceColor parameter is set to claSilver in order to accentuate the quiet zones):
For the TBarcodeFmx2D_Code16K barcode component, the leading quiet zone and the trailing quiet zone are included always, even if the ShowQuietZone parameter is set to false. See diagram (the SpaceColor parameter is set to claSilver in order to accentuate the quiet zones):
See also the "LeftMargin" property.
Top: Single; Specifies the margin between the rotated barcode symbol and the top side of the paper in millimeters in the vertical direction. If the quiet zones are printed (please read the ShowQuietZone parameter about whether or not the quiet zones will be printed), they are included in the barcode symbol. See diagram (the SpaceColor parameter is set to claSilver in order to accentuate the quiet zones):
For the TBarcodeFmx2D_Code16K barcode component, the leading quiet zone and the trailing quiet zone are included always, even if the ShowQuietZone parameter is set to false. See diagram (the SpaceColor parameter is set to claSilver in order to accentuate the quiet zones):
See also the "TopMargin" property.
Module: Single; Specifies the module size in millimeters.
For the Matrix 2D barcode symbology (excluding the TBarcodeFmx2D_MaxiCode barcode symbology), the module is single cell (a suqare shape) used to encode one bit data. The parameter specifies the module width and height. See diagram:
For the TBarcodeFmx2D_MaxiCode barcode symbology, the module is single cell (a regular hexagonal shape) used to encode one bit data. The parameter specifies the horizonal width of a module. Also, it's the center to center horizontal distance between adjacent modules. See diagram:
For the Stacked 2D barcode symbology and Linear 1D barcode symbology, the module is the thinest bar (or space) in the barcode symbol. The parameter specifies the module width. See diagram:
If any one of the BarcodeWidth and BarcodeHeight parameters is provided and it isn't zero, the value of Module parameter will be ignored, the module size will be calculated based on the BarcodeWidth parameter value or the BarcodeHeight parmeter value. If both BarcodeWidth and BarcodeHeight parameters are provided and aren't zero, only the BarcodeWidth parameter value will be used to calculate the module size, the BarcodeHeight parameter value will be ignored.
See also the "Module" property.
Angle: Single; Specifies an angle in degrees to rotate the barcode symbol and its quiet zones (if they are printed, please read the ShowQuietZone parameter section above about whether or not the quiet zones will be printed) anticlockwise. It defaults to 0 if the parameter is not provided, meaning left to right horizontal direction. See diagram (the SpaceColor parameter value is set to claSilver in order to accentuate the quiet zones):
Opacity: Single, Specifies the transparency-level of entire barcode symbol, where 1 is not transparant at all, 0.5 is 50% see-through, and 0 is completely transparent.
The parameter defaults to 1 if it is not provided, meaning not transparant at all.
Note, if the Inversed property is set to false, you can use the alpha channel of the SpaceColor parameter value to specify the transparency-level of bakcground color (spaces or light modules, and quiet zones), and use the alpha channel of the BarColor parameter value to specify the transparency-level of foreground color (bars or dark modules). If the Inversed property is set to true, you can use the alpha channel of the BarColor parameter value to specify the transparency-level of bakcground color (spaces or light modules, and quiet zones), and use the alpha channel of the SpaceColor parameter value to specify the transparency-level of fore-ground color (bars or dark modules).
BarcodeWidth: Single, Specifies the barcode symbol width (the distance between the beginning and end of the barcode symbol), in millimeters. If the quiet zones are printed (please read the ShowQuietZone parameter section above about whether or not the quiet zones will be printed), the leading quiet zone and the trailing quiet zone are included in the barcode symbol. See diagram (the SpaceColor parameter is set to claSilver in order to accentuate the quiet zones):
For the TBarcodeFmx2D_Code16K barcode component, the leading quiet zone and the trailing quiet zone are included always, even if the ShowQuietZone parameter is set to false. See diagram (the SpaceColor parameter is set to claSilver in order to accentuate the quiet zones):
Note, if the parameter is provided and it isn't zero, the values of Module and BarcodeHeight parameters will be ignored, the module size will be calculated based on the BarcodeWidth parameter value. If both BarcodeHeight and BarcodeWidth parameters aren't provided or they are all zero, the barcode symbol width will be determined by the Module parameter value.
If both BarcodeWidth and BarcodeHeight parameters are provided and aren't zero, only the BarcodeWidth parameter value will be used to calculate the module size, the BarcodeHeight parameter value will be ignored.
See also the "BarcodeWidth" property.
BarcodeHeight: Single, Specifies the barcode symbol height (the distance between the top and bottom of the barcode symbol), in millimeters. If the quiet zones are printed (please read the ShowQuietZone parameter section above about whether or not the quiet zones will be printed), the top quiet zone and the bottom quiet zone are included in the barcode symbol. See diagram (the SpaceColor parameter is set to claSilver in order to accentuate the quiet zones):
Note, if the parameter is provided and it isn't zero, and the BarcodeWidth parameter isn't provided or it's zero, the value of Module parameter will be ignored, the module size will be calculated based on the BarcodeHeight parameter value. If both BarcodeHeight and BarcodeWidth parameters aren't provided or they are all zero, the barcode symbol height will be determined by the Module parameter value.
If both BarcodeWidth and BarcodeHeight parameters are provided and aren't zero, only the BarcodeWidth parameter value will be used to calculate the module size, the BarcodeHeight parameter value will be ignored.
See also the "BarcodeHeight" property.
This method can return one of these values (these consts are defined in the pfmxCore2D unit):
Verify_InvalidLength (-2):
It indicates that the length of Data parameter value is invalid.
Verify_OK (-1):
It indicates the method succeeds.
Verify_InvalidIndex_Base (0), and greater than 0:
It indicates that an invalid byte value is in the Data parameter, the return value is the position index of the invalid byte value. The index 0 denotes that the first byte value is invalid.
Pelase use the method between Printer.BeginDoc and Printer.EndDoc methods. For example:
Printer.ActivePrinter.SelectDPI(600, 600);
Printer.BeginDoc;
... { Print other content }
Barcode_QRCode1.Print(...); { Print the barcode symbol }
... { Print other content }
Printer.EndDoc;