mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Merge branch 'cepnet'
This commit is contained in:
commit
400f124a04
@ -521,7 +521,7 @@ static const void *barcode_funcs[BARCODE_LAST + 1] = {
|
|||||||
eanx, NULL, eanx, eanx, NULL, /*35-39*/
|
eanx, NULL, eanx, eanx, NULL, /*35-39*/
|
||||||
postnet, NULL, NULL, NULL, NULL, /*40-44*/
|
postnet, NULL, NULL, NULL, NULL, /*40-44*/
|
||||||
NULL, NULL, msi_plessey, NULL, fim, /*45-49*/
|
NULL, NULL, msi_plessey, NULL, fim, /*45-49*/
|
||||||
code39, pharma, pzn, pharma_two, NULL, /*50-54*/
|
code39, pharma, pzn, pharma_two, postnet, /*50-54*/
|
||||||
pdf417, pdf417, maxicode, qrcode, NULL, /*55-59*/
|
pdf417, pdf417, maxicode, qrcode, NULL, /*55-59*/
|
||||||
code128, NULL, NULL, auspost, NULL, /*60-64*/
|
code128, NULL, NULL, auspost, NULL, /*60-64*/
|
||||||
NULL, auspost, auspost, auspost, eanx, /*65-69*/
|
NULL, auspost, auspost, auspost, eanx, /*65-69*/
|
||||||
|
@ -132,6 +132,10 @@ static int usps_set_height(struct zint_symbol *symbol, const int no_errtxt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Handles the PostNet system used for Zip codes in the US */
|
/* Handles the PostNet system used for Zip codes in the US */
|
||||||
|
/* Also handles Brazilian CEPNet - more information at
|
||||||
|
* https://silo.tips/download/sumario-4-regras-de-endereamento
|
||||||
|
* https://barcodeguide.seagullscientific.com/Content/Symbologies/CEPNet.htm
|
||||||
|
* TODO: Check compliant symbol sizes */
|
||||||
static int postnet_enc(struct zint_symbol *symbol, const unsigned char source[], char *d, const int length) {
|
static int postnet_enc(struct zint_symbol *symbol, const unsigned char source[], char *d, const int length) {
|
||||||
int i, sum, check_digit;
|
int i, sum, check_digit;
|
||||||
int error_number = 0;
|
int error_number = 0;
|
||||||
@ -140,10 +144,18 @@ static int postnet_enc(struct zint_symbol *symbol, const unsigned char source[],
|
|||||||
strcpy(symbol->errtxt, "480: Input too long (38 character maximum)");
|
strcpy(symbol->errtxt, "480: Input too long (38 character maximum)");
|
||||||
return ZINT_ERROR_TOO_LONG;
|
return ZINT_ERROR_TOO_LONG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (symbol->symbology == BARCODE_CEPNET) {
|
||||||
|
if (length != 8) {
|
||||||
|
strcpy(symbol->errtxt, "499: Input is wrong length (should be 8 digits)");
|
||||||
|
error_number = ZINT_WARN_NONCOMPLIANT;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (length != 5 && length != 9 && length != 11) {
|
if (length != 5 && length != 9 && length != 11) {
|
||||||
strcpy(symbol->errtxt, "479: Input length is not standard (5, 9 or 11 characters)");
|
strcpy(symbol->errtxt, "479: Input length is not standard (5, 9 or 11 characters)");
|
||||||
error_number = ZINT_WARN_NONCOMPLIANT;
|
error_number = ZINT_WARN_NONCOMPLIANT;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!is_sane(NEON_F, source, length)) {
|
if (!is_sane(NEON_F, source, length)) {
|
||||||
strcpy(symbol->errtxt, "481: Invalid character in data (digits only)");
|
strcpy(symbol->errtxt, "481: Invalid character in data (digits only)");
|
||||||
return ZINT_ERROR_INVALID_DATA;
|
return ZINT_ERROR_INVALID_DATA;
|
||||||
|
@ -178,6 +178,7 @@ extern "C" {
|
|||||||
#define BARCODE_PHARMA 51 /* Pharmacode One-Track */
|
#define BARCODE_PHARMA 51 /* Pharmacode One-Track */
|
||||||
#define BARCODE_PZN 52 /* Pharmazentralnummer */
|
#define BARCODE_PZN 52 /* Pharmazentralnummer */
|
||||||
#define BARCODE_PHARMA_TWO 53 /* Pharmacode Two-Track */
|
#define BARCODE_PHARMA_TWO 53 /* Pharmacode Two-Track */
|
||||||
|
#define BARCODE_CEPNET 54 /* Brazilian CEPNet Postal Code */
|
||||||
#define BARCODE_PDF417 55 /* PDF417 */
|
#define BARCODE_PDF417 55 /* PDF417 */
|
||||||
#define BARCODE_PDF417COMP 56 /* Compact PDF417 (Truncated PDF417) */
|
#define BARCODE_PDF417COMP 56 /* Compact PDF417 (Truncated PDF417) */
|
||||||
#define BARCODE_PDF417TRUNC 56 /* Legacy */
|
#define BARCODE_PDF417TRUNC 56 /* Legacy */
|
||||||
|
59
docs/images/cepnet.svg
Normal file
59
docs/images/cepnet.svg
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||||
|
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="186" height="11" version="1.1"
|
||||||
|
xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<desc>Zint Generated Symbol
|
||||||
|
</desc>
|
||||||
|
|
||||||
|
<g id="barcode" fill="#000000">
|
||||||
|
<rect x="0" y="0" width="186" height="11" fill="#FFFFFF" />
|
||||||
|
<rect x="0.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="16.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="20.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="32.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="40.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="52.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="56.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="68.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="80.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="88.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="96.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="108.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="112.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="124.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="140.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="144.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="156.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="168.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="180.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="184.00" y="0.00" width="2.00" height="10.75" />
|
||||||
|
<rect x="4.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="8.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="12.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="24.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="28.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="36.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="44.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="48.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="60.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="64.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="72.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="76.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="84.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="92.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="100.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="104.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="116.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="120.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="128.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="132.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="136.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="148.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="152.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="160.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="164.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="172.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
<rect x="176.00" y="6.45" width="2.00" height="4.30" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 3.2 KiB |
@ -602,6 +602,8 @@ Value
|
|||||||
|
|
||||||
53 `BARCODE_PHARMA_TWO` Pharmacode Two-Track
|
53 `BARCODE_PHARMA_TWO` Pharmacode Two-Track
|
||||||
|
|
||||||
|
54 `BARCODE_CEPNET` Brazilian CEPNet
|
||||||
|
|
||||||
55 `BARCODE_PDF417` PDF417
|
55 `BARCODE_PDF417` PDF417
|
||||||
|
|
||||||
56`*` `BARCODE_PDF417COMP` Compact PDF417 (Truncated PDF417)
|
56`*` `BARCODE_PDF417COMP` Compact PDF417 (Truncated PDF417)
|
||||||
@ -3147,6 +3149,15 @@ lengths used by USPS were `Planet12` (11-digit input) and `Planet14` (13-digit
|
|||||||
input), and as with POSTNET a warning will be issued if the length is not one of
|
input), and as with POSTNET a warning will be issued if the length is not one of
|
||||||
these.
|
these.
|
||||||
|
|
||||||
|
### 6.4.4 Brazilian CEPNet
|
||||||
|
|
||||||
|
![`zint -b CEPNET --compliantheight -d "12345678"`](images/cepnet.svg)
|
||||||
|
|
||||||
|
Based on POSTNET, the CEPNet symbol is used by Correios, the Brazilian postal
|
||||||
|
service, to encode CEP (Código de Endereçamento Postal) numbers on mail items.
|
||||||
|
Input should consist of eight digits with the check digit being automattically
|
||||||
|
added by Zint.
|
||||||
|
|
||||||
\clearpage
|
\clearpage
|
||||||
|
|
||||||
## 6.5 4-State Postal Codes
|
## 6.5 4-State Postal Codes
|
||||||
|
@ -75,6 +75,7 @@ zint -b GS1_128_CC --compliantheight -d "[99]1234-abcd" --mode=3 --primary="[01]
|
|||||||
zint -b PHARMA_TWO --compliantheight -d "29876543" --scale=1 -o images/pharma_two.svg
|
zint -b PHARMA_TWO --compliantheight -d "29876543" --scale=1 -o images/pharma_two.svg
|
||||||
zint -b POSTNET --compliantheight -d "12345678901" --scale=1 -o images/postnet.svg
|
zint -b POSTNET --compliantheight -d "12345678901" --scale=1 -o images/postnet.svg
|
||||||
zint -b PLANET --compliantheight -d "4012345235636" --scale=1 -o images/planet.svg
|
zint -b PLANET --compliantheight -d "4012345235636" --scale=1 -o images/planet.svg
|
||||||
|
zint -b CEPNET --compliantheight -d "12345678" --scale=1 -o images/cepnet.svg
|
||||||
zint -b AUSPOST --compliantheight -d "96184209" --scale=1 -o images/auspost.svg
|
zint -b AUSPOST --compliantheight -d "96184209" --scale=1 -o images/auspost.svg
|
||||||
zint -b AUSROUTE --compliantheight -d "34567890" --scale=1 -o images/ausroute.svg
|
zint -b AUSROUTE --compliantheight -d "34567890" --scale=1 -o images/ausroute.svg
|
||||||
zint -b AUSREPLY --compliantheight -d "12345678" --scale=1 -o images/ausreply.svg
|
zint -b AUSREPLY --compliantheight -d "12345678" --scale=1 -o images/ausreply.svg
|
||||||
|
@ -81,20 +81,21 @@ static void types(void) {
|
|||||||
"51 PHARMA Pharmacode One-Track 130 EANX_CC Composite EAN\n"
|
"51 PHARMA Pharmacode One-Track 130 EANX_CC Composite EAN\n"
|
||||||
"52 PZN Pharmazentralnummer 131 GS1_128_CC Composite GS1-128\n"
|
"52 PZN Pharmazentralnummer 131 GS1_128_CC Composite GS1-128\n"
|
||||||
"53 PHARMA_TWO Pharmacode Two-Track 132 DBAR_OMN_CC Comp DataBar Omni\n"
|
"53 PHARMA_TWO Pharmacode Two-Track 132 DBAR_OMN_CC Comp DataBar Omni\n"
|
||||||
"55 PDF417 PDF417 133 DBAR_LTD_CC Comp DataBar Limited\n"
|
"54 CEPNET Brazilian CEPNet 133 DBAR_LTD_CC Comp DataBar Limited\n"
|
||||||
"56 PDF417COMP Compact PDF417 134 DBAR_EXP_CC Comp DataBar Expanded\n"
|
"55 PDF417 PDF417 134 DBAR_EXP_CC Comp DataBar Expanded\n"
|
||||||
"57 MAXICODE MaxiCode 135 UPCA_CC Composite UPC-A\n"
|
"56 PDF417COMP Compact PDF417 135 UPCA_CC Composite UPC-A\n"
|
||||||
"58 QRCODE QR Code 136 UPCE_CC Composite UPC-E\n"
|
"57 MAXICODE MaxiCode 136 UPCE_CC Composite UPC-E\n"
|
||||||
"60 CODE128B Code 128 (Subset B) 137 DBAR_STK_CC Comp DataBar Stacked\n"
|
"58 QRCODE QR Code 137 DBAR_STK_CC Comp DataBar Stacked\n"
|
||||||
"63 AUSPOST AP Standard Customer 138 DBAR_OMNSTK_CC Comp DataBar Stack Omn\n"
|
"60 CODE128B Code 128 (Subset B) 138 DBAR_OMNSTK_CC Comp DataBar Stack Omn\n"
|
||||||
"66 AUSREPLY AP Reply Paid 139 DBAR_EXPSTK_CC Comp DataBar Exp Stack\n"
|
"63 AUSPOST AP Standard Customer 139 DBAR_EXPSTK_CC Comp DataBar Exp Stack\n"
|
||||||
"67 AUSROUTE AP Routing 140 CHANNEL Channel Code\n"
|
"66 AUSREPLY AP Reply Paid 140 CHANNEL Channel Code\n"
|
||||||
"68 AUSREDIRECT AP Redirection 141 CODEONE Code One\n"
|
"67 AUSROUTE AP Routing 141 CODEONE Code One\n"
|
||||||
"69 ISBNX ISBN 142 GRIDMATRIX Grid Matrix\n"
|
"68 AUSREDIRECT AP Redirection 142 GRIDMATRIX Grid Matrix\n"
|
||||||
"70 RM4SCC Royal Mail 4SCC 143 UPNQR UPN QR Code\n"
|
"69 ISBNX ISBN 143 UPNQR UPN QR Code\n"
|
||||||
"71 DATAMATRIX Data Matrix 144 ULTRA Ultracode\n"
|
"70 RM4SCC Royal Mail 4SCC 144 ULTRA Ultracode\n"
|
||||||
"72 EAN14 EAN-14 145 RMQR Rectangular Micro QR\n"
|
"71 DATAMATRIX Data Matrix 145 RMQR Rectangular Micro QR\n"
|
||||||
"73 VIN Vehicle Information No. 146 BC412 BC412\n"
|
"72 EAN14 EAN-14 146 BC412 BC412\n"
|
||||||
|
"73 VIN Vehicle Information No.\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,6 +304,7 @@ static int get_barcode_name(const char *barcode_name) {
|
|||||||
{ BARCODE_C25LOGIC, "c25logic" },
|
{ BARCODE_C25LOGIC, "c25logic" },
|
||||||
{ BARCODE_C25STANDARD, "c25matrix" },
|
{ BARCODE_C25STANDARD, "c25matrix" },
|
||||||
{ BARCODE_C25STANDARD, "c25standard" },
|
{ BARCODE_C25STANDARD, "c25standard" },
|
||||||
|
{ BARCODE_CEPNET, "cepnet" },
|
||||||
{ BARCODE_CHANNEL, "channel" },
|
{ BARCODE_CHANNEL, "channel" },
|
||||||
{ BARCODE_CHANNEL, "channelcode" }, /* Synonym */
|
{ BARCODE_CHANNEL, "channelcode" }, /* Synonym */
|
||||||
{ BARCODE_CODABAR, "codabar" },
|
{ BARCODE_CODABAR, "codabar" },
|
||||||
|
@ -73,6 +73,7 @@ static const struct bstyle_item bstyle_items[] = {
|
|||||||
{ QSL("Aztec Code (ISO 24778) (and HIBC)"), BARCODE_AZTEC },
|
{ QSL("Aztec Code (ISO 24778) (and HIBC)"), BARCODE_AZTEC },
|
||||||
{ QSL("Aztec Runes (ISO 24778)"), BARCODE_AZRUNE },
|
{ QSL("Aztec Runes (ISO 24778)"), BARCODE_AZRUNE },
|
||||||
{ QSL("BC412 (SEMI T1-95)"), BARCODE_BC412 },
|
{ QSL("BC412 (SEMI T1-95)"), BARCODE_BC412 },
|
||||||
|
{ QSL("Brazilian Postal Code (CEPNet)"), BARCODE_CEPNET },
|
||||||
{ QSL("Channel Code"), BARCODE_CHANNEL },
|
{ QSL("Channel Code"), BARCODE_CHANNEL },
|
||||||
{ QSL("Codabar (EN 798)"), BARCODE_CODABAR },
|
{ QSL("Codabar (EN 798)"), BARCODE_CODABAR },
|
||||||
{ QSL("Codablock-F (and HIBC)"), BARCODE_CODABLOCKF },
|
{ QSL("Codablock-F (and HIBC)"), BARCODE_CODABLOCKF },
|
||||||
@ -259,7 +260,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags fl)
|
|||||||
filter_bstyle->hide();
|
filter_bstyle->hide();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bstyle->setCurrentIndex(settings.value(QSL("studio/symbology"), 11).toInt());
|
bstyle->setCurrentIndex(settings.value(QSL("studio/symbology"), 12).toInt());
|
||||||
|
|
||||||
load_settings(settings);
|
load_settings(settings);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user