Skip to content

Commit f22b834

Browse files
authored
Merge pull request #72 from aspose-pdf-cloud/develop
update 24.8
2 parents c811b5b + a546a78 commit f22b834

File tree

9 files changed

+492
-23
lines changed

9 files changed

+492
-23
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ XLS, XLSX, PPTX, DOC, DOCX, MobiXML, JPEG, EMF, PNG, BMP, GIF, TIFF, Text
3030
## Read PDF Formats
3131
MHT, PCL, PS, XSLFO, MD
3232

33-
## Enhancements in Version 24.7
33+
## Enhancements in Version 24.8
34+
- Adding Text stamps to multiple pages.
35+
- Adding Image stamps to multiple pages.
3436
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
3537

36-
## Bugs fixed in Version 24.7
37-
- PutPsInStorageToPdf throws: Cannot find resource ‘Aspose.PDF.dependencies.ZapfDingbats.ttf.
38-
- Ocr method is not working.
39-
4038
## Installation
4139
To install the API client library to your local Maven repository, simply execute:
4240

@@ -59,7 +57,7 @@ Add this dependency to your project's POM:
5957
<dependency>
6058
<groupId>com.aspose</groupId>
6159
<artifactId>aspose-cloud-pdf</artifactId>
62-
<version>24.7.0</version>
60+
<version>24.8.0</version>
6361
<scope>compile</scope>
6462
</dependency>
6563
```
@@ -68,7 +66,7 @@ Add this dependency to your project's POM:
6866
Add this dependency to your project's build file:
6967

7068
```groovy
71-
compile "com.aspose:aspose-cloud-pdf:24.7.0"
69+
compile "com.aspose:aspose-cloud-pdf:24.8.0"
7270
```
7371

7472
### Others
@@ -78,7 +76,7 @@ At first generate the JAR by executing:
7876

7977
Then manually install the following JARs:
8078

81-
* target/aspose-cloud-pdf-24.7.0.jar
79+
* target/aspose-cloud-pdf-24.8.0.jar
8280
* target/lib/*.jar
8381

8482
## Getting Started

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ apply plugin: 'idea'
2020
apply plugin: 'eclipse'
2121

2222
group = 'com.aspose'
23-
version = '24.7.0'
23+
version = '24.8.0'
2424

2525
buildscript {
2626
repositories {
@@ -84,7 +84,7 @@ dependencies {
8484
publish {
8585
groupId = 'com.aspose'
8686
artifactId = 'aspose-pdf-cloud'
87-
publishVersion = '24.7.0'
87+
publishVersion = '24.8.0'
8888
desc = 'Aspose.PDF Cloud is a REST API for creating and editing PDF files. Most popular features proposed by Aspose.PDF Cloud: PDF to Word, Convert PDF to Image, Merge PDF, Split PDF, Add Images to PDF, Rotate PDF. It can also be used to convert PDF files to different formats like DOC, HTML, XPS, TIFF and many more. Aspose.PDF Cloud gives you control: create PDFs from scratch or from HTML, XML, template, database, XPS or an image. Render PDFs to image formats such as JPEG, PNG, GIF, BMP, TIFF and many others. Aspose.PDF Cloud helps you manipulate elements of a PDF file like text, annotations, watermarks, signatures, bookmarks, stamps and so on. Its REST API also allows you to manage PDF pages by using features like merging, splitting, and inserting. Add images to a PDF file or convert PDF pages to images.'
8989
licences = ['MIT']
9090
website = 'https://products.aspose.cloud/pdf/cloud'

docs/OptimizeOptions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ Represents Pdf optimize options.
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**password** | **String** | Specifies document password (if any) encoded with base-64. | [optional]
9-
**allowReusePageContent** | **Boolean** | If true page contents will be reused when document is optimized for equal pages. | [optional]
9+
**allowReusePageContent** | **Boolean** | If true page contents will be reused when document is optimized for equal pages. LinkDuplcateStreams option must be set to true. | [optional]
1010
**compressImages** | **Boolean** | If this flag is set to true images will be compressed in the document. Compression level is specified with ImageQuality property. | [optional]
1111
**imageQuality** | **Integer** | Specifies level of image compression when CompressImages flag is used. | [optional]
1212
**linkDuplcateStreams** | **Boolean** | If this flag is set to true, Resource streams will be analyzed. If duplicate streams are found (i.e. if stream contents is equal), then thees streams will be stored as one object. This allows to decrease document size in some cases (for example, when same document was concatenated multiple times). | [optional]
1313
**removeUnusedObjects** | **Boolean** | If this flag is set to true, all document objects will be checked and unused objects (i.e. objects which does not have any reference) are removed from document. | [optional]
1414
**removeUnusedStreams** | **Boolean** | If this flag set to true, every resource is checked on it's usage. If resource is never used, then resources is removed. This may decrease document size for example when pages were extracted from document. | [optional]
15-
**unembedFonts** | **Boolean** | Make fonts not embedded if set to true. | [optional]
15+
**unembedFonts** | **Boolean** | Make fonts not embedded if set to true. Unembedding a font means removing the embedded byte stream data of the font included in a PDF document. | [optional]
1616
**resizeImages** | **Boolean** | If this flag set to true and CompressImages is true images will be resized if image resolution is greater then specified MaxResolution parameter. | [optional]
1717
**maxResolution** | **Integer** | Specifies maximum resolution of images. If image has higher resolution it will be scaled. | [optional]
18-
**subsetFonts** | **Boolean** | Fonts will be converted into subsets if set to true. | [optional]
18+
**subsetFonts** | **Boolean** | Fonts will be converted into subsets if set to true. Only those characters that are actually used in the layout are stored in the PDF. | [optional]
1919
**removePrivateInfo** | **Boolean** | Remove private information (page piece info). | [optional]
2020
**imageEncoding** | [**ImageEncoding**](ImageEncoding.md) | Image encode which will be used. | [optional]
2121
**imageCompressionVersion** | [**ImageCompressionVersion**](ImageCompressionVersion.md) | Version of compression algorithm. Possible values are: "Standard" - standard compression, "Fast" - fast (improved compression which is faster then standard but may be applicable not for all images), "Mixed" - mixed (standard compression is applied to images which can not be compressed by faster algorithm, this may give best compression but more slow then "Fast" algorithm. Version "Fast" is not applicable for resizing images (standard method will be used). Default is "Standard". | [optional]

docs/PdfApi.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,12 @@ Method | HTTP request | Description
203203
[**postDecryptDocumentInStorage**](PdfApi.md#postDecryptDocumentInStorage) | **POST** /pdf/\{name}/decrypt | Decrypt document in storage.
204204
[**postDocumentImageFooter**](PdfApi.md#postDocumentImageFooter) | **POST** /pdf/\{name}/footer/image | Add document image footer.
205205
[**postDocumentImageHeader**](PdfApi.md#postDocumentImageHeader) | **POST** /pdf/\{name}/header/image | Add document image header.
206+
[**postDocumentImageStamps**](PdfApi.md#postDocumentImageStamps) | **POST** /pdf/\{name}/stamps/image | Add document pages image stamps.
206207
[**postDocumentPageNumberStamps**](PdfApi.md#postDocumentPageNumberStamps) | **POST** /pdf/\{name}/stamps/pagenumber | Add document page number stamps.
207208
[**postDocumentTextFooter**](PdfApi.md#postDocumentTextFooter) | **POST** /pdf/\{name}/footer/text | Add document text footer.
208209
[**postDocumentTextHeader**](PdfApi.md#postDocumentTextHeader) | **POST** /pdf/\{name}/header/text | Add document text header.
209210
[**postDocumentTextReplace**](PdfApi.md#postDocumentTextReplace) | **POST** /pdf/\{name}/text/replace | Document&#39;s replace text method.
211+
[**postDocumentTextStamps**](PdfApi.md#postDocumentTextStamps) | **POST** /pdf/\{name}/stamps/text | Add document pages text stamps.
210212
[**postEncryptDocumentInStorage**](PdfApi.md#postEncryptDocumentInStorage) | **POST** /pdf/\{name}/encrypt | Encrypt document in storage.
211213
[**postFlattenDocument**](PdfApi.md#postFlattenDocument) | **POST** /pdf/\{name}/flatten | Flatten the document.
212214
[**postHtmlToPdf**](PdfApi.md#postHtmlToPdf) | **POST** /pdf/create/html | Convert HTML file (zip archive in request content) to PDF format and return resulting file in response.
@@ -5205,6 +5207,31 @@ Name | Type | Description | Notes
52055207

52065208
[**AsposeResponse**](AsposeResponse.md)
52075209

5210+
### HTTP request headers
5211+
5212+
- **Content-Type**: application/json
5213+
- **Accept**: application/json
5214+
5215+
<a name="postDocumentImageStamps"></a>
5216+
# **postDocumentImageStamps**
5217+
> AsposeResponse postDocumentImageStamps(name, stamps, storage, folder, password)
5218+
5219+
Add document pages image stamps.
5220+
5221+
### Parameters
5222+
5223+
Name | Type | Description | Notes
5224+
------------- | ------------- | ------------- | -------------
5225+
**name** | **String**| The document name. |
5226+
**stamps** | [**List&lt;ImageStamp&gt;**](ImageStamp.md)| The array of stamp. |
5227+
**storage** | **String**| The document storage. | [optional]
5228+
**folder** | **String**| The document folder. | [optional]
5229+
**password** | **String**| Base64 encoded password. | [optional]
5230+
5231+
### Return type
5232+
5233+
[**AsposeResponse**](AsposeResponse.md)
5234+
52085235
### HTTP request headers
52095236

52105237
- **Content-Type**: application/json
@@ -5308,6 +5335,31 @@ Name | Type | Description | Notes
53085335

53095336
[**TextReplaceResponse**](TextReplaceResponse.md)
53105337

5338+
### HTTP request headers
5339+
5340+
- **Content-Type**: application/json
5341+
- **Accept**: application/json
5342+
5343+
<a name="postDocumentTextStamps"></a>
5344+
# **postDocumentTextStamps**
5345+
> AsposeResponse postDocumentTextStamps(name, stamps, storage, folder, password)
5346+
5347+
Add document pages text stamps.
5348+
5349+
### Parameters
5350+
5351+
Name | Type | Description | Notes
5352+
------------- | ------------- | ------------- | -------------
5353+
**name** | **String**| The document name. |
5354+
**stamps** | [**List&lt;TextStamp&gt;**](TextStamp.md)| The array of stamp. |
5355+
**storage** | **String**| The document storage. | [optional]
5356+
**folder** | **String**| The document folder. | [optional]
5357+
**password** | **String**| Base64 encoded password. | [optional]
5358+
5359+
### Return type
5360+
5361+
[**AsposeResponse**](AsposeResponse.md)
5362+
53115363
### HTTP request headers
53125364

53135365
- **Content-Type**: application/json

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<artifactId>aspose-pdf-cloud</artifactId>
77
<packaging>jar</packaging>
88
<name>aspose-pdf-cloud</name>
9-
<version>24.7.0</version>
9+
<version>24.8.0</version>
1010
<url>https://www.aspose.cloud/</url>
1111
<description>Aspose.PDF Cloud is a REST API for creating and editing PDF files.
1212
Most popular features proposed by Aspose.PDF Cloud: PDF to Word, Convert PDF to Image, Merge PDF, Split PDF, Add Images to PDF, Rotate PDF.

src/main/java/com/aspose/asposecloudpdf/ApiClient.java

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.google.gson.JsonElement;
2626
import com.google.gson.JsonObject;
2727
import com.google.gson.JsonParser;
28+
import com.google.gson.JsonSyntaxException;
2829
import com.squareup.okhttp.*;
2930
import com.squareup.okhttp.internal.http.HttpMethod;
3031
import com.squareup.okhttp.logging.HttpLoggingInterceptor;
@@ -93,7 +94,7 @@ public ApiClient() {
9394

9495
// Add custom headers
9596
addDefaultHeader("x-aspose-client", "java sdk");
96-
addDefaultHeader("x-aspose-client-version", "24.7.0");
97+
addDefaultHeader("x-aspose-client-version", "24.8.0");
9798

9899
// PDFCLOUD-418 Set default Connect Timeout
99100
setConnectTimeout(5 * 60 * 1000);
@@ -1051,8 +1052,25 @@ public void requestToken() throws ApiException
10511052
.build();
10521053

10531054
Response response = httpClient.newCall(request).execute();
1054-
GetAccessTokenResult result = json.deserialize(response.body().string(), GetAccessTokenResult.class);
1055-
setAccessToken(result.access_token);
1055+
String responseJson = response.body().string();
1056+
try
1057+
{
1058+
GetAccessTokenResult result = json.deserialize(responseJson, GetAccessTokenResult.class);
1059+
if (result == null || result.access_token == null || result.access_token.trim().isEmpty())
1060+
{
1061+
throw new ApiException(String.format("empty token (%s)", responseJson));
1062+
}
1063+
1064+
setAccessToken(result.access_token);
1065+
}
1066+
catch (JsonSyntaxException ex)
1067+
{
1068+
throw new ApiException(responseJson);
1069+
}
1070+
}
1071+
catch (ApiException apiException)
1072+
{
1073+
throw apiException;
10561074
}
10571075
catch (Exception ex)
10581076
{

0 commit comments

Comments
 (0)