Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Stores recognized barcode data like SingleDecodeType type, string codetext,
> ```
> This sample shows how to obtain BarCodeResult.
>
> BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code128, "12345");
> BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.CODE_128, "12345");
> generator.save("c:\\test.png");
> BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.CODE_39_STANDARD, DecodeType.CODE_128);
> BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.CODE_39, DecodeType.CODE_128);
> for(BarCodeResult result : reader.readBarCodes())
> {
> System.out.println("BarCode Type: " + result.getCodeTypeName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Base class for MultyDecodeType and SingleDecodeType.
> This sample shows how to use BaseDecodeType with SingleDecodeType and MultyDecodeType
>
> BaseDecodeType decodeOne = DecodeType.CODE_128;
> BaseDecodeType decodeTwo = new MultyDecodeType(DecodeType.CODE_128, DecodeType.CODE_39_STANDARD, DecodeType.CODE_39_EXTENDED);
> BaseDecodeType decodeTwo = new MultyDecodeType(DecodeType.CODE_128, DecodeType.CODE_39_STANDARD, DecodeType.CODE_39_FULL_ASCII);
> ```
## Methods

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Specify the type of barcode to read.
> ```
> This sample shows how to detect Code39 and Code128 barcodes.
>
> BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.CODE_39_STANDARD, DecodeType.CODE_128);
> BarCodeReader reader = new BarCodeReader("c:\\test.png", DecodeType.CODE_39_FULL_ASCII, DecodeType.CODE_128);
> for(BarCodeResult result : reader.readBarCodes())
> {
> System.out.println("BarCode Type: " + result.getCodeTypeName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ Stores a MaxiCode additional information of recognized barcode
| [isEmpty()](#isEmpty--) | Tests whether all parameters has only default values |
| [notify()](#notify--) | |
| [notifyAll()](#notifyAll--) | |
| [setMaxiCodeMode(int maxiCodeMode)](#setMaxiCodeMode-int-) | Sets a MaxiCode encode mode. |
| [setMaxiCodeStructuredAppendModeBarcodeId(int value)](#setMaxiCodeStructuredAppendModeBarcodeId-int-) | Sets a MaxiCode barcode id in structured append mode. |
| [setMaxiCodeStructuredAppendModeBarcodesCount(int value)](#setMaxiCodeStructuredAppendModeBarcodesCount-int-) | Sets a MaxiCode barcodes count in structured append mode. |
| [toString()](#toString--) | Returns a human-readable string representation of this MaxiCodeExtendedParameters . |
| [wait()](#wait--) | |
| [wait(long arg0)](#wait-long-) | |
Expand Down Expand Up @@ -137,45 +134,6 @@ public final native void notifyAll()



### setMaxiCodeMode(int maxiCodeMode) {#setMaxiCodeMode-int-}
```
public void setMaxiCodeMode(int maxiCodeMode)
```


Sets a MaxiCode encode mode. Default value: Mode4

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| maxiCodeMode | int | |

### setMaxiCodeStructuredAppendModeBarcodeId(int value) {#setMaxiCodeStructuredAppendModeBarcodeId-int-}
```
public void setMaxiCodeStructuredAppendModeBarcodeId(int value)
```


Sets a MaxiCode barcode id in structured append mode. Default value: 0

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | int | |

### setMaxiCodeStructuredAppendModeBarcodesCount(int value) {#setMaxiCodeStructuredAppendModeBarcodesCount-int-}
```
public void setMaxiCodeStructuredAppendModeBarcodesCount(int value)
```


Sets a MaxiCode barcodes count in structured append mode. Default value: -1

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| value | int | |

### toString() {#toString--}
```
public String toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Composite decode type.
> CreateThis sample shows how to create compound MultyDecode types that combine SingleDecodeType and MultiDecode types.
>
> MultyDecodeType types1 = new MultyDecodeType(DecodeType.QR, DecodeType.DATA_MATRIX);
> MultyDecodeType types2 = new MultyDecodeType(types1, DecodeType.CODE_128, DecodeType.CODE_39_STANDARD);
> MultyDecodeType types2 = new MultyDecodeType(types1, DecodeType.CODE_128, DecodeType.CODE_39);
> ```
## Constructors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,19 @@ Class for encoding and decoding the text embedded in the HIBC LIC code which sto
> combinedCodetext.getSecondaryAndAdditionalData().setSerialNumber("SERIAL123");
> combinedCodetext.getSecondaryAndAdditionalData().setDateOfManufacture(new Date());
> ComplexBarcodeGenerator generator = new ComplexBarcodeGenerator(combinedCodetext);
> {
> BufferedImage image = generator.generateBarCodeImage();
> BarCodeReader reader = new BarCodeReader(image, DecodeType.HIBCQRLIC);
> {
> reader.readBarCodes();
> String codetext = reader.getFoundBarCodes()[0].getCodeText();
> HIBCLICCombinedCodetext result = (HIBCLICCombinedCodetext)ComplexCodetextReader.tryDecodeHIBCLIC(codetext);
> System.out.println("Product or catalog number: " + result.getPrimaryData().getProductOrCatalogNumber());
> System.out.println("Labeler identification code: " + result.getPrimaryData().getLabelerIdentificationCode());
> System.out.println("Unit of measure ID: " + result.getPrimaryData().getUnitOfMeasureID());
> System.out.println("Expiry date: " + result.getSecondaryAndAdditionalData().getExpiryDate());
> System.out.println("Quantity: " + result.getSecondaryAndAdditionalData().getQuantity());
> System.out.println("Lot number: " + result.getSecondaryAndAdditionalData().getLotNumber());
> System.out.println("Serial number: " + result.getSecondaryAndAdditionalData().getSerialNumber());
> System.out.println("Date of manufacture: " + result.getSecondaryAndAdditionalData().getDateOfManufacture());
> }
> }
> BufferedImage image = generator.generateBarCodeImage();
> BarCodeReader reader = new BarCodeReader(image, DecodeType.HIBCQRLIC);
> reader.readBarCodes();
> String codetext = reader.getFoundBarCodes()[0].getCodeText();
> HIBCLICCombinedCodetext result = (HIBCLICCombinedCodetext)ComplexCodetextReader.tryDecodeHIBCLIC(codetext);
> System.out.println("Product or catalog number: " + result.getPrimaryData().getProductOrCatalogNumber());
> System.out.println("Labeler identification code: " + result.getPrimaryData().getLabelerIdentificationCode());
> System.out.println("Unit of measure ID: " + result.getPrimaryData().getUnitOfMeasureID());
> System.out.println("Expiry date: " + result.getSecondaryAndAdditionalData().getExpiryDate());
> System.out.println("Quantity: " + result.getSecondaryAndAdditionalData().getQuantity());
> System.out.println("Lot number: " + result.getSecondaryAndAdditionalData().getLotNumber());
> System.out.println("Serial number: " + result.getSecondaryAndAdditionalData().getSerialNumber());
> System.out.println("Date of manufacture: " + result.getSecondaryAndAdditionalData().getDateOfManufacture());
> ```
## Constructors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Class for encoding and decoding the text embedded in the HIBC LIC code which sto
> ```
> This sample shows how to encode and decode HIBC LIC using HIBCLICPrimaryDataCodetext.
>
> HIBCLICPrimaryCodetext complexCodetext = new HIBCLICPrimaryDataCodetext();
> HIBCLICPrimaryDataCodetext complexCodetext = new HIBCLICPrimaryDataCodetext();
> complexCodetext.setBarcodeType(EncodeTypes.HIBCQRLIC);
> complexCodetext.setData(new PrimaryData());
> complexCodetext.getData().setProductOrCatalogNumber("12345");
Expand All @@ -31,7 +31,7 @@ Class for encoding and decoding the text embedded in the HIBC LIC code which sto
> BarCodeReader reader = new BarCodeReader(image, DecodeType.HIBCQRLIC);
> {
> reader.readBarCodes();
> String codetext = reader.getFoundBarCodes()[0].getCodeText();
> HIBCLICPrimaryCodetext result = (HIBCLICPrimaryCodetext)ComplexCodetextReader.TryDecodeHIBCLIC(codetext);
> HIBCLICPrimaryCodetext result = (HIBCLICPrimaryCodetext)ComplexCodetextReader.tryDecodeHIBCLIC(codetext);
> System.out.println("Product or catalog number: " + result.getData().getProductOrCatalogNumber());
> System.out.println("Labeler identification code: " + result.getData().getLabelerIdentificationCode());
Expand Down
36 changes: 6 additions & 30 deletions english/java/com.aspose.barcode.generation/autosizemode/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,13 @@ java.lang.Object, java.lang.Enum
public enum AutoSizeMode extends Enum<AutoSizeMode>
```

Specifies the different types of automatic sizing modes. Default value is AutoSizeMode.NONE.

--------------------

> ```
> This sample shows how to create and save a BarCode image.
>
> BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
> generator.getParameters().setAutoSizeMode(AutoSizeMode.NEAREST);
> generator.getParameters().getBarCodeWidth().setMillimeters(50);
> generator.getParameters().getBarCodeHeight().setInches(1.3f);
> generator.save("test.png");
> ```
Specifies the different types of automatic sizing modes.
## Fields

| Field | Description |
| --- | --- |
| [INTERPOLATION](#INTERPOLATION) | Resizes barcode to specified size with little scaling but it can be little damaged in some cases because using interpolation for scaling. |
| [NEAREST](#NEAREST) | Barcode resizes to nearest lowest possible size which are specified by BarCodeWidth and BarCodeHeight properties. |
| [INTERPOLATION](#INTERPOLATION) | Resizes barcode to specified size. |
| [NEAREST](#NEAREST) | Resizes barcode to nearest lowest possible size specified by ImageWidth and ImageHeight properties. |
| [NONE](#NONE) | Automatic resizing is disabled. |
## Methods

Expand Down Expand Up @@ -59,35 +47,23 @@ public static final AutoSizeMode INTERPOLATION
```


Resizes barcode to specified size with little scaling but it can be little damaged in some cases because using interpolation for scaling. Size can be specified by BarcodeGenerator.BarCodeWidth and BarcodeGenerator.BarCodeHeight properties.

--------------------

> ```
> This sample shows how to create and save a BarCode image in Scale mode.
>
> BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
> generator.getParameters().setAutoSizeMode(AutoSizeMode.INTERPOLATION);
> generator.getParameters().getBarCodeWidth().setMillimeters(50);
> generator.getParameters().getBarCodeHeight().setInches(1.3f);
> generator.save("test.png");
> ```
Resizes barcode to specified size. Size can be specified by ImageWidth and ImageHeight properties. Generated barcode may be invalid (not readable) after scaling.

### NEAREST {#NEAREST}
```
public static final AutoSizeMode NEAREST
```


Barcode resizes to nearest lowest possible size which are specified by BarCodeWidth and BarCodeHeight properties.
Resizes barcode to nearest lowest possible size specified by ImageWidth and ImageHeight properties. Preserves default aspect ratio.

### NONE {#NONE}
```
public static final AutoSizeMode NONE
```


Automatic resizing is disabled. Default value.
Automatic resizing is disabled.

### <T>valueOf(Class<T> arg0, String arg1) {#-T-valueOf-java.lang.Class-T--java.lang.String-}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class BarcodeGenerator

BarcodeGenerator for backend barcode images generation.

supported symbologies: 1D: Codabar, Code11, Code128, Code39Standard, Code39Extended Code93Standard, Code93Extended, EAN13, EAN8, Interleaved2of5, MSI, Standard2of5, UPCA, UPCE, ISBN, GS1Code128, Postnet, Planet EAN14, SCC14, SSCC18, ITF14, SingaporePost ... 2D: Aztec, DataMatrix, PDf417, QR code ...
supported symbologies: 1D: Codabar, Code11, Code128, Code39, Code39FullASCII Code93, Code93Extended, EAN13, EAN8, Interleaved2of5, MSI, Standard2of5, UPCA, UPCE, ISBN, GS1Code128, Postnet, Planet EAN14, SCC14, SSCC18, ITF14, SingaporePost ... 2D: Aztec, DataMatrix, PDf417, QR code ...

--------------------

Expand Down Expand Up @@ -55,7 +55,8 @@ supported symbologies: 1D: Codabar, Code11, Code128, Code39Standard, Code39Exten
| [setBarcodeType(BaseEncodeType value)](#setBarcodeType-com.aspose.barcode.generation.BaseEncodeType-) | Barcode symbology type. |
| [setCodeText(byte[] codeBytes)](#setCodeText-byte---) | Set codetext as sequence of bytes. |
| [setCodeText(String value)](#setCodeText-java.lang.String-) | Text to be encoded. |
| [setCodeText(String codeText, Charset encoding)](#setCodeText-java.lang.String-java.nio.charset.Charset-) | Encodes codetext with byte order mark (BOM) using specified encoding. |
| [setCodeText(String codeText, Charset encoding)](#setCodeText-java.lang.String-java.nio.charset.Charset-) | Encodes codetext with byte order mark (BOM), using specified encoding. |
| [setCodeText(String codeText, Charset encoding, boolean insertBOM)](#setCodeText-java.lang.String-java.nio.charset.Charset-boolean-) | Encodes codetext with optional byte order mark (BOM) insertion, using specified encoding: like UTF8, UTF16, UTF32, e.t.c. |
| [toString()](#toString--) | |
| [wait()](#wait--) | |
| [wait(long arg0)](#wait-long-) | |
Expand Down Expand Up @@ -345,13 +346,60 @@ public void setCodeText(String codeText, Charset encoding)
```


Encodes codetext with byte order mark (BOM) using specified encoding.
Encodes codetext with byte order mark (BOM), using specified encoding. This sample shows how to use SetCodeText with 1D and 2D barcodes

```
BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.CODE_128);
gen.setCodeText("123ABCD", StandardCharsets.US_ASCII);
gen.save("barcode.png", BarCodeImageFormat.PNG);

BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.QR);
gen.setCodeText("123ABCD", StandardCharsets.ISO_8859_1, true);
gen.save("barcode.png", BarCodeImageFormat.PNG);

BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.QR);
gen.setCodeText("123ABCD", Encoding.UTF_8, false);
gen.save("barcode.png", BarCodeImageFormat.PNG);
```

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| codeText | java.lang.String | CodeText string |
| encoding | java.nio.charset.Charset | Applied encoding |

### setCodeText(String codeText, Charset encoding, boolean insertBOM) {#setCodeText-java.lang.String-java.nio.charset.Charset-boolean-}
```
public void setCodeText(String codeText, Charset encoding, boolean insertBOM)
```


Encodes codetext with optional byte order mark (BOM) insertion, using specified encoding: like UTF8, UTF16, UTF32, e.t.c. 1D barcodes should use Encoding ASCII or ISO/IEC 8859-1. 2D barcodes should use Encoding UTF8. Detailed description you can find in the @see [documentation][]

--------------------

> ```
> This sample shows how to use setCodeText
>
>
> BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.CODE_128);
> gen.setCodeText("123ABCD", StandardCharsets.ISO_8859_1, true);
> gen.save("barcode.png", BarCodeImageFormat.PNG);
>
> BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.CODE_128);
> gen.setCodeText("123ABCD", StandardCharsets.UTF_8, false);
> gen.save("barcode.png", BarCodeImageFormat.PNG);
> ```


[documentation]: https://docs.aspose.com/barcode/java/how-to-use-insert-bom-parameter/

**Parameters:**
| Parameter | Type | Description |
| --- | --- | --- |
| codeText | java.lang.String | CodeText string |
| encoding | java.nio.charset.Charset | Applied encoding |
| insertBOM | boolean | flag indicates insertion of the Encoding byte order mark (BOM). In case, the Encoding requires byte order mark (BOM) insertion: like UTF8, UTF16, UTF32, e.t.c. and flag is set to true, the BOM is added, in case of setting flag to false, the BOM insertion is ignored. |

### toString() {#toString--}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Specifies the file format of the image.
| [EMF](#EMF) | Specifies the Enhanced Metafile (EMF) image format. |
| [GIF](#GIF) | Specifies the Graphics Interchange Format (GIF) image format. |
| [JPEG](#JPEG) | Specifies the Joint Photographic Experts Group (JPEG) image format. |
| [PDF](#PDF) | Specifies the Portable Document Format (PDF) image format. |
| [PNG](#PNG) | Specifies the W3C Portable Network Graphics (PNG) image format. |
| [SVG](#SVG) | Specifies the Scalable Vector Graphics (SVG) image format. |
| [TIFF](#TIFF) | Specifies the Tagged Image File Format (TIFF) image format. |
Expand Down Expand Up @@ -78,6 +79,14 @@ public static final BarCodeImageFormat JPEG

Specifies the Joint Photographic Experts Group (JPEG) image format.

### PDF {#PDF}
```
public static final BarCodeImageFormat PDF
```


Specifies the Portable Document Format (PDF) image format.

### PNG {#PNG}
```
public static final BarCodeImageFormat PNG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ public boolean getThrowExceptionWhenCodeTextIncorrect()
```


Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingapurePost, Code39Extended, Code93Extended, Code16K, Code128 symbology if codetext is incorrect.
Only for 1D barcodes. If codetext is incorrect and value set to true - exception will be thrown. Otherwise codetext will be corrected to match barcode's specification. Exception always will be thrown for: Databar symbology if codetext is incorrect. Exception always will not be thrown for: AustraliaPost, SingapurePost, Code39FullASCII, Code93, Code16K, Code128 symbology if codetext is incorrect.

**Returns:**
boolean
Expand All @@ -517,7 +517,7 @@ public float getWideNarrowRatio()
```


Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39Extended, Code39Standard
Wide bars to Narrow bars ratio. Default value: 3, that is, wide bars are 3 times as wide as narrow bars. Used for ITF, PZN, PharmaCode, Standard2of5, Interleaved2of5, Matrix2of5, ItalianPost25, IATA2of5, VIN, DeutschePost, OPC, Code32, DataLogic2of5, PatchCode, Code39, Code39FullASCII

**Returns:**
float
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ Specifies the type of barcode to encode.
| [HIBC_AZTEC_PAS](#HIBC-AZTEC-PAS) | Specifies that the data should be encoded with **HIBC PAS Aztec** barcode specification. |
| [HIBC_CODE_128_LIC](#HIBC-CODE-128-LIC) | Specifies that the data should be encoded with **HIBC LIC Code128** barcode specification. |
| [HIBC_CODE_128_PAS](#HIBC-CODE-128-PAS) | Specifies that the data should be encoded with **HIBC PAS Code128** barcode specification. |
| [HIBC_CODE_39_LIC](#HIBC-CODE-39-LIC) | Specifies that the data should be encoded with **HIBC LIC Code39Standart** barcode specification. |
| [HIBC_CODE_39_PAS](#HIBC-CODE-39-PAS) | Specifies that the data should be encoded with **HIBC PAS Code39Standart** barcode specification. |
| [HIBC_CODE_39_LIC](#HIBC-CODE-39-LIC) | Specifies that the data should be encoded with **HIBC LIC Code39** barcode specification. |
| [HIBC_CODE_39_PAS](#HIBC-CODE-39-PAS) | Specifies that the data should be encoded with **HIBC PAS Code39** barcode specification. |
| [HIBC_DATA_MATRIX_LIC](#HIBC-DATA-MATRIX-LIC) | Specifies that the data should be encoded with **HIBC LIC DataMatrix** barcode specification. |
| [HIBC_DATA_MATRIX_PAS](#HIBC-DATA-MATRIX-PAS) | Specifies that the data should be encoded with **HIBC PAS DataMatrix** barcode specification. |
| [IATA_2_OF_5](#IATA-2-OF-5) | Represents IATA 2 of 5 barcode.IATA (International Air Transport Assosiation) uses this barcode for the management of air cargo. |
Expand Down Expand Up @@ -489,15 +489,15 @@ public static final SymbologyEncodeType HIBC_CODE_39_LIC
```


Specifies that the data should be encoded with **HIBC LIC Code39Standart** barcode specification.
Specifies that the data should be encoded with **HIBC LIC Code39** barcode specification.

### HIBC_CODE_39_PAS {#HIBC-CODE-39-PAS}
```
public static final SymbologyEncodeType HIBC_CODE_39_PAS
```


Specifies that the data should be encoded with **HIBC PAS Code39Standart** barcode specification.
Specifies that the data should be encoded with **HIBC PAS Code39** barcode specification.

### HIBC_DATA_MATRIX_LIC {#HIBC-DATA-MATRIX-LIC}
```
Expand Down