Returns actual horizontal width and vertical height of a rotated barcode symbol in millimeters. The barcode symbol is specified by the properties of this barcode component.
function PrintSize(var Width, Height, SymbolWidth, SymbolHeight: Double; Module: Double; Angle: Integer = -1; BarcodeWidth: Double = 0; BarcodeHeight: Double = 0; HDPI: Integer = 0; VDPI: Integer = 0): Integer; overload; virtual;
The method returns the actual horizontal width and vertical height of a rotated barcode symbol that is specified by properties of this barcode component, in millimeters.
For the 2D component TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC. If its Linear property is set to the TBarcode1D_UPCE, TBarcode1D_UPCE0, TBarcode1D_UPCE1, TBarcode1D_UPCA, TBarcode1D_ENA8, TBarcode1D_EAN13, or TBarcode1D_EAN128, and the linear component's DisplayText property isn't set to dtNone, Please use the method between the Printer.BeginDoc and Printer.EndDoc methods.
Width: Double; Returns the horizontal width of the rotated barcode symbol in millimeters. The value is calculated based on the module size. You can use one of the Module, BarcodeWidth and BarcodeHeight parameters to specify the module size.
If the quiet zones are represented (please read the ShowQuietZone property about whether or not the quiet zones will be represented), they are included in the barcode symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
For the TBarcode2D_Code16K barcode components, the leading quiet zone and the trailing quiet zone are included always, even if the ShowQuietZone property is set to false. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
For the 2D component TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC, if its Linear property is set, the 2D symbol and the linear symbol are assembled to generate an EAN.UCC composite barcode symbol, the linear symbol is included in the composite barcode symbol, and the parameter returns the width of entire EAN.UCC composite barcode symbol, not the width of the 2D symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
When the linear component of TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC component is TBarcode1D_UPCA, TBarcode1D_UPCE, TBarcode1D_UPCE0, TBarcode1D_UPCE1, TBarcode1D_EAN8, TBarcode1D_EAN13, or TBarcode1D_EAN128, and its human readable text is represented. The human readable text and the vertical spacing between the text and linear symbol are included in the symbol. If the TextAlignment property isn't set to taCustom, and the human readable text exceeds entire EAN.UCC composite barcode symbol in horizontal direction, the excess is included in the symbol. If the TextAlignment property is set to taCustom, the width of quiet zone marks and their horizontal spacing (LeftQuietZoneSpacing and RightQuietZoneSpacing) are included too (if they are represented, this does not apply to TBarcode1D_EAN128). If the human readable text exceeds the linear barcode symbol in vertical direction, the excess is included too. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
Height: Double; Returns the vertical height of the rotated barcode symbol in millimeters. The value is calculated based on the module size. You can use one of the Module, BarcodeWidth and BarcodeHeight parameters to specify the module size.
If the quiet zones are represented (please read the ShowQuietZone property about whether or not the quiet zones will be represented), they are included in the barcode symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
For the TBarcode2D_Code16K barcode components, the leading quiet zone and the trailing quiet zone are included always, even if the ShowQuietZone property is set to false. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
For the 2D component TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC, if its Linear property is set, the 2D symbol and the linear symbol are assembled to generate an EAN.UCC composite barcode symbol, the linear symbol is included in the composite barcode symbol, and the parameter returns the height of entire EAN.UCC composite barcode symbol, not the height of the 2D symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
When the linear component of TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC component is TBarcode1D_UPCA, TBarcode1D_UPCE, TBarcode1D_UPCE0, TBarcode1D_UPCE1, TBarcode1D_EAN8, TBarcode1D_EAN13, or TBarcode1D_EAN128, and its human readable text is represented. The human readable text and the vertical spacing between the text and linear symbol are included in the symbol. If the TextAlignment property isn't set to taCustom, and the human readable text exceeds entire EAN.UCC composite barcode symbol in horizontal direction, the excess is included in the symbol. If the TextAlignment property is set to taCustom, the width of quiet zone marks and their horizontal spacing (LeftQuietZoneSpacing and RightQuietZoneSpacing) are included too (if they are represented, this does not apply to TBarcode1D_EAN128). If the human readable text exceeds the linear barcode symbol in vertical direction, the excess is included too. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
SymbolWidth: Double; Returns the distance between the leading and trailing of the rotated barcode symbol in millimeter. The value is calculated based on the module size. You can use one of the Module, BarcodeWidth and BarcodeHeight parameters to specify the module size.
If the quiet zones are represented (please read the ShowQuietZone property about whether or not the quiet zones will be represented), they are included in the barcode symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
For the TBarcode2D_Code16K barcode components, the leading quiet zone and the trailing quiet zone are included always, even if the ShowQuietZone property is set to false. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
For the 2D component TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC, if its Linear property is set, the 2D symbol and the linear symbol are assembled to generate an EAN.UCC composite barcode symbol, the linear symbol is included in the composite barcode symbol, and the parameter returns the width of entire rotated EAN.UCC composite barcode symbol, not the width of the 2D symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
When the linear component of TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC component is TBarcode1D_UPCA, TBarcode1D_UPCE, TBarcode1D_UPCE0, TBarcode1D_UPCE1, TBarcode1D_EAN8, TBarcode1D_EAN13, or TBarcode1D_EAN128, and its human readable text is represented. If the TextAlignment property isn't set to taCustom, and the human readable text exceeds entire EAN.UCC composite barcode symbol in horizontal direction, the excess is included in the symbol. If the TextAlignment property is set to taCustom, the width of quiet zone marks and their horizontal spacing (LeftQuietZoneSpacing and RightQuietZoneSpacing) are included too (if they are represented, this does not apply to TBarcode1D_EAN128). See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
See also the "BarcodeWidth" property.
SymbolHeight: Double; Returns the distance between the top and bottom of the rotated barcode symbol in millimeter. The value is calculated based on the module size. You can use one of the Module, BarcodeWidth and BarcodeHeight parameters to specify the module size.
If the quiet zones are represented (please read the ShowQuietZone property about whether or not the quiet zones will be represented), they are included in the barcode symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
For the 2D component TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC, if its Linear property is set, the 2D symbol and the linear symbol are assembled to generate an EAN.UCC composite barcode symbol, the linear symbol is included in the composite barcode symbol, and the parameter returns the height of entire rotated EAN.UCC composite barcode symbol, not the height of the 2D symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
When the linear component of TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC component is TBarcode1D_UPCA, TBarcode1D_UPCE, TBarcode1D_UPCE0, TBarcode1D_UPCE1, TBarcode1D_EAN8, TBarcode1D_EAN13, or TBarcode1D_EAN128, and its human readable text is represented, the human readable text and the vertical spacing between the text and linear symbol are included in the symbol. If the human readable text exceeds the linear barcode symbol in vertical direction, the excess is included too. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
See also the "BarcodeHeight" property.
Module: Double; Specifies the module size in millimeters.
For the Matrix 2D barcode symbology (excluding the TBarcode2D_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 TBarcode2D_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:
For the 2D component TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC, if its Linear property is set, the 2D symbol and the linear symbol are assembled to generate an EAN.UCC composite barcode symbol, the parameter specifies the module width for entire EAN.UCC composite barcode symbol (including both 2D and linear symbols). See diagram:
If any one of the BarcodeWidth parameter and BarcodeHeight parameter 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: Integer; Specifies an angle in degrees to rotate the barcode symbol and its quiet zones (if they are represented, please read the ShowQuietZone property about whether or not the quiet zones will be represented) anticlockwise. You can use the LeadingQuietZone, TrailingQuietZone, TopQuietZone, and BottomQuietZone properties to specify the size of these quiet zones in modules. And use the ShowQuietZone property to specify whether to represent these quiet zones. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
For the 2D component TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC, if its Linear property is set, the 2D symbol and the linear symbol are assembled to generate an EAN.UCC composite barcode symbol, and they will be rotated as an entirety. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
The parameter defaults to -1 if the Angle is not provided, and the barcode symbol will be rotated based on the value of the Orientation property:
If you want to use the -1 degrees, the 359 degrees can be used instead.
BarcodeWidth: Double, Specifies the barcode symbol width (the distance between the beginning and end of the barcode symbol), in millimeters. If the quiet zones are represented (please read the ShowQuietZone property about whether or not the quiet zones will be represented), the leading quiet zone and the trailing quiet zone are included in the barcode symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
For the TBarcode2D_Code16K barcode component, the leading quiet zone and the trailing quiet zone are included always, even if the ShowQuietZone property is set to false. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
For the 2D component TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC, if its Linear property is set, the 2D symbol and the linear symbol are assembled to generate an EAN.UCC composite barcode symbol, the linear symbol is included in the composite barcode symbol, and the parameter specifies the width for entire EAN.UCC composite barcode symbol not only for the 2D symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
When the linear component of TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC component is TBarcode1D_UPCA, TBarcode1D_UPCE, TBarcode1D_UPCE0, TBarcode1D_UPCE1, TBarcode1D_EAN8, TBarcode1D_EAN13, or TBarcode1D_EAN128, and its human readable text is represented. If the TextAlignment property isn't set to taCustom, and the human readable text exceeds entire EAN.UCC composite barcode symbol in horizontal direction, the excess isn't included in the width value. If the TextAlignment property is set to taCustom, the width of quiet zone marks and their horizontal spacing (LeftQuietZoneSpacing and RightQuietZoneSpacing) are included (if they are represented, this does not apply to TBarcode1D_EAN128). See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
Note, if the parameter is provided and it isn't zero, the values in Module and BarcodeHeight parameters will be ignored, the module size will be calculated based on the BarcodeWidth 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: Double, Specifies the barcode symbol height (the distance between the top and bottom of the barcode symbol), in millimeters. If the quiet zones are represented (please read the ShowQuietZone property about whether or not the quiet zones will be represented), the top quiet zone and the bottom quiet zone are included in the barcode symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
For the 2D component TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC, if its Linear property is set, the 2D symbol and the linear symbol are assembled to generate an EAN.UCC composite barcode symbol, the linear symbol is included in the composite barcode symbol, and the parameter specifies the height for entire EAN.UCC composite barcode symbol not only for the 2D symbol. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
When the linear component of TBarcode2D_CCA, TBarcode2D_CCB, or TBarcode2D_CCC component is TBarcode1D_UPCA, TBarcode1D_UPCE, TBarcode1D_UPCE0, TBarcode1D_UPCE1, TBarcode1D_EAN8, TBarcode1D_EAN13, or TBarcode1D_EAN128, and its human readable text is represented. the human readable text and the vertical spacing between the text and linear symbol are included in the height value. See diagram (the quiet zones are drawn in clSilver color in order to accentuate them):
Note, if the parameter is provided and it isn't zero, and the BarcodeWidth parameter isn't provided or it's zero, the value in Module parameter will be ignored, the module size will be calculated based on the BarcodeHeight 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.
HDPI: Integer, Specifies the horizontal resolution of printer in DPI (dots per inch).
It defaults to 0 if the HDPI is not provided, and the horizontal resolution will be obtained from your printer.
VDPI: Integer, Specifies the vertical resolution of printer in DPI (dots per inch).
It defaults to 0 if the VDPI is not provided, and the vertical resolution will be obtained from your printer.
If the method succeeds, the return value is zero.
If the length of barcode text specified by the Barcode or Data (only for Delphi/C++ Builder 2009 or later) property is invalid, the return valus is -1 or -65537. Corresponding to the OnInvalidLength or OnInvalidDataLength (only for Delphi/C++ Builder 2009 or later) event will occur.
For the TBarcode2D_CCA, TBarcode2D_CCB, and TBarcode2D_CCC barcode components, if the Linear property is set, the 2D symbol and the linear symbol are assembled to generate an EAN.UCC composite barcode symbol. If the length of barcode text of the 2D symbol is invalid, the return valus is -1. If the length of barcode text of the linear symbol is invalid, the return valus is -65537.
For other barcode components, if the length of barcode text is invalid, the return valus is -1.
If there is any invalid character in the the barcode text specified by the Barcode or Data (only for Delphi/C++ Builder 2009 or later) property, the return value is greater than zero. In general, it's the position index of first invalid character, the index 1 denotes that the first character is invalid character. Corresponding to the OnInvalidChar or OnInvalidDataChar (only for Delphi/C++ Builder 2009 or later) event will occur.
For the TBarcode2D_CCA, TBarcode2D_CCB, and TBarcode2D_CCC barcode components, if the Linear property is set, the 2D symbol and the linear symbol are assembled to generate an EAN.UCC composite barcode symbol. If the invalid character is in the 2D symbol, the 17th bit of the return value is set to 0 (the return value is the position index of first invalid character, the index 1 denotes that the first character is invalid character). If the invalid character is in the linear symbol, the 17th bit of the return value is set to 1 (the difference between the return value and 65536 is the position index of first invalid character. For example, the return value 65537 denotes that the first character is invalid character).
For other barcode components, if there is any invalid character in the the barcode text, the return value is the position index of first invalid character, the index 1 denotes that the first character is invalid character.