From 461f63fd6445c6b3736f9b6b3b4b263cd687f0de Mon Sep 17 00:00:00 2001 From: Aleksander Date: Thu, 28 Aug 2025 14:10:54 +0300 Subject: [PATCH] Javadoc API for Aspose.Barcode for Java release 25.8 is updated --- .../barcoderesult/_index.md | 24 +++++- .../barcodesettings/_index.md | 54 +++++++++++- .../basedecodetype/_index.md | 40 ++++++++- .../multydecodetype/_index.md | 50 +++++++++-- .../singledecodetype/_index.md | 43 ++++++---- .../barcodegenerator/_index.md | 82 +++++++++++++----- .../cmykcolor/_index.md | 20 ++--- .../pdfparameters/_index.md | 85 ++++++++++++++----- 8 files changed, 310 insertions(+), 88 deletions(-) diff --git a/english/java/com.aspose.barcode.barcoderecognition/barcoderesult/_index.md b/english/java/com.aspose.barcode.barcoderecognition/barcoderesult/_index.md index 934b499c8..3f8905b43 100644 --- a/english/java/com.aspose.barcode.barcoderecognition/barcoderesult/_index.md +++ b/english/java/com.aspose.barcode.barcoderecognition/barcoderesult/_index.md @@ -45,7 +45,7 @@ Stores recognized barcode data like SingleDecodeType type, string codetext, | [getClass()](#getClass--) | | | [getCodeBytes()](#getCodeBytes--) | Gets the encoded code bytes | | [getCodeText()](#getCodeText--) | Gets the code text | -| [getCodeText(Charset encoding)](#getCodeText-java.nio.charset.Charset-) | Gets the code text with encoding. | +| [getCodeText(Charset charset)](#getCodeText-java.nio.charset.Charset-) | Gets the code text with encoding. | | [getCodeType()](#getCodeType--) | Gets the barcode type | | [getCodeTypeName()](#getCodeTypeName--) | Gets the name of the barcode type | | [getConfidence()](#getConfidence--) | Gets recognition confidence level of the recognized barcode | @@ -131,18 +131,34 @@ Value: The code text of the barcode **Returns:** java.lang.String -### getCodeText(Charset encoding) {#getCodeText-java.nio.charset.Charset-} +### getCodeText(Charset charset) {#getCodeText-java.nio.charset.Charset-} ``` -public String getCodeText(Charset encoding) +public String getCodeText(Charset charset) ``` Gets the code text with encoding. +-------------------- + +> ``` +> This example shows how to use ``` +> GetCodeText +> ```: +> +> BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.DATA_MATRIX); +> gen.setCodeText("\u8eca\u7a2e\u540d", Charset.forName("932")); +> gen.save("barcode.png", BarCodeImageFormat.PNG); +> +> BarCodeReader reader = new BarCodeReader("barcode.png", DecodeType.DATA_MATRIX); +> for(BarCodeResult result : reader.readBarCodes()) +> System.out.println("BarCode CodeText: " + result.getCodeText(Charset.forName("932"))); +> ``` + **Parameters:** | Parameter | Type | Description | | --- | --- | --- | -| encoding | java.nio.charset.Charset | The encoding for codetext. | +| charset | java.nio.charset.Charset | The encoding for codetext. | **Returns:** java.lang.String - A string containing recognized code text. diff --git a/english/java/com.aspose.barcode.barcoderecognition/barcodesettings/_index.md b/english/java/com.aspose.barcode.barcoderecognition/barcodesettings/_index.md index 726e8b3af..d033c7e54 100644 --- a/english/java/com.aspose.barcode.barcoderecognition/barcodesettings/_index.md +++ b/english/java/com.aspose.barcode.barcoderecognition/barcodesettings/_index.md @@ -84,10 +84,34 @@ public boolean getDetectEncoding() ``` -The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true. Example BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR); generator.setCodeText("\\u0421\\u043b\\u043e\\u0432\\u043e", Charset.forName("UTF-8")); BufferedImage im = generator.generateBarcodeImage(); //detects encoding for Unicode codesets is enabled BarCodeReader reader = new BarCodeReader(im, DecodeType.QR); reader.getBarcodeSettings().setDetectEncoding(true); for(BarCodeResult result : reader.readBarCodes()) System.out.println("BarCode CodeText: " + result.getCodeText()); //detect encoding is disabled BarCodeReader reader = new BarCodeReader(im, DecodeType.QR); reader.getBarcodeSettings().setDetectEncoding(false); for(BarCodeResult result : reader.readBarCodes()) System.out.println("BarCode CodeText: " + result.getCodeText()); +The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true. + +-------------------- + +> ``` +> This sample shows how to detect text encoding on the fly if DetectEncoding is enabled +> +> +> ByteArrayOutputStream ms = new ByteArrayOutputStream(); +> BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR); +> generator.setCodeText("\u0421\u043b\u043e\u0432\u043e", StandardCharsets.UTF_8); +> generator.save(ms, BarCodeImageFormat.PNG); +> +> BarCodeReader reader = new BarCodeReader(new ByteArrayInputStream(ms.toByteArray()), DecodeType.QR); +> reader.getBarcodeSettings().setDetectEncoding(true); +> for (BarCodeResult result : reader.readBarCodes()) +> System.out.println("BarCode CodeText: " + result.getCodeText()); +> //detect encoding is disabled +> reader = new BarCodeReader(new ByteArrayInputStream(ms.toByteArray()), DecodeType.QR); +> reader.getBarcodeSettings().setDetectEncoding(false); +> for (BarCodeResult result : reader.readBarCodes()) +> System.out.println("BarCode CodeText: " + result.getCodeText()); +> ``` + +Value: The flag which force engine to detect codetext encoding for Unicode codesets **Returns:** -boolean - The flag which force engine to detect codetext encoding for Unicode codesets +boolean ### getStripFNC() {#getStripFNC--} ``` public boolean getStripFNC() @@ -143,7 +167,31 @@ public void setDetectEncoding(boolean value) ``` -The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true. Example BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR, "\\u0421\\u043b\\u043e\\u0432\\u043e")) generator.getParameters().getBarcode().getQR().setCodeTextEncoding(Charset.forName("UTF-8")); BufferedImage im = generator.generateBarcodeImage(); //detects encoding for Unicode codesets is enabled BarCodeReader reader = new BarCodeReader(im, DecodeType.QR); reader.getBarcodeSettings().setDetectEncoding(true); for(BarCodeResult result : reader.readBarCodes()) System.out.println("BarCode CodeText: " + result.getCodeText()); //detect encoding is disabled BarCodeReader reader = new BarCodeReader(im, DecodeType.QR); reader.getBarcodeSettings().setDetectEncoding(false); for(BarCodeResult result : reader.readBarCodes()) System.out.println("BarCode CodeText: " + result.getCodeText()); +The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true. + +-------------------- + +> ``` +> This sample shows how to detect text encoding on the fly if DetectEncoding is enabled +> +> +> ByteArrayOutputStream ms = new ByteArrayOutputStream(); +> BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.QR); +> generator.setCodeText("\u0421\u043b\u043e\u0432\u043e", StandardCharsets.UTF_8); +> generator.save(ms, BarCodeImageFormat.PNG); +> +> BarCodeReader reader = new BarCodeReader(new ByteArrayInputStream(ms.toByteArray()), DecodeType.QR); +> reader.getBarcodeSettings().setDetectEncoding(true); +> for (BarCodeResult result : reader.readBarCodes()) +> System.out.println("BarCode CodeText: " + result.getCodeText()); +> //detect encoding is disabled +> reader = new BarCodeReader(new ByteArrayInputStream(ms.toByteArray()), DecodeType.QR); +> reader.getBarcodeSettings().setDetectEncoding(false); +> for (BarCodeResult result : reader.readBarCodes()) +> System.out.println("BarCode CodeText: " + result.getCodeText()); +> ``` + +Value: The flag which force engine to detect codetext encoding for Unicode codesets **Parameters:** | Parameter | Type | Description | diff --git a/english/java/com.aspose.barcode.barcoderecognition/basedecodetype/_index.md b/english/java/com.aspose.barcode.barcoderecognition/basedecodetype/_index.md index f9e6d62f0..b5550ad18 100644 --- a/english/java/com.aspose.barcode.barcoderecognition/basedecodetype/_index.md +++ b/english/java/com.aspose.barcode.barcoderecognition/basedecodetype/_index.md @@ -27,7 +27,9 @@ Base class for MultyDecodeType and SingleDecodeType. | Method | Description | | --- | --- | | [containsAny(BaseDecodeType[] types)](#containsAny-com.aspose.barcode.barcoderecognition.BaseDecodeType...-) | Determines whether any of the given decode types is included into | -| [equals(Object obj)](#equals-java.lang.Object-) | Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. | +| [equals(MultyDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-) | Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. | +| [equals(SingleDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-) | Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. | +| [equals(Object other)](#equals-java.lang.Object-) | Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. | | [getClass()](#getClass--) | | | [hashCode()](#hashCode--) | | | [notify()](#notify--) | | @@ -54,9 +56,9 @@ Determines whether any of the given decode types is included into **Returns:** boolean - Value is a true if any types are included into. -### equals(Object obj) {#equals-java.lang.Object-} +### equals(MultyDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-} ``` -public boolean equals(Object obj) +public boolean equals(MultyDecodeType other) ``` @@ -65,7 +67,37 @@ Returns a value indicating whether this instance is equal to a specified [BaseDe **Parameters:** | Parameter | Type | Description | | --- | --- | --- | -| obj | java.lang.Object | An System.Object value to compare to this instance. | +| other | [MultyDecodeType](../../com.aspose.barcode.barcoderecognition/multydecodetype) | An java.lang.Object value to compare to this instance. | + +**Returns:** +boolean - True if obj has the same value as this instance; otherwise, false. +### equals(SingleDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-} +``` +public boolean equals(SingleDecodeType other) +``` + + +Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| other | [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) | An java.lang.Object value to compare to this instance. | + +**Returns:** +boolean - True if obj has the same value as this instance; otherwise, false. +### equals(Object other) {#equals-java.lang.Object-} +``` +public boolean equals(Object other) +``` + + +Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| other | java.lang.Object | An java.lang.Object value to compare to this instance. | **Returns:** boolean - True if obj has the same value as this instance; otherwise, false. diff --git a/english/java/com.aspose.barcode.barcoderecognition/multydecodetype/_index.md b/english/java/com.aspose.barcode.barcoderecognition/multydecodetype/_index.md index 0ff911ec2..b08f61521 100644 --- a/english/java/com.aspose.barcode.barcoderecognition/multydecodetype/_index.md +++ b/english/java/com.aspose.barcode.barcoderecognition/multydecodetype/_index.md @@ -35,11 +35,13 @@ Composite decode type. | [add(SingleDecodeType singleType)](#add-com.aspose.barcode.barcoderecognition.SingleDecodeType-) | Adds one more [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) to the MultyDecodeType. | | [containsAll(BaseDecodeType[] barcodeTypes)](#containsAll-com.aspose.barcode.barcoderecognition.BaseDecodeType...-) | Check if this contains all types from barcode types. | | [containsAny(BaseDecodeType[] decodeTypes)](#containsAny-com.aspose.barcode.barcoderecognition.BaseDecodeType...-) | Is contain any of types | +| [equals(MultyDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-) | Returns a value indicating whether this instance is equal to a specified value. | +| [equals(SingleDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-) | Returns a value indicating whether this decode types collection contains only specified value. | | [equals(Object obj)](#equals-java.lang.Object-) | Returns a value indicating whether this instance is equal to a specified MultyDecodeType value. | | [exclude(SingleDecodeType singleType)](#exclude-com.aspose.barcode.barcoderecognition.SingleDecodeType-) | Excludes SingleDecodeType from the MultyDecodeType and returns new MultyDecodeType instance. | | [getClass()](#getClass--) | | -| [getGetSingleTypesCount()](#getGetSingleTypesCount--) | Returns a number of single types. | | [getSingleTypes()](#getSingleTypes--) | Represents a list of single types. | +| [getSingleTypesCount()](#getSingleTypesCount--) | Returns a number of single types. | | [hashCode()](#hashCode--) | Returns the hash code for this instance. | | [notify()](#notify--) | | | [notifyAll()](#notifyAll--) | | @@ -119,6 +121,36 @@ Is contain any of types **Returns:** boolean - Value is a true if any types are included into +### equals(MultyDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-} +``` +public boolean equals(MultyDecodeType other) +``` + + +Returns a value indicating whether this instance is equal to a specified value. + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| other | [MultyDecodeType](../../com.aspose.barcode.barcoderecognition/multydecodetype) | An java.lang.Object value to compare to this instance. | + +**Returns:** +boolean - +### equals(SingleDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-} +``` +public boolean equals(SingleDecodeType other) +``` + + +Returns a value indicating whether this decode types collection contains only specified value. + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| other | [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) | An java.lang.Object value to compare to this instance. | + +**Returns:** +boolean - if this collection contains only specified decode type; otherwise, **false**. ### equals(Object obj) {#equals-java.lang.Object-} ``` public boolean equals(Object obj) @@ -159,26 +191,26 @@ public final native Class getClass() **Returns:** java.lang.Class -### getGetSingleTypesCount() {#getGetSingleTypesCount--} +### getSingleTypes() {#getSingleTypes--} ``` -public int getGetSingleTypesCount() +public List getSingleTypes() ``` -Returns a number of single types. +Represents a list of single types. **Returns:** -int -### getSingleTypes() {#getSingleTypes--} +java.util.List - List of single types +### getSingleTypesCount() {#getSingleTypesCount--} ``` -public List getSingleTypes() +public int getSingleTypesCount() ``` -Represents a list of single types. +Returns a number of single types. **Returns:** -java.util.List - List of single types +int ### hashCode() {#hashCode--} ``` public int hashCode() diff --git a/english/java/com.aspose.barcode.barcoderecognition/singledecodetype/_index.md b/english/java/com.aspose.barcode.barcoderecognition/singledecodetype/_index.md index f505580eb..bfe37009e 100644 --- a/english/java/com.aspose.barcode.barcoderecognition/singledecodetype/_index.md +++ b/english/java/com.aspose.barcode.barcoderecognition/singledecodetype/_index.md @@ -21,16 +21,13 @@ Single decode type. See decode type to get instance. > > SingleDecodeType singleType = DecodeType.QR > ``` -## Constructors - -| Constructor | Description | -| --- | --- | -| [SingleDecodeType(short typeIndex, String typeName)](#SingleDecodeType-short-java.lang.String-) | Initializes a new instance of [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) class by type index and name | ## Methods | Method | Description | | --- | --- | | [containsAny(BaseDecodeType[] types)](#containsAny-com.aspose.barcode.barcoderecognition.BaseDecodeType...-) | Returns a value indicating whether this instance is included into the list specified. | +| [equals(MultyDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-) | | +| [equals(SingleDecodeType other)](#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-) | | | [equals(Object obj)](#equals-java.lang.Object-) | Returns a value indicating whether this instance is equal to a specified [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) value. | | [getClass()](#getClass--) | | | [getString()](#getString--) | Converts the instance of SingleDecodeType to its equivalent string representation, using the following format: "Index:-1; Name:None". | @@ -48,35 +45,51 @@ Single decode type. See decode type to get instance. | [wait()](#wait--) | | | [wait(long arg0)](#wait-long-) | | | [wait(long arg0, int arg1)](#wait-long-int-) | | -### SingleDecodeType(short typeIndex, String typeName) {#SingleDecodeType-short-java.lang.String-} +### containsAny(BaseDecodeType[] types) {#containsAny-com.aspose.barcode.barcoderecognition.BaseDecodeType...-} ``` -public SingleDecodeType(short typeIndex, String typeName) +public boolean containsAny(BaseDecodeType[] types) ``` -Initializes a new instance of [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) class by type index and name +Returns a value indicating whether this instance is included into the list specified. **Parameters:** | Parameter | Type | Description | | --- | --- | --- | -| typeIndex | short | Gets an index of decode type | -| typeName | java.lang.String | Gets a name of decode type | +| types | [BaseDecodeType\[\]](../../com.aspose.barcode.barcoderecognition/basedecodetype) | Array of single and multy decode types | -### containsAny(BaseDecodeType[] types) {#containsAny-com.aspose.barcode.barcoderecognition.BaseDecodeType...-} +**Returns:** +boolean - Value is a true if any types are included into +### equals(MultyDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.MultyDecodeType-} ``` -public boolean containsAny(BaseDecodeType[] types) +public boolean equals(MultyDecodeType other) ``` -Returns a value indicating whether this instance is included into the list specified. +Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. **Parameters:** | Parameter | Type | Description | | --- | --- | --- | -| types | [BaseDecodeType\[\]](../../com.aspose.barcode.barcoderecognition/basedecodetype) | Array of single and multy decode types | +| other | [MultyDecodeType](../../com.aspose.barcode.barcoderecognition/multydecodetype) | | **Returns:** -boolean - Value is a true if any types are included into +boolean +### equals(SingleDecodeType other) {#equals-com.aspose.barcode.barcoderecognition.SingleDecodeType-} +``` +public boolean equals(SingleDecodeType other) +``` + + +Returns a value indicating whether this instance is equal to a specified [BaseDecodeType](../../com.aspose.barcode.barcoderecognition/basedecodetype) value. + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| other | [SingleDecodeType](../../com.aspose.barcode.barcoderecognition/singledecodetype) | | + +**Returns:** +boolean ### equals(Object obj) {#equals-java.lang.Object-} ``` public boolean equals(Object obj) diff --git a/english/java/com.aspose.barcode.generation/barcodegenerator/_index.md b/english/java/com.aspose.barcode.generation/barcodegenerator/_index.md index 150f6a392..750f585a2 100644 --- a/english/java/com.aspose.barcode.generation/barcodegenerator/_index.md +++ b/english/java/com.aspose.barcode.generation/barcodegenerator/_index.md @@ -55,8 +55,8 @@ supported symbologies: 1D: Codabar, Code11, Code128, Code39, Code39FullASCII Cod | [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, 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. | +| [setCodeText(String codeText, Charset encoding)](#setCodeText-java.lang.String-java.nio.charset.Charset-) | | +| [setCodeText(String codeText, Charset encoding, boolean insertBOM)](#setCodeText-java.lang.String-java.nio.charset.Charset-boolean-) | | | [toString()](#toString--) | | | [wait()](#wait--) | | | [wait(long arg0)](#wait-long-) | | @@ -346,21 +346,42 @@ public void setCodeText(String codeText, Charset encoding) ``` -Encodes codetext with byte order mark (BOM), using specified encoding. This sample shows how to use SetCodeText with 1D and 2D barcodes +Encodes the Unicode **codeText** into a byte sequence using the specified **encoding** . UTF-8 is the most commonly used encoding. If the encoding supports it, the function automatically inserts a [byte order mark (BOM)][byte order mark _BOM] . -``` -BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.CODE_128); - gen.setCodeText("123ABCD", StandardCharsets.US_ASCII); - gen.save("barcode.png", BarCodeImageFormat.PNG); +This function is intended for use with 2D barcodes only (e.g., Aztec, QR, DataMatrix, PDF417, MaxiCode, DotCode, HanXin, RectMicroQR, etc.). It enables manual encoding of Unicode text using national or special encodings; however, this method is considered obsolete in modern applications. For modern use cases, [ECI][] encoding is recommended for Unicode data. - BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.QR); - gen.setCodeText("123ABCD", StandardCharsets.ISO_8859_1, true); - gen.save("barcode.png", BarCodeImageFormat.PNG); +Using this function with 1D barcodes, GS1-compliant barcodes (including 2D), or HIBC barcodes (including 2D) is not supported by the corresponding barcode standards and may lead to unpredictable results. - BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.QR); - gen.setCodeText("123ABCD", Encoding.UTF_8, false); - gen.save("barcode.png", BarCodeImageFormat.PNG); -``` +-------------------- + +> ``` +> This example shows how to use ``` +> SetCodeText +> ``` setting Unicode-encoded text for 2D barcodes using different encodings: +> +> //Encode QR Code text using UTF-8 with BOM +> BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.QR); +> gen.setCodeText("\u8eca\u7a2e\u540d", StandardCharsets.UTF_8; +> gen.save("barcode.png", BarCodeImageFormat.PNG); +> +> BarCodeReader reader = new BarCodeReader("barcode.png", DecodeType.QR); +> for(BarCodeResult result : reader.readBarCodes()) +> System.out.println("BarCode CodeText: " + result.getCodeText()); +> +> //Encode DataMatrix text using Shift-JIS (Japanese encoding) +> BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.DATA_MATRIX); +> Charset charset = Charset.forName("Shift_JIS"); +> gen.setCodeText("\u8eca\u7a2e\u540d", charset); +> gen.save("barcode.png", BarCodeImageFormat.PNG); +> +> BarCodeReader reader = new BarCodeReader("barcode.png", DecodeType.DATA_MATRIX); +> for(BarCodeResult result : reader.readBarCodes()) +> System.out.println("BarCode CodeText: " + result.getCodeText(charset)); +> ``` + + +[byte order mark _BOM]: https://en.wikipedia.org/wiki/Byte_order_mark#Byte-order_marks_by_encoding +[ECI]: https://en.wikipedia.org/wiki/Extended_Channel_Interpretation **Parameters:** | Parameter | Type | Description | @@ -374,32 +395,47 @@ 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][] +Encodes the Unicode **codeText** into a byte sequence using the specified **encoding** . UTF-8 is the most commonly used encoding. If the encoding supports it and **insertBOM** is set to true , the function includes a [byte order mark (BOM)][byte order mark _BOM] . + +This function is intended for use with 2D barcodes only (e.g., Aztec, QR, DataMatrix, PDF417, MaxiCode, DotCode, HanXin, RectMicroQR, etc.). It enables manual encoding of Unicode text using national or special encodings; however, this method is considered obsolete in modern applications. For modern use cases, [ECI][] encoding is recommended for Unicode data. + +Using this function with 1D barcodes, GS1-compliant barcodes (including 2D), or HIBC barcodes (including 2D) is not supported by the corresponding barcode standards and may lead to unpredictable results. -------------------- > ``` -> This sample shows how to use setCodeText +> This example shows how to use ``` +> SetCodeText +> ``` with or without a BOM for 2D barcodes. > -> -> BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.CODE_128); -> gen.setCodeText("123ABCD", StandardCharsets.ISO_8859_1, true); +> //Encode codetext using UTF-8 with BOM +> BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.QR); +> gen.setCodeText("\u8eca\u7a2e\u540d", StandardCharsets.UTF_8, true); > gen.save("barcode.png", BarCodeImageFormat.PNG); > -> BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.CODE_128); -> gen.setCodeText("123ABCD", StandardCharsets.UTF_8, false); +> BarCodeReader reader = new BarCodeReader("barcode.png", DecodeType.QR); +> for(BarCodeResult result : reader.readBarCodes()) +> System.out.println("BarCode CodeText: " + result.getCodeText()); +> +> //Encode codetext using UTF-8 without BOM +> BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.QR); +> gen.setCodeText("\u8eca\u7a2e\u540d", StandardCharsets.UTF_8, false); > gen.save("barcode.png", BarCodeImageFormat.PNG); +> BarCodeReader reader = new BarCodeReader("barcode.png", DecodeType.QR); +> for(BarCodeResult result : reader.readBarCodes()) +> System.out.println("BarCode CodeText: " + result.getCodeText()); > ``` -[documentation]: https://docs.aspose.com/barcode/java/how-to-use-insert-bom-parameter/ +[byte order mark _BOM]: https://en.wikipedia.org/wiki/Byte_order_mark#Byte-order_marks_by_encoding +[ECI]: https://en.wikipedia.org/wiki/Extended_Channel_Interpretation **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. | +| insertBOM | boolean | Indicates whether to insert a byte order mark (BOM) when the specified encoding supports it (e.g., UTF-8, UTF-16, UTF-32). If set to true , the BOM is added; if false , the BOM is omitted even if the encoding normally uses one. | ### toString() {#toString--} ``` diff --git a/english/java/com.aspose.barcode.generation/cmykcolor/_index.md b/english/java/com.aspose.barcode.generation/cmykcolor/_index.md index 65de45545..94e73a4a1 100644 --- a/english/java/com.aspose.barcode.generation/cmykcolor/_index.md +++ b/english/java/com.aspose.barcode.generation/cmykcolor/_index.md @@ -30,9 +30,9 @@ Class for CMYK color. Null means CMYK is not used, default RGB color is in use. | Method | Description | | --- | --- | -| [equals(Object arg0)](#equals-java.lang.Object-) | | +| [equals(Object obj)](#equals-java.lang.Object-) | Compares if values of colors are the same | | [getClass()](#getClass--) | | -| [hashCode()](#hashCode--) | | +| [hashCode()](#hashCode--) | Hash code of CMYKColor | | [notify()](#notify--) | | | [notifyAll()](#notifyAll--) | | | [toString()](#toString--) | | @@ -79,21 +79,21 @@ public float Y ``` -### equals(Object arg0) {#equals-java.lang.Object-} +### equals(Object obj) {#equals-java.lang.Object-} ``` -public boolean equals(Object arg0) +public boolean equals(Object obj) ``` - +Compares if values of colors are the same **Parameters:** | Parameter | Type | Description | | --- | --- | --- | -| arg0 | java.lang.Object | | +| obj | java.lang.Object | CMYKColor to compare | **Returns:** -boolean +boolean - Are values the same ### getClass() {#getClass--} ``` public final native Class getClass() @@ -106,14 +106,14 @@ public final native Class getClass() java.lang.Class ### hashCode() {#hashCode--} ``` -public native int hashCode() +public int hashCode() ``` - +Hash code of CMYKColor **Returns:** -int +int - Hash code of CMYKColor ### notify() {#notify--} ``` public final native void notify() diff --git a/english/java/com.aspose.barcode.generation/pdfparameters/_index.md b/english/java/com.aspose.barcode.generation/pdfparameters/_index.md index f3ba1d830..a714a8977 100644 --- a/english/java/com.aspose.barcode.generation/pdfparameters/_index.md +++ b/english/java/com.aspose.barcode.generation/pdfparameters/_index.md @@ -18,20 +18,22 @@ PDF parameters. | Method | Description | | --- | --- | | [equals(Object arg0)](#equals-java.lang.Object-) | | -| [getCMYKBackColor()](#getCMYKBackColor--) | Nullable. | -| [getCMYKBarColor()](#getCMYKBarColor--) | Nullable. | -| [getCMYKCaptionAboveColor()](#getCMYKCaptionAboveColor--) | Nullable. | -| [getCMYKCaptionBelowColor()](#getCMYKCaptionBelowColor--) | Nullable. | -| [getCMYKCodetextColor()](#getCMYKCodetextColor--) | Nullable. | +| [getCMYKBackColor()](#getCMYKBackColor--) | CMYK background color value. | +| [getCMYKBarColor()](#getCMYKBarColor--) | CMYK color value of the barcode. | +| [getCMYKCaptionAboveColor()](#getCMYKCaptionAboveColor--) | CMYK color value for the caption above. | +| [getCMYKCaptionBelowColor()](#getCMYKCaptionBelowColor--) | CMYK color value for the caption below. | +| [getCMYKCodetextColor()](#getCMYKCodetextColor--) | CMYK color value for the codetext. | | [getClass()](#getClass--) | | | [hashCode()](#hashCode--) | | +| [isTextAsPath()](#isTextAsPath--) | Are paths used instead of text (use if Unicode characters are not displayed) Default value: false. | | [notify()](#notify--) | | | [notifyAll()](#notifyAll--) | | -| [setCMYKBackColor(CMYKColor value)](#setCMYKBackColor-com.aspose.barcode.generation.CMYKColor-) | Nullable. | -| [setCMYKBarColor(CMYKColor value)](#setCMYKBarColor-com.aspose.barcode.generation.CMYKColor-) | Nullable. | -| [setCMYKCaptionAboveColor(CMYKColor value)](#setCMYKCaptionAboveColor-com.aspose.barcode.generation.CMYKColor-) | Nullable. | -| [setCMYKCaptionBelowColor(CMYKColor value)](#setCMYKCaptionBelowColor-com.aspose.barcode.generation.CMYKColor-) | Nullable. | -| [setCMYKCodetextColor(CMYKColor value)](#setCMYKCodetextColor-com.aspose.barcode.generation.CMYKColor-) | Nullable. | +| [setCMYKBackColor(CMYKColor value)](#setCMYKBackColor-com.aspose.barcode.generation.CMYKColor-) | CMYK background color value. | +| [setCMYKBarColor(CMYKColor value)](#setCMYKBarColor-com.aspose.barcode.generation.CMYKColor-) | CMYK color value of the barcode. | +| [setCMYKCaptionAboveColor(CMYKColor value)](#setCMYKCaptionAboveColor-com.aspose.barcode.generation.CMYKColor-) | CMYK color value for the caption above. | +| [setCMYKCaptionBelowColor(CMYKColor value)](#setCMYKCaptionBelowColor-com.aspose.barcode.generation.CMYKColor-) | CMYK color value for the caption below. | +| [setCMYKCodetextColor(CMYKColor value)](#setCMYKCodetextColor-com.aspose.barcode.generation.CMYKColor-) | CMYK color value for the codetext. | +| [setTextAsPath(boolean value)](#setTextAsPath-boolean-) | Are paths used instead of text (use if Unicode characters are not displayed) Default value: false. | | [toString()](#toString--) | | | [wait()](#wait--) | | | [wait(long arg0)](#wait-long-) | | @@ -57,7 +59,9 @@ public CMYKColor getCMYKBackColor() ``` -Nullable. CMYK back color value. Null means CMYK color is not used, instead normal RGB color is used. +CMYK background color value. + +If null , CMYK color is not used; RGB color will be used instead. **Returns:** [CMYKColor](../../com.aspose.barcode.generation/cmykcolor) @@ -67,7 +71,9 @@ public CMYKColor getCMYKBarColor() ``` -Nullable. CMYK color value of bar code. Null means CMYK color is not used, instead normal RGB color is used. +CMYK color value of the barcode. + +If null , CMYK color is not used; RGB color will be used instead. **Returns:** [CMYKColor](../../com.aspose.barcode.generation/cmykcolor) @@ -77,7 +83,9 @@ public CMYKColor getCMYKCaptionAboveColor() ``` -Nullable. CMYK color value of caption above. Null means CMYK color is not used, instead normal RGB color is used. +CMYK color value for the caption above. + +If null , CMYK color is not used; RGB color will be used instead. **Returns:** [CMYKColor](../../com.aspose.barcode.generation/cmykcolor) @@ -87,7 +95,9 @@ public CMYKColor getCMYKCaptionBelowColor() ``` -Nullable. CMYK color value of caption below. Null means CMYK color is not used, instead normal RGB color is used. +CMYK color value for the caption below. + +If null , CMYK color is not used; RGB color will be used instead. **Returns:** [CMYKColor](../../com.aspose.barcode.generation/cmykcolor) @@ -97,7 +107,9 @@ public CMYKColor getCMYKCodetextColor() ``` -Nullable. CMYK color value of Codetext. Null means CMYK color is not used, instead normal RGB color is used. +CMYK color value for the codetext. + +If null , CMYK color is not used; RGB color will be used instead. **Returns:** [CMYKColor](../../com.aspose.barcode.generation/cmykcolor) @@ -121,6 +133,16 @@ public native int hashCode() **Returns:** int +### isTextAsPath() {#isTextAsPath--} +``` +public boolean isTextAsPath() +``` + + +Are paths used instead of text (use if Unicode characters are not displayed) Default value: false. + +**Returns:** +boolean ### notify() {#notify--} ``` public final native void notify() @@ -143,7 +165,9 @@ public void setCMYKBackColor(CMYKColor value) ``` -Nullable. CMYK back color value. Null means CMYK color is not used, instead normal RGB color is used. +CMYK background color value. + +If null , CMYK color is not used; RGB color will be used instead. **Parameters:** | Parameter | Type | Description | @@ -156,7 +180,9 @@ public void setCMYKBarColor(CMYKColor value) ``` -Nullable. CMYK color value of bar code. Null means CMYK color is not used, instead normal RGB color is used. +CMYK color value of the barcode. + +If null , CMYK color is not used; RGB color will be used instead. **Parameters:** | Parameter | Type | Description | @@ -169,7 +195,9 @@ public void setCMYKCaptionAboveColor(CMYKColor value) ``` -Nullable. CMYK color value of caption above. Null means CMYK color is not used, instead normal RGB color is used. +CMYK color value for the caption above. + +If null , CMYK color is not used; RGB color will be used instead. **Parameters:** | Parameter | Type | Description | @@ -182,7 +210,9 @@ public void setCMYKCaptionBelowColor(CMYKColor value) ``` -Nullable. CMYK color value of caption below. Null means CMYK color is not used, instead normal RGB color is used. +CMYK color value for the caption below. + +If null , CMYK color is not used; RGB color will be used instead. **Parameters:** | Parameter | Type | Description | @@ -195,13 +225,28 @@ public void setCMYKCodetextColor(CMYKColor value) ``` -Nullable. CMYK color value of Codetext. Null means CMYK color is not used, instead normal RGB color is used. +CMYK color value for the codetext. + +If null , CMYK color is not used; RGB color will be used instead. **Parameters:** | Parameter | Type | Description | | --- | --- | --- | | value | [CMYKColor](../../com.aspose.barcode.generation/cmykcolor) | | +### setTextAsPath(boolean value) {#setTextAsPath-boolean-} +``` +public void setTextAsPath(boolean value) +``` + + +Are paths used instead of text (use if Unicode characters are not displayed) Default value: false. + +**Parameters:** +| Parameter | Type | Description | +| --- | --- | --- | +| value | boolean | | + ### toString() {#toString--} ``` public String toString()