Skip to content

Commit 778a143

Browse files
authored
Release 21.3 (#11)
* Release 21.3 * Use request objects * Example in readme updated
1 parent 524f648 commit 778a143

39 files changed

Lines changed: 3052 additions & 4552 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
**/target
1010
build
1111
aspose-barcode-cloud.iml
12+
!tools/*

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ fix:
99

1010
.PHONY: format
1111
format: fix
12-
find ./src -iname "*.java" | xargs java -jar tools/google-java-format-1.8-all-deps.jar --aosp --replace
12+
find ./src -iname "*.java" | xargs java -jar tools/google-java-format-1.9-all-deps.jar --aosp --replace
1313
# Repeat for consistent formatting
14-
find ./src -iname "*.java" | xargs java -jar tools/google-java-format-1.8-all-deps.jar --aosp --replace
14+
find ./src -iname "*.java" | xargs java -jar tools/google-java-format-1.9-all-deps.jar --aosp --replace
1515

1616
.PHONY: format_tests
1717
format_tests:
18-
find $(SRC)/test -iname "*.java" | xargs java -jar tools/google-java-format-1.8-all-deps.jar --aosp --replace
18+
find $(SRC)/test -iname "*.java" | xargs java -jar tools/google-java-format-1.9-all-deps.jar --aosp --replace
1919

2020
.PHONY: test
2121
test:

README.md

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Aspose.BarCode Cloud SDK for Java
22

33
- API version: 3.0
4-
- SDK version: 21.2.0
4+
- SDK version: 21.3.0
55

66
[Aspose.BarCode for Cloud](https://products.aspose.cloud/barcode/cloud) is a REST API for Linear, 2D and postal barcode generation and recognition in the cloud. API recognizes and generates barcode images in a variety of formats. Barcode REST API allows to specify barcode image attributes like image width, height, border style and output image format in order to customize the generation process. Developers can also specify the barcode type and text attributes such as text location and font styles in order to suit the application requirements.
77

@@ -56,7 +56,7 @@ Add this dependency to your project's POM:
5656
<dependency>
5757
<groupId>com.aspose</groupId>
5858
<artifactId>aspose-barcode-cloud</artifactId>
59-
<version>21.2.0</version>
59+
<version>21.3.0</version>
6060
<scope>compile</scope>
6161
</dependency>
6262
```
@@ -71,41 +71,63 @@ mvn clean package
7171

7272
Then manually install the following JARs:
7373

74-
- `target/aspose-barcode-cloud-21.2.0.jar`
74+
- `target/aspose-barcode-cloud-21.3.0.jar`
7575
- `target/lib/*.jar`
7676

7777
## Getting Started
7878

7979
Please follow the [installation](#installation) instruction and execute the following Java code:
8080

8181
```java
82-
import com.aspose.barcode.cloud.*;
83-
import com.aspose.barcode.cloud.auth.*;
84-
import com.aspose.barcode.cloud.model.*;
8582
import com.aspose.barcode.cloud.api.BarcodeApi;
83+
import com.aspose.barcode.cloud.model.BarcodeResponseList;
84+
import com.aspose.barcode.cloud.model.EncodeBarcodeType;
85+
import com.aspose.barcode.cloud.model.PresetType;
86+
import com.aspose.barcode.cloud.requests.GetBarcodeGenerateRequest;
87+
import com.aspose.barcode.cloud.requests.PostBarcodeRecognizeFromUrlOrContentRequest;
8688

8789
import java.io.File;
88-
import java.util.*;
8990

9091
public class BarcodeApiExample {
91-
9292
public static void main(String[] args) {
9393
ApiClient client = new ApiClient(
9494
"Client Id from https://dashboard.aspose.cloud/applications",
9595
"Client Secret from https://dashboard.aspose.cloud/applications"
9696
);
97-
97+
client.setReadTimeout(5 * 60 * 1000);
98+
9899
BarcodeApi api = new BarcodeApi(client);
99-
String type = "type_example"; // String | Type of barcode to generate.
100-
String text = "text_example"; // String | Text to encode.
100+
101101
try {
102-
File result = api.getBarcodeGenerate(type, text);
103-
System.out.println(result);
102+
System.out.println("Generating barcode...");
103+
File barcodeImage = generateBarcode(api);
104+
System.out.println("Barcode image saved to file " + barcodeImage.getAbsolutePath());
105+
106+
System.out.println("Recognizing barcode on image...");
107+
BarcodeResponseList recognized = recognizeBarcode(api, barcodeImage);
108+
System.out.print("Barcode on image:");
109+
System.out.println(recognized.toString());
104110
} catch (ApiException e) {
105-
System.err.println("Exception when calling BarcodeApi#getBarcodeGenerate");
111+
System.err.println("Error");
106112
e.printStackTrace();
107113
}
108114
}
115+
116+
private static File generateBarcode(BarcodeApi api) throws ApiException {
117+
String type = EncodeBarcodeType.PDF417.toString();
118+
String text = "Aspose.BarCode for Cloud Sample";
119+
GetBarcodeGenerateRequest request = new GetBarcodeGenerateRequest(type, text);
120+
121+
return api.getBarcodeGenerate(request);
122+
}
123+
124+
private static BarcodeResponseList recognizeBarcode(BarcodeApi api, File barcodeImage) throws ApiException {
125+
PostBarcodeRecognizeFromUrlOrContentRequest recognizeRequest = new PostBarcodeRecognizeFromUrlOrContentRequest();
126+
recognizeRequest.image = barcodeImage;
127+
recognizeRequest.preset = PresetType.HIGHPERFORMANCE.toString();
128+
129+
return api.postBarcodeRecognizeFromUrlOrContent(recognizeRequest);
130+
}
109131
}
110132
```
111133

@@ -168,6 +190,7 @@ Class | Method | HTTP request | Description
168190
- [CodabarParams](docs/CodabarParams.md)
169191
- [CodabarSymbol](docs/CodabarSymbol.md)
170192
- [CodablockParams](docs/CodablockParams.md)
193+
- [Code128Emulation](docs/Code128Emulation.md)
171194
- [Code16KParams](docs/Code16KParams.md)
172195
- [CodeLocation](docs/CodeLocation.md)
173196
- [CouponParams](docs/CouponParams.md)

docs/Code128Emulation.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
# Code128Emulation
3+
4+
## Enum
5+
6+
7+
* `NONE` (value: `"None"`)
8+
9+
* `CODE903` (value: `"Code903"`)
10+
11+
* `CODE904` (value: `"Code904"`)
12+
13+
* `CODE905` (value: `"Code905"`)
14+
15+
16+

docs/Pdf417Params.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Name | Type | Description | Notes
2323
**macroFileName** | **String** | Macro Pdf417 barcode file name | [optional]
2424
**macroAddressee** | **String** | Macro Pdf417 barcode addressee name | [optional]
2525
**macroECIEncoding** | [**ECIEncodings**](ECIEncodings.md) | Extended Channel Interpretation Identifiers. Applies for Macro PDF417 text fields. | [optional]
26+
**code128Emulation** | [**Code128Emulation**](Code128Emulation.md) | Function codeword for Code 128 emulation. Applied for MicroPDF417 only. Ignored for PDF417 and MacroPDF417 barcodes. | [optional]
2627

2728

2829

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>aspose-barcode-cloud</artifactId>
66
<packaging>jar</packaging>
77
<name>aspose-barcode-cloud</name>
8-
<version>21.2.0</version>
8+
<version>21.3.0</version>
99
<url>https://www.aspose.cloud/</url>
1010
<description>Aspose.BarCode Cloud SDK for Java</description>
1111
<scm>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
sed -n '/^```java/,/^```/ p' < README.md | sed '/^```/ d'

src/main/java/com/aspose/barcode/cloud/ApiClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
public class ApiClient {
6363

6464
public final String apiVersion = "v3.0";
65-
public final String clientVersion = "21.2.0";
65+
public final String clientVersion = "21.3.0";
6666
private String baseUrl = "https://api.aspose.cloud";
6767
private String clientId;
6868
private String clientSecret;
@@ -114,7 +114,7 @@ protected ApiClient() {
114114
json = new JSON();
115115

116116
// Set default User-Agent.
117-
setUserAgent("Swagger-Codegen/21.2.0/java");
117+
setUserAgent("Swagger-Codegen/21.3.0/java");
118118

119119
addDefaultHeader("x-aspose-client", "java sdk");
120120
addDefaultHeader("x-aspose-client-version", clientVersion);

0 commit comments

Comments
 (0)