#include "LabelMakerSDK.h"#include <iostream>#include <string>#include <sstream>#include <iomanip>#include "Label_tspl.h"#include "Shapes_tspl.h"#include "Text_tspl.h"#include "Barcode1D_tspl.h"#include "BcdAztec_tspl.h"#include "BcdDatamatrix_tspl.h"#include "BcdMaxicode_tspl.h"#include "BcdPdf417_tspl.h"#include "BcdQRCode_tspl.h"#include "cRfidWrite_tspl.h"#include "Coordinate.h"
定義 | |
| #define | TSPL 0 |
| #define | PGL 1 |
| #define | UINT32 unsigned int |
| #define | NON_USED -1 |
型態定義 | |
| typedef Label_tspl | LabelType |
| typedef Text_tspl | TextType |
| typedef MaxicodeBarcode_tspl | MexiCodeBarcodeType |
| typedef Pdf417Barcode_tspl | Pdf417BarcodeType |
| typedef DataMatrixBarcode_tspl | DataMatrixBarcodeType |
| typedef AztecBarcode_tspl | AztecBarcodeType |
| typedef QRBarcode_tspl | QRBarcodeType |
| typedef cRfidWrite_tspl | RfidWriteType |
| typedef Line_tspl | LineType |
| typedef Box_tspl | BoxType |
| typedef Barcode1D_tspl | Barcode1DType |
列舉型態 | |
| enum | { _MaxicodeMsgStructured = 0 , _MaxicodeMsgStructuredOpenSystemStandard , _MaxicodeMsg } |
函式 | |
| void | CreateLabel (int iPrintLanguageTyp, std::string LabelName, float dotsPerUnit, ScaleEnum unit) |
| 建立標籤。 | |
| void * | CreateTexts (float x_start, float y_start, float fontsize_x, float fontsize_y, std::string data, ScaleEnum scale, FontSizeUnitsEnum FontSizeUnit, FontStyleEnum FontStyle, AlignEnum Alignment, std::string fontName, RotateEnum rotation) |
| 建立文字標籤。 | |
| void * | CreateBarcode1D (float start_x, float start_y, std::string content, ScaleEnum scale, float narrowBar, float wideBar, float Height, BarcodeTypeEnum_1D BcdTyp, bool PrintHumanReadable, RotateEnum rotation, bool PdfLocTop) |
| 在標籤中創建一維條碼。 | |
| void * | CreateLines (float start_x, float start_y, float end_x, float end_y, float lineThickness, ScaleEnum scale) |
| 在標籤中創建線條 | |
| void * | CreateBoxs (float start_x, float start_y, float end_x, float end_y, float lineThickness, ScaleEnum scale) |
| 在標籤中創建框 | |
| void * | CreateMaxicodeBarcodes (int iMaxicodeTyp, MaxicodeModeEnum mode, std::string postalCode, std::string countryCode, std::string serviceClass, std::string remainingMsg, std::string year, std::string primaryMsg, float start_x, float start_y, ScaleEnum scale, bool ZipperPattern, RotateEnum rotation) |
| 在標籤中創建 Maxicode 條碼。 | |
| void * | CreatePdf417Bcodes (float start_x, float start_y, std::string content, ScaleEnum scale, float xdim, float ydim, Pdf417ErrCorrectionEnum ErrorCorrection, int row, int col, RotateEnum rotation) |
| 在標籤中創建 PDF417 條碼。 | |
| void * | CreateAztecBarcodes (float start_x, float start_y, std::string content, ScaleEnum scale, float xdim, AztecCodeTypeEnum CodeType, int iFixedErrCorrection, int iLayers, RotateEnum rotation) |
| 在標籤中創建 aztec 條碼。 | |
| void * | CreateDataMatrixBarcodes (float start_x, float start_y, std::string content, ScaleEnum scale, float xdim, RotateEnum Rotation, bool UseRectangle, std::string MatrixMultiLine, char CtrlChar1, char CtrlChar2, int row, int col) |
| 在標籤中創建 data matrix 條碼。 | |
| void * | CreateQRBarcodes (float start_x, float start_y, std::string content, ScaleEnum scale, float xdim, QRCodeMaskEnum Mask, std::vector< std::tuple< QRCodeManualEncodingEnum, std::string > > *dataManuallyEncoded, QRCodeErrorCorrectionEnum errEnum, QRCodeModelEnum modelEnum, RotateEnum rotation) |
| 在標籤中創建 QR 條碼。 | |
| void * | CreateRfidEncode (unsigned int a32BitField, unsigned int a16BitField, std::string a6CharAsciiString, RfidMemBlockEnum MemBlock, int iOffsetFromStart, std::string _10BytesUserData, std::string _4BytesHexUserData, RfidPasswordTypeEnum PasswordEnum, std::string Password) |
| 在標籤中創建 RFID。 | |
| void | LabelToString (std::string &str) |
| 使用 TSPL 或 PGL 創建標籤。 | |
| void | CloseLabel () |
| 釋放資源。 | |
| std::string | ToHexString (const std::string &input) |
變數 | |
| LabelType * | gpLabel = nullptr |
| TextType * | gpTextType = nullptr |
| MexiCodeBarcodeType * | gpMexiCodeBarcodeType = nullptr |
| Pdf417BarcodeType * | gpPdf417BarcodeType = nullptr |
| DataMatrixBarcodeType * | gpDataMatrixBarcodeType = nullptr |
| AztecBarcodeType * | gpAztecBarcodeType = nullptr |
| QRBarcodeType * | gpQRBarcodeType = nullptr |
| RfidWriteType * | gpRfidWriteType = nullptr |
| LineType * | gpLineType = nullptr |
| BoxType * | gpBoxType = nullptr |
| Barcode1DType * | gpBarcode1DType = nullptr |
| PrintResolution * | gpPrinterResolution = nullptr |
| Ruler * | gpRuler = nullptr |
| CellRect * | gpCellRect = nullptr |
| CellSquare * | gpCellSquare = nullptr |
| std::vector< void * > | ObjectsPtr |
| std::vector< void * > | ObjRulerPtr |
| std::vector< void * > | ObjStartPtr |
| std::vector< void * > | ObjEndPtr |
| std::vector< void * > | ObjCellSquarePtr |
| std::vector< void * > | ObjCellRectPtr |
| std::vector< void * > | ObjTextItemPtr |
| int | giPrintLanguageTyp = 0 |
| #define NON_USED -1 |
| #define PGL 1 |
| #define TSPL 0 |
| #define UINT32 unsigned int |
| typedef AztecBarcode_tspl AztecBarcodeType |
| typedef Barcode1D_tspl Barcode1DType |
| typedef Box_tspl BoxType |
| typedef DataMatrixBarcode_tspl DataMatrixBarcodeType |
| typedef Label_tspl LabelType |
| typedef Line_tspl LineType |
| typedef MaxicodeBarcode_tspl MexiCodeBarcodeType |
| typedef Pdf417Barcode_tspl Pdf417BarcodeType |
| typedef QRBarcode_tspl QRBarcodeType |
| typedef cRfidWrite_tspl RfidWriteType |
| typedef Text_tspl TextType |
| void CloseLabel | ( | ) |
| void * CreateAztecBarcodes | ( | float | start_x, |
| float | start_y, | ||
| std::string | content, | ||
| ScaleEnum | scale, | ||
| float | xdim, | ||
| AztecCodeTypeEnum | CodeType, | ||
| int | iFixedErrCorrection, | ||
| int | iLayers, | ||
| RotateEnum | rotation ) |
在標籤中創建 aztec 條碼。
| [in] | x_start | : x 座標的起始點 |
| [in] | y_start | : Y 座標的起始點 |
| [in] | content | : 條碼內容 |
| [in] | scale | : 設置比例 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| [in] | xdim | : 設定 x 座標的單元格大小 |
| [in] | CodeType | : 設置代碼類型(例如 AztecCodeTypeEnum::Compact) |
| [in] | iFixedErrCorrection | : 設置固定錯誤更正(例如 AztecCodeTypeEnum::FixedErrCorrection) |
| [in] | iLayers | : 設置層數 |
| [in] | rotation | : 設定旋轉角度 (RotateEnum::None/RotateEnum::ClockWise/RotateEnum::CounterClockWise/RotateEnum::Inverted) |
| void * CreateBarcode1D | ( | float | start_x, |
| float | start_y, | ||
| std::string | content, | ||
| ScaleEnum | scale, | ||
| float | narrowBar, | ||
| float | wideBar, | ||
| float | Height, | ||
| BarcodeTypeEnum_1D | BcdTyp, | ||
| bool | PrintHumanReadable, | ||
| RotateEnum | rotation, | ||
| bool | PdfLocTop ) |
在標籤中創建一維條碼。
| [in] | x_start | : x 座標的起始點 |
| [in] | y_start | : Y 座標的起始點 |
| [in] | content | : 條碼內容 |
| [in] | scale | : 設置比例 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| [in] | narrowBar | : 窄條寬度 |
| [in] | wideBar | : 寬條寬度 |
| [in] | Height | : 設定高度 |
| [in] | BcdTyp | : 設置條碼類型(例如 BarcodeTypeEnum_1D::Code_128) |
| [in] | PrintHumanReadable | : 设置列印人眼可读的标志 |
| [in] | rotation | : 設定旋轉角度 (RotateEnum::None/RotateEnum::ClockWise/RotateEnum::CounterClockWise/RotateEnum::Inverted) |
| [in] | PdfLocTop | : 設一個標誌將人類可讀的資料列印在條碼的上方。(預設值為下方) |
| void * CreateBoxs | ( | float | start_x, |
| float | start_y, | ||
| float | end_x, | ||
| float | end_y, | ||
| float | lineThickness, | ||
| ScaleEnum | scale ) |
在標籤中創建框
| [in] | x_start | : x 座標的起始點 |
| [in] | y_start | : Y 座標的起始點 |
| [in] | end_x | : X 座標的終點 |
| [in] | end_y | : Y 座標的終點 |
| [in] | lineThickness | : 設置線條粗細 |
| [in] | scale | : 設置比例 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| void * CreateDataMatrixBarcodes | ( | float | start_x, |
| float | start_y, | ||
| std::string | content, | ||
| ScaleEnum | scale, | ||
| float | xdim, | ||
| RotateEnum | Rotation, | ||
| bool | UseRectangle, | ||
| std::string | MatrixMultiLine, | ||
| char | CtrlChar1, | ||
| char | CtrlChar2, | ||
| int | row, | ||
| int | col ) |
在標籤中創建 data matrix 條碼。
| [in] | x_start | : x 座標的起始點 |
| [in] | y_start | : Y 座標的起始點 |
| [in] | content | : 條碼內容 |
| [in] | scale | : 設置比例 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| [in] | xdim | : 設定 x 座標的單元格大小 |
| [in] | Rotation | : 設定旋轉角度 (RotateEnum::None/RotateEnum::ClockWise/RotateEnum::CounterClockWise/RotateEnum::Inverted) |
| [in] | UseRectangle | : 設置標誌以使用矩形 |
| [in] | MatrixMultiLine | : 設置多行字串 |
| [in] | rotationCtrlChar1 | : 設置 CtrlChar1 |
| [in] | rotationCtrlChar2 | : 設置 CtrlChar2 |
| [in] | row | : 設定行數以限制條碼的高度 |
| [in] | col | : 設定列數以限制條碼的寬度 |
| void CreateLabel | ( | int | iPrintLanguageTyp, |
| std::string | LabelName, | ||
| float | dotsPerUnit, | ||
| ScaleEnum | unit ) |
建立標籤。
| [in] | iPrintLanguageTyp | : 設定 TSPL 或 PGL |
| [in] | LabelName | : 設定標籤名 |
| [in] | dotsPerUnit | : 設定 DPI (203/300/600) |
| [in] | unit | : 單位設定 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| void * CreateLines | ( | float | start_x, |
| float | start_y, | ||
| float | end_x, | ||
| float | end_y, | ||
| float | lineThickness, | ||
| ScaleEnum | scale ) |
在標籤中創建線條
| [in] | x_start | : x 座標的起始點 |
| [in] | y_start | : Y 座標的起始點 |
| [in] | end_x | : X 座標的終點 |
| [in] | end_y | : Y 座標的終點 |
| [in] | lineThickness | : 設置線條粗細 |
| [in] | scale | : 設置比例 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| void * CreateMaxicodeBarcodes | ( | int | iMaxicodeTyp, |
| MaxicodeModeEnum | mode, | ||
| std::string | postalCode, | ||
| std::string | countryCode, | ||
| std::string | serviceClass, | ||
| std::string | remainingMsg, | ||
| std::string | year, | ||
| std::string | primaryMsg, | ||
| float | start_x, | ||
| float | start_y, | ||
| ScaleEnum | scale, | ||
| bool | ZipperPattern, | ||
| RotateEnum | rotation ) |
在標籤中創建 Maxicode 條碼。
| [in] | iMaxicodeTyp | : 選擇 MaxiCode 類型(例如 _MaxicodeMsgStructured) |
| [in] | mode | : 設置 maxicode(例如 MaxicodeModeEnum::MODE_2) |
| [in] | postalCode | : 設置郵遞區編碼字串 |
| [in] | countryCode | : 設置國家/地區代碼字串 |
| [in] | serviceClass | : 設置服務類字串 |
| [in] | remainingMsg | : 設置剩餘的消息字串 |
| [in] | year | : 設置年份字串 |
| [in] | primaryMsg | : 設置主消息字串 |
| [in] | start_x | : x 座標的起始點 |
| [in] | start_y | : Y 座標的起始點 |
| [in] | scale | : 設置比例 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| [in] | ZipperPattern | : 是否為 zipper pattern 設置標誌 |
| [in] | rotation | : 設定旋轉角度 (RotateEnum::None/RotateEnum::ClockWise/RotateEnum::CounterClockWise/RotateEnum::Inverted) |
| void * CreatePdf417Bcodes | ( | float | start_x, |
| float | start_y, | ||
| std::string | content, | ||
| ScaleEnum | scale, | ||
| float | xdim, | ||
| float | ydim, | ||
| Pdf417ErrCorrectionEnum | ErrorCorrection, | ||
| int | row, | ||
| int | col, | ||
| RotateEnum | rotation ) |
在標籤中創建 PDF417 條碼。
| [in] | x_start | : x 座標的起始點 |
| [in] | y_start | : Y 座標的起始點 |
| [in] | content | : 條碼內容 |
| [in] | scale | : 設置比例 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| [in] | xdim | : 設定 x 座標的單元格大小 |
| [in] | ydim | : 設定 y 座標的單元格大小 單元格大小可以視為 PDF417 條碼行中最窄條形元素的寬度和高度。 改變最小元素的尺寸會影響條碼的整體寬度和高度。 |
| [in] | ErrorCorrection | : 設置錯誤更正級別(例如 Pdf417ErrCorrectionEnum::LEVEL_5) |
| [in] | row | : 設定行數以限制條碼的高度 |
| [in] | col | : 設定列數以限制條碼的寬度 |
| [in] | rotation | : 設定旋轉角度 (RotateEnum::None/RotateEnum::ClockWise/RotateEnum::CounterClockWise/RotateEnum::Inverted) |
| void * CreateQRBarcodes | ( | float | start_x, |
| float | start_y, | ||
| std::string | content, | ||
| ScaleEnum | scale, | ||
| float | xdim, | ||
| QRCodeMaskEnum | Mask, | ||
| std::vector< std::tuple< QRCodeManualEncodingEnum, std::string > > * | dataManuallyEncoded, | ||
| QRCodeErrorCorrectionEnum | errEnum, | ||
| QRCodeModelEnum | modelEnum, | ||
| RotateEnum | rotation ) |
在標籤中創建 QR 條碼。
| [in] | x_start | : x 座標的起始點 |
| [in] | y_start | : Y 座標的起始點 |
| [in] | content | : 條碼內容 |
| [in] | scale | : 設置比例 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| [in] | xdim | : 設定 x 座標的單元格大小 |
| [in] | Mask | : 設置遮罩(例如 QRCodeMaskEnum::Mask_4) |
| [in] | dataManuallyEncoded | : 設置手動編碼數據 |
| [in] | errEnu | : 設置錯誤更正枚舉(例如 QRCodeErrorCorrectionEnum::EC_15) |
| [in] | modelEnum | : 設置模型枚舉(例如 QRCodeModelEnum::MODEL_1) |
| [in] | rotation | : 設定旋轉角度 (RotateEnum::None/RotateEnum::ClockWise/RotateEnum::CounterClockWise/RotateEnum::Inverted) |
| void * CreateRfidEncode | ( | unsigned int | a32BitField, |
| unsigned int | a16BitField, | ||
| std::string | a6CharAsciiString, | ||
| RfidMemBlockEnum | MemBlock, | ||
| int | iOffsetFromStart, | ||
| std::string | _10BytesUserData, | ||
| std::string | _4BytesHexUserData, | ||
| RfidPasswordTypeEnum | PasswordEnum, | ||
| std::string | Password ) |
在標籤中創建 RFID。
| [in] | a32BitField | : 設置 RFID 32 位字段 |
| [in] | a16BitField | : 設置 RFID 16 位字段 |
| [in] | a6CharAsciiString | : 設置 RFID 6 個字符的 ASCII 字串 |
| [in] | MemBlock | : 設置記憶體區塊(例如 RfidMemBlockEnum::EPC) |
| [in] | iOffsetFromStart | : 設置從起始點的偏移量 |
| [in] | _10BytesUserData | : 設置 RFID 10 字節字串 |
| [in] | _4BytesHexUserData | : 設置 RFID 4 字節字串 |
| [in] | PasswordEnum | : 設置密碼枚舉(例如 RfidPasswordTypeEnum::Lock) |
| [in] | Password | : 設置密碼字串 |

| void * CreateTexts | ( | float | x_start, |
| float | y_start, | ||
| float | fontsize_x, | ||
| float | fontsize_y, | ||
| std::string | data, | ||
| ScaleEnum | scale, | ||
| FontSizeUnitsEnum | FontSizeUnit, | ||
| FontStyleEnum | FontStyle, | ||
| AlignEnum | Alignment, | ||
| std::string | fontName, | ||
| RotateEnum | rotation ) |
建立文字標籤。
| [in] | x_start | : x 座標的起始點 |
| [in] | y_start | : Y 座標的起始點 |
| [in] | fontsize_x | : x 座標的字體大小 |
| [in] | fontsize_y | : Y 座標的字體大小 |
| [in] | data | : 文字內容 |
| [in] | scale | : 設置比例 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| [in] | FontSizeUnit | : 設定字體大小單位 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| [in] | FontStyle | : 設定字體樣式 (FontSizeUnitsEnum::Ruler/FontSizeUnitsEnum::Points/FontSizeUnitsEnum::Percent) |
| [in] | Alignment | : 設定文字對齊方式 (ScaleEnum::Dot/ScaleEnum::MM/ScaleEnum::Inch) |
| [in] | fontName | : 設定字體名稱 |
| [in] | rotation | : 設定旋轉角度 (RotateEnum::None/RotateEnum::ClockWise/RotateEnum::CounterClockWise/RotateEnum::Inverted) |
| void LabelToString | ( | std::string & | str | ) |
使用 TSPL 或 PGL 創建標籤。
| [out] | str | : TSPL 或 PGL 字串 |
| std::string ToHexString | ( | const std::string & | input | ) |

| int giPrintLanguageTyp = 0 |
| AztecBarcodeType* gpAztecBarcodeType = nullptr |
| Barcode1DType* gpBarcode1DType = nullptr |
| BoxType* gpBoxType = nullptr |
| CellRect* gpCellRect = nullptr |
| CellSquare* gpCellSquare = nullptr |
| DataMatrixBarcodeType* gpDataMatrixBarcodeType = nullptr |
| LabelType* gpLabel = nullptr |
| LineType* gpLineType = nullptr |
| MexiCodeBarcodeType* gpMexiCodeBarcodeType = nullptr |
| Pdf417BarcodeType* gpPdf417BarcodeType = nullptr |
| PrintResolution* gpPrinterResolution = nullptr |
| QRBarcodeType* gpQRBarcodeType = nullptr |
| RfidWriteType* gpRfidWriteType = nullptr |
| Ruler* gpRuler = nullptr |
| TextType* gpTextType = nullptr |
| std::vector<void*> ObjCellRectPtr |
| std::vector<void*> ObjCellSquarePtr |
| std::vector<void*> ObjectsPtr |
| std::vector<void*> ObjEndPtr |
| std::vector<void*> ObjRulerPtr |
| std::vector<void*> ObjStartPtr |
| std::vector<void*> ObjTextItemPtr |