11#ifndef PDF_BARCODE_ZINT_H
12#define PDF_BARCODE_ZINT_H
21 enum class Symbology :
int
88 SYM_RSS14STACK_OMNI = 80,
90 SYM_RSS_EXPSTACK = 81,
112 SYM_HIBC_MICPDF = 108,
113 SYM_HIBC_BLOCKF = 110,
114 SYM_HIBC_AZTEC = 112,
121 SYM_MAILMARK_2D = 119,
123 SYM_MAILMARK_4S = 121,
130 SYM_GS1_128_CC = 131,
132 SYM_DBAR_OMN_CC = 132,
134 SYM_DBAR_LTD_CC = 133,
135 SYM_RSS_LTD_CC = 133,
136 SYM_DBAR_EXP_CC = 134,
137 SYM_RSS_EXP_CC = 134,
140 SYM_DBAR_STK_CC = 137,
141 SYM_RSS14STACK_CC = 137,
142 SYM_DBAR_OMNSTK_CC = 138,
143 SYM_RSS14_OMNI_CC = 138,
144 SYM_DBAR_EXPSTK_CC = 139,
145 SYM_RSS_EXPSTACK_CC = 139,
148 SYM_GRIDMATRIX = 142,
153 SYM_DXFILMEDGE = 147,
158const int OUT_BIND_TOP = 0x00001;
159const int OUT_BIND = 0x00002;
160const int OUT_BOX = 0x00004;
161const int OUT_STDOUT = 0x00008;
162const int OUT_READER_INIT = 0x00010;
163const int OUT_SMALL_TEXT = 0x00020;
164const int OUT_BOLD_TEXT = 0x00040;
165const int OUT_CMYK_COLOUR = 0x00080;
166const int OUT_DOTTY_MODE = 0x00100;
167const int OUT_GS1_GS_SEPARATOR = 0x00200;
168const int OUT_BUFFER_INTERMEDIATE = 0x00400;
169const int OUT_QUIET_ZONES = 0x00800;
170const int OUT_NO_QUIET_ZONES = 0x01000;
171const int OUT_COMPLIANT_HEIGHT = 0x02000;
172const int OUT_EANUPC_GUARD_WHITESPACE = 0x04000;
173const int OUT_EMBED_VECTOR_FONT = 0x08000;
174const int OUT_MEMORY_FILE = 0x10000;
177const int INP_DATA_MODE = 0;
178const int INP_UNICODE_MODE = 1;
179const int INP_GS1_MODE = 2;
181const int INP_ESCAPE_MODE = 0x0008;
182const int INP_GS1PARENS_MODE = 0x0010;
183const int INP_GS1NOCHECK_MODE = 0x0020;
184const int INP_HEIGHTPERROW_MODE = 0x0040;
185const int INP_FAST_MODE = 0x0080;
186const int INP_EXTRA_ESCAPE_MODE = 0x0100;
189const int OPT_DM_SQUARE = 100;
190const int OPT_DM_DMRE = 101;
191const int OPT_DM_ISO_144 = 128;
194const int OPT_FULL_MULTIBYTE = 200;
197const int OPT_ULTRA_COMPRESSION = 128;
200enum class ReturnCode :
int
202 BC_WARN_HRT_TRUNCATED = 1,
203 BC_WARN_INVALID_OPTION = 2,
204 BC_WARN_USES_ECI = 3,
205 BC_WARN_NONCOMPLIANT = 4,
207 BC_ERROR_TOO_LONG = 5,
208 BC_ERROR_INVALID_DATA = 6,
209 BC_ERROR_INVALID_CHECK = 7,
210 BC_ERROR_INVALID_OPTION = 8,
211 BC_ERROR_ENCODING_PROBLEM = 9,
212 BC_ERROR_FILE_ACCESS = 10,
213 BC_ERROR_MEMORY = 11,
214 BC_ERROR_FILE_WRITE = 12,
215 BC_ERROR_USES_ECI = 13,
216 BC_ERROR_NONCOMPLIANT = 14,
217 BC_ERROR_HRT_TRUNCATED = 15
221const int WARN_DEFAULT = 0;
222const int WARN_FAIL_ALL = 2;
225const int CAP_HRT = 0x0001;
226const int CAP_STACKABLE = 0x0002;
227const int CAP_EANUPC = 0x0004;
228const int CAP_EXTENDABLE = 0x0004;
229const int CAP_COMPOSITE = 0x0008;
230const int CAP_ECI = 0x0010;
231const int CAP_GS1 = 0x0020;
232const int CAP_DOTTY = 0x0040;
233const int CAP_QUIET_ZONES = 0x0080;
234const int CAP_FIXED_RATIO = 0x0100;
235const int CAP_READER_INIT = 0x0200;
236const int CAP_FULL_MULTIBYTE = 0x0400;
237const int CAP_MASK = 0x0800;
238const int CAP_STRUCTAPP = 0x1000;
239const int CAP_COMPLIANT_HEIGHT = 0x2000;
260 wxPdfZintSeg(
const wxString& text,
const int ECIIndex = 0);
280 wxPdfBarcode::Symbology
GetSymbology()
const {
return static_cast<wxPdfBarcode::Symbology
>(m_symbol); }
286 void SetSymbology(wxPdfBarcode::Symbology symbol) { m_symbol =
static_cast<int>(symbol); }
313 void SetText(
const wxString& text);
326 void SetSegments(
const std::vector<wxPdfZintSeg>& segs);
449 int GetStructAppCount()
const;
450 int GetStructAppIndex()
const;
451 wxString GetStructAppID()
const;
452 void SetStructApp(
const int count,
const int index,
const wxString&
id);
453 void ClearStructApp();
465 bool SetFgColourStr(
const wxString& fgStr);
471 wxColour GetFgColour()
const;
477 void SetFgColour(
const wxColour& fgColor);
489 bool SetBgColourStr(
const wxString& bgStr);
495 wxColour GetBgColour()
const;
501 void SetBgColour(
const wxColour& bgColor);
525 void SetBorderType(
int borderTypeIndex);
537 void SetBorderWidth(
int borderWidth);
574 void SetFontSetting(
int fontSetting);
664 void SetRotateAngle(
int rotateAngle);
677 void SetECIFromIndex(
int ECIIndex);
683 void SetECI(
int eci);
786 double GetEncodedHeight()
const;
806 void SetWidth(
int width);
812 int GetWidth()
const;
818 void SetSecurityLevel(
int securityLevel);
824 int GetSecurityLevel()
const;
832 static bool HasHRT(wxPdfBarcode::Symbology symbology);
838 static bool IsStackable(wxPdfBarcode::Symbology symbology);
844 static bool IsExtendable(wxPdfBarcode::Symbology symbology);
850 static bool IsComposite(wxPdfBarcode::Symbology symbology);
856 static bool SupportsECI(wxPdfBarcode::Symbology symbology);
862 static bool SupportsGS1(wxPdfBarcode::Symbology symbology);
868 static bool IsDotty(wxPdfBarcode::Symbology symbology);
874 static bool HasDefaultQuietZones(wxPdfBarcode::Symbology symbology);
880 static bool HasFixedRatio(wxPdfBarcode::Symbology symbology);
886 static bool SupportsReaderInit(wxPdfBarcode::Symbology symbology);
892 static bool SupportsFullMultibyte(wxPdfBarcode::Symbology symbology);
898 static bool HasMask(wxPdfBarcode::Symbology symbology);
904 static bool SupportsStructApp(wxPdfBarcode::Symbology symbology);
910 static bool HasCompliantHeight(wxPdfBarcode::Symbology symbology);
916 static bool TakesGS1AIData(wxPdfBarcode::Symbology symbology);
936 bool HasErrors()
const;
943 bool SaveToFile(
const wxString& filename);
959 double GetDefaultXdim()
const;
966 static double GetDefaultXdim(wxPdfBarcode::Symbology symbology);
973 static wxString GetBarcodeName(
const wxPdfBarcode::Symbology symbology);
985 static bool IsValidSymbology(
int symbolId);
991 static int GetVersion();
1005 wxString m_primaryMessage;
1006 std::vector<wxPdfZintSeg> m_segs;
1015 double m_guardDescent;
1029 bool m_noQuietZones;
1030 bool m_compliantHeight;
1036 bool m_guardWhitespace;
1037 bool m_embedVectorFont;
1042 double m_encodedHeight;
1043 double m_vectorWidth;
1044 double m_vectorHeight;
1045 wxString m_lastError;
Class representing Zint barcode objects.
Definition: pdfbarcodezint.h:268
bool GetCMYK() const
Get flag whether CMYK colour space is used (Encapsulated PostScript and TIF)
Definition: pdfbarcodezint.h:507
bool ShowText() const
Show (true) or hide (false) Human Readable Text.
Definition: pdfbarcodezint.h:592
void SetGS1NoCheckMode(bool gs1NoCheck)
Set flag whether validity of GS1 data is not checked (except that printable ASCII only)
Definition: pdfbarcodezint.h:707
void SetDotSize(double dotSize)
Set size of dots used in dotty mode.
Definition: pdfbarcodezint.h:434
int GetWarnLevel() const
Get the warning level.
Definition: pdfbarcodezint.h:749
wxString GetPrimaryMessage() const
Get the primary message (Maxicode, Composite)
Definition: pdfbarcodezint.h:332
double GetVectorWidth() const
Get the vector width after successful rendering.
Definition: pdfbarcodezint.h:792
void SetPrimaryMessage(const wxString &primaryMessage)
Set the primary message (Maxicode, Composite)
Definition: pdfbarcodezint.h:338
int GetError() const
Get the error or warning code returned by Zint on render() or save_to_file()
Definition: pdfbarcodezint.h:924
void SetHeight(double height)
Set the symbol height in X-dimensions.
Definition: pdfbarcodezint.h:350
void SetQuietZones(bool quietZones)
Enable or disable compliant quiet zones (additional to any specified whitespace)
Definition: pdfbarcodezint.h:624
void SetWarnLevel(int warnLevel)
Set the warning level.
Definition: pdfbarcodezint.h:755
std::vector< wxPdfZintSeg > GetSegments() const
Get the segments.
Definition: pdfbarcodezint.h:319
bool HasQuietZones() const
Add compliant quiet zones (additional to any specified whitespace)
Definition: pdfbarcodezint.h:617
void SetNoQuietZones(bool noQuietZones)
Enable or disable quiet zones, notably those with defaults.
Definition: pdfbarcodezint.h:638
double GetTextGap() const
Get the text gap.
Definition: pdfbarcodezint.h:580
bool HasReaderInit() const
Check whether Reader Initialisation (Programming) is used.
Definition: pdfbarcodezint.h:713
int GetVerticalWhitespace() const
Get the height in X-dimensions of whitespace above & below the barcode.
Definition: pdfbarcodezint.h:555
wxString GetText() const
Get the input data.
Definition: pdfbarcodezint.h:306
bool GetGS1NoCheckMode() const
Get flag whether validity of GS1 data is not checked (except that printable ASCII only)
Definition: pdfbarcodezint.h:701
int GetOption3() const
Get symbol-specific option 3.
Definition: pdfbarcodezint.h:380
bool HasEmbedVectorFont() const
Check whether the font will be embedded in vector output - currently only for SVG output of EAN/UPC.
Definition: pdfbarcodezint.h:737
int GetEncodedRows() const
Get the number of encoded rows after successful rendering.
Definition: pdfbarcodezint.h:780
void SetOption3(int option)
Set symbol-specific option 3.
Definition: pdfbarcodezint.h:386
int GetFontSetting() const
Type of font to use i.e. normal, small, bold or (vector only) small bold.
Definition: pdfbarcodezint.h:567
wxString GetFgColourStr() const
Get the foreground colour (may be RGB(A) hex string or CMYK decimal "C,M,Y,K" percentage string)
Definition: pdfbarcodezint.h:459
int GetWhitespace() const
Get the width in X-dimensions of whitespace to left & right of barcode.
Definition: pdfbarcodezint.h:543
void SetSeparatorGS(bool gsSep)
Use GS (Group Separator) instead of FNC1 as GS1 separator (Data Matrix)
Definition: pdfbarcodezint.h:610
const wxString & GetLastError() const
Get the error message returned by Zint on render() or save_to_file()
Definition: pdfbarcodezint.h:930
void SetCMYK(bool cmyk)
Enable or disable the use of CMYK colour space (Encapsulated PostScript and TIF)
Definition: pdfbarcodezint.h:513
void SetDotty(bool dotty)
Set dotty mode.
Definition: pdfbarcodezint.h:422
bool HasSeparatorGS() const
Check whether GS (Group Separator) is used instead of FNC1 as GS1 separator (Data Matrix)
Definition: pdfbarcodezint.h:604
bool HasGS1ParensMode() const
Get flag whether parentheses are processed as GS1 AI delimiters (instead of square brackets)
Definition: pdfbarcodezint.h:689
void SetShowText(bool showText)
Enable (true) or disable (false) Human Readable Text.
Definition: pdfbarcodezint.h:598
wxPdfBarcode::Symbology GetSymbology() const
Get symbology in use.
Definition: pdfbarcodezint.h:280
bool GetDotty() const
Get dotty mode.
Definition: pdfbarcodezint.h:416
void SetEmbedVectorFont(bool embedVectorFont)
Set flag whether to embed the font in vector output - currently only for SVG output of EAN/UPC.
Definition: pdfbarcodezint.h:743
double GetHeight() const
Get the symbol height in X-dimensions.
Definition: pdfbarcodezint.h:344
wxString GetBgColourStr() const
Get the background colour (may be RGB(A) hex string or CMYK decimal "C,M,Y,K" percentage string)
Definition: pdfbarcodezint.h:483
double GetDpmm() const
Get the resolution of output in dots per mm (BMP/EMF/PCX/PNG/TIF only)
Definition: pdfbarcodezint.h:404
bool HasNoQuietZones() const
Disable quiet zones, notably those with defaults.
Definition: pdfbarcodezint.h:631
void SetScale(double scale)
Set scale factor when printing barcode, i.e. adjusts X-dimension.
Definition: pdfbarcodezint.h:398
void SetReaderInit(bool readerInit)
Set Reader Initialisation (Programming)
Definition: pdfbarcodezint.h:719
void SetVerticalWhitespace(int vWhitespace)
Get the height in X-dimensions of whitespace above & below the barcode.
Definition: pdfbarcodezint.h:561
void SetGuardWhitespace(bool guardWhitespace)
Set flag whether to add quiet zone indicators ("<", ">") to HRT (EAN/UPC)
Definition: pdfbarcodezint.h:731
void SetWhitespace(int whitespace)
Set the width in X-dimensions of whitespace to left & right of barcode.
Definition: pdfbarcodezint.h:549
bool GetCompliantHeight() const
Get compliant height flag.
Definition: pdfbarcodezint.h:644
int GetBorderType() const
Get the type of border above/below/around barcode.
Definition: pdfbarcodezint.h:519
double GetVectorHeight() const
Get the vector height after successful rendering.
Definition: pdfbarcodezint.h:798
void SetGuardDescent(double guardDescent)
Set the height in X-dimensions that EAN/UPC guard bars descend.
Definition: pdfbarcodezint.h:446
bool HasDebugFlag() const
Check the debugging flag.
Definition: pdfbarcodezint.h:761
void SetSymbology(wxPdfBarcode::Symbology symbol)
Set symbology to use.
Definition: pdfbarcodezint.h:286
bool HasGuardWhitespace() const
Check whether quiet zone indicators will be added.
Definition: pdfbarcodezint.h:725
int GetEncodedWidth() const
Get the encoded width after successful rendering.
Definition: pdfbarcodezint.h:774
double GetGuardDescent() const
Get the height in X-dimensions that EAN/UPC guard bars descend.
Definition: pdfbarcodezint.h:440
int GetOption1() const
Get symbol-specific option 1.
Definition: pdfbarcodezint.h:356
void SetDebugFlag(bool debug)
Debugging flags.
Definition: pdfbarcodezint.h:767
double GetDotSize() const
Get size of dots used in dotty mode.
Definition: pdfbarcodezint.h:428
double GetScale() const
Get scale factor when printing barcode, i.e. adjusts X-dimension.
Definition: pdfbarcodezint.h:392
void SetOption2(int option)
Set symbol-specific option 2.
Definition: pdfbarcodezint.h:374
void SetOption1(int option)
Set symbol-specific option 1.
Definition: pdfbarcodezint.h:362
void SetInputMode(int inputMode)
Set the input data encoding. Default UNICODE_MODE.
Definition: pdfbarcodezint.h:298
void SetDpmm(double dpmm)
Set the resolution of output in dots per mm (BMP/EMF/PCX/PNG/TIF only)
Definition: pdfbarcodezint.h:410
void SetGS1ParensMode(bool gs1Parens)
Set flag whether parentheses are processed as GS1 AI delimiters (instead of square brackets)
Definition: pdfbarcodezint.h:695
int GetOption2() const
Get symbol-specific option 2.
Definition: pdfbarcodezint.h:368
int GetRotateAngle() const
Rotate barcode by angle (degrees 0, 90, 180 and 270)
Definition: pdfbarcodezint.h:657
int GetECI() const
Get Extended Channel Interpretation (segment 0 eci)
Definition: pdfbarcodezint.h:670
int GetInputMode() const
Get the input data encoding. Default UNICODE_MODE.
Definition: pdfbarcodezint.h:292
int GetBorderWidth() const
Get the border width in X-dimensions.
Definition: pdfbarcodezint.h:531
void SetCompliantHeight(bool compliantHeight)
Set compliant height.
Definition: pdfbarcodezint.h:651
void SetTextGap(double textGap)
Set the text gap.
Definition: pdfbarcodezint.h:586
Class representing a PDF document.
Definition: pdfdocument.h:176
Class representing Zint segments.
Definition: pdfbarcodezint.h:254