Skip to content

Commit ac9fade

Browse files
update to 24.5
1 parent 7c4d54e commit ac9fade

File tree

5 files changed

+210
-6
lines changed

5 files changed

+210
-6
lines changed

README.md

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

32-
## Enhancements in Version 24.4
33-
- Convert PDF to optimized Text.
34-
- Convert PDF to EXCEL without Cloud Storage.
32+
## Enhancements in Version 24.5
3533
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
3634

35+
## Bugs fixed in Version 24.5
36+
- Aspose.PDF Cloud Service Throws Bad Gateway Error intermittently.
37+
3738
## Requirements
3839
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
3940

sdk/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.4.0'
23+
version = '24.5.0'
2424

2525
buildscript {
2626
repositories {
@@ -100,7 +100,7 @@ dependencies {
100100
publish {
101101
groupId = 'com.aspose'
102102
artifactId = 'aspose-cloud-pdf-android'
103-
publishVersion = '24.4.0'
103+
publishVersion = '24.5.0'
104104
desc = 'Aspose.PDF Cloud is a REST API for creating and editing PDF files. 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.'
105105
licences = ['MIT']
106106
website = 'https://products.aspose.cloud/pdf/cloud'

sdk/docs/PdfApi.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ Method | HTTP request | Description
209209
[**postDocumentTextReplace**](PdfApi.md#postDocumentTextReplace) | **POST** /pdf/\{name}/text/replace | Document's replace text method.
210210
[**postEncryptDocumentInStorage**](PdfApi.md#postEncryptDocumentInStorage) | **POST** /pdf/\{name}/encrypt | Encrypt document in storage.
211211
[**postFlattenDocument**](PdfApi.md#postFlattenDocument) | **POST** /pdf/\{name}/flatten | Flatten the document.
212+
[**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.
212213
[**postImportFieldsFromFdf**](PdfApi.md#postImportFieldsFromFdf) | **POST** /pdf/\{name}/import/fdf | Update fields from FDF file in request.
213214
[**postImportFieldsFromXfdf**](PdfApi.md#postImportFieldsFromXfdf) | **POST** /pdf/\{name}/import/xfdf | Update fields from XFDF file in request.
214215
[**postImportFieldsFromXml**](PdfApi.md#postImportFieldsFromXml) | **POST** /pdf/\{name}/import/xml | Update fields from XML file in request.
@@ -5366,6 +5367,34 @@ Name | Type | Description | Notes
53665367
- **Content-Type**: application/json
53675368
- **Accept**: application/json
53685369

5370+
<a name="postHtmlToPdf"></a>
5371+
# **postHtmlToPdf**
5372+
> File postHtmlToPdf(htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop)
5373+
5374+
Convert HTML file (zip archive in request content) to PDF format and return resulting file in response.
5375+
5376+
### Parameters
5377+
5378+
Name | Type | Description | Notes
5379+
------------- | ------------- | ------------- | -------------
5380+
**htmlFileName** | **String**| Name of HTML file in ZIP. | [optional]
5381+
**height** | **Double**| Page height | [optional]
5382+
**width** | **Double**| Page width | [optional]
5383+
**isLandscape** | **Boolean**| Is page landscaped | [optional]
5384+
**marginLeft** | **Double**| Page margin left | [optional]
5385+
**marginBottom** | **Double**| Page margin bottom | [optional]
5386+
**marginRight** | **Double**| Page margin right | [optional]
5387+
**marginTop** | **Double**| Page margin top | [optional]
5388+
5389+
### Return type
5390+
5391+
**File**
5392+
5393+
### HTTP request headers
5394+
5395+
- **Content-Type**: application/octet-stream
5396+
- **Accept**: multipart/form-data
5397+
53695398
<a name="postImportFieldsFromFdf"></a>
53705399
# **postImportFieldsFromFdf**
53715400
> AsposeResponse postImportFieldsFromFdf(name, storage, folder, fdfData)

sdk/src/main/java/com/aspose/asposecloudpdfandroid/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public ApiClient() {
9393

9494
// Add custom headers
9595
addDefaultHeader("x-aspose-client", "android sdk");
96-
addDefaultHeader("x-aspose-client-version", "24.4.0");
96+
addDefaultHeader("x-aspose-client-version", "24.5.0");
9797

9898
// PDFCLOUD-418 Set default Connect Timeout
9999
setConnectTimeout(5 * 60 * 1000);

sdk/src/main/java/com/aspose/asposecloudpdfandroid/api/PdfApi.java

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32781,6 +32781,180 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don
3278132781
apiClient.executeAsync(call, localVarReturnType, callback);
3278232782
return call;
3278332783
}
32784+
/**
32785+
* Build call for postHtmlToPdf
32786+
* @param htmlFileName Name of HTML file in ZIP. (optional)
32787+
* @param height Page height (optional)
32788+
* @param width Page width (optional)
32789+
* @param isLandscape Is page landscaped (optional)
32790+
* @param marginLeft Page margin left (optional)
32791+
* @param marginBottom Page margin bottom (optional)
32792+
* @param marginRight Page margin right (optional)
32793+
* @param marginTop Page margin top (optional)
32794+
* @param progressListener Progress listener
32795+
* @param progressRequestListener Progress request listener
32796+
* @return Call to execute
32797+
* @throws ApiException If fail to serialize the request body object
32798+
*/
32799+
public com.squareup.okhttp.Call postHtmlToPdfCall(String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
32800+
Object localVarPostBody = null;
32801+
32802+
// create path and map variables
32803+
String localVarPath = "/pdf/create/html";
32804+
32805+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
32806+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
32807+
if (htmlFileName != null)
32808+
localVarQueryParams.addAll(apiClient.parameterToPair("htmlFileName", htmlFileName));
32809+
if (height != null)
32810+
localVarQueryParams.addAll(apiClient.parameterToPair("height", height));
32811+
if (width != null)
32812+
localVarQueryParams.addAll(apiClient.parameterToPair("width", width));
32813+
if (isLandscape != null)
32814+
localVarQueryParams.addAll(apiClient.parameterToPair("isLandscape", isLandscape));
32815+
if (marginLeft != null)
32816+
localVarQueryParams.addAll(apiClient.parameterToPair("marginLeft", marginLeft));
32817+
if (marginBottom != null)
32818+
localVarQueryParams.addAll(apiClient.parameterToPair("marginBottom", marginBottom));
32819+
if (marginRight != null)
32820+
localVarQueryParams.addAll(apiClient.parameterToPair("marginRight", marginRight));
32821+
if (marginTop != null)
32822+
localVarQueryParams.addAll(apiClient.parameterToPair("marginTop", marginTop));
32823+
32824+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
32825+
32826+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
32827+
32828+
final String[] localVarAccepts = {
32829+
"multipart/form-data"
32830+
};
32831+
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
32832+
if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept);
32833+
32834+
final String[] localVarContentTypes = {
32835+
"application/octet-stream"
32836+
};
32837+
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
32838+
localVarHeaderParams.put("Content-Type", localVarContentType);
32839+
32840+
if(progressListener != null) {
32841+
apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {
32842+
@Override
32843+
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {
32844+
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
32845+
return originalResponse.newBuilder()
32846+
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
32847+
.build();
32848+
}
32849+
});
32850+
}
32851+
32852+
String[] localVarAuthNames = new String[] { "JWT" };
32853+
return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);
32854+
}
32855+
32856+
@SuppressWarnings("rawtypes")
32857+
private com.squareup.okhttp.Call postHtmlToPdfValidateBeforeCall(String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {
32858+
32859+
32860+
com.squareup.okhttp.Call call = postHtmlToPdfCall(htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, progressListener, progressRequestListener);
32861+
return call;
32862+
32863+
}
32864+
32865+
/**
32866+
* Convert HTML file (zip archive in request content) to PDF format and return resulting file in response.
32867+
*
32868+
* @param htmlFileName Name of HTML file in ZIP. (optional)
32869+
* @param height Page height (optional)
32870+
* @param width Page width (optional)
32871+
* @param isLandscape Is page landscaped (optional)
32872+
* @param marginLeft Page margin left (optional)
32873+
* @param marginBottom Page margin bottom (optional)
32874+
* @param marginRight Page margin right (optional)
32875+
* @param marginTop Page margin top (optional)
32876+
* @return File
32877+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
32878+
*/
32879+
public File postHtmlToPdf(String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop) throws ApiException {
32880+
try
32881+
{
32882+
ApiResponse<File> resp = postHtmlToPdfWithHttpInfo(htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop);
32883+
return resp.getData();
32884+
}
32885+
catch (ApiException ex)
32886+
{
32887+
if (ex.getCode() == 401)
32888+
{
32889+
apiClient.requestToken();
32890+
ApiResponse<File> resp = postHtmlToPdfWithHttpInfo(htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop);
32891+
return resp.getData();
32892+
}
32893+
throw ex;
32894+
}
32895+
}
32896+
32897+
/**
32898+
* Convert HTML file (zip archive in request content) to PDF format and return resulting file in response.
32899+
*
32900+
* @param htmlFileName Name of HTML file in ZIP. (optional)
32901+
* @param height Page height (optional)
32902+
* @param width Page width (optional)
32903+
* @param isLandscape Is page landscaped (optional)
32904+
* @param marginLeft Page margin left (optional)
32905+
* @param marginBottom Page margin bottom (optional)
32906+
* @param marginRight Page margin right (optional)
32907+
* @param marginTop Page margin top (optional)
32908+
* @return ApiResponse&lt;File&gt;
32909+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
32910+
*/
32911+
public ApiResponse<File> postHtmlToPdfWithHttpInfo(String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop) throws ApiException {
32912+
com.squareup.okhttp.Call call = postHtmlToPdfValidateBeforeCall(htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, null, null);
32913+
Type localVarReturnType = new TypeToken<File>(){}.getType();
32914+
return apiClient.execute(call, localVarReturnType);
32915+
}
32916+
32917+
/**
32918+
* Convert HTML file (zip archive in request content) to PDF format and return resulting file in response. (asynchronously)
32919+
*
32920+
* @param htmlFileName Name of HTML file in ZIP. (optional)
32921+
* @param height Page height (optional)
32922+
* @param width Page width (optional)
32923+
* @param isLandscape Is page landscaped (optional)
32924+
* @param marginLeft Page margin left (optional)
32925+
* @param marginBottom Page margin bottom (optional)
32926+
* @param marginRight Page margin right (optional)
32927+
* @param marginTop Page margin top (optional)
32928+
* @param callback The callback to be executed when the API call finishes
32929+
* @return The request call
32930+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
32931+
*/
32932+
public com.squareup.okhttp.Call postHtmlToPdfAsync(String htmlFileName, Double height, Double width, Boolean isLandscape, Double marginLeft, Double marginBottom, Double marginRight, Double marginTop, final ApiCallback<File> callback) throws ApiException {
32933+
32934+
ProgressResponseBody.ProgressListener progressListener = null;
32935+
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
32936+
32937+
if (callback != null) {
32938+
progressListener = new ProgressResponseBody.ProgressListener() {
32939+
@Override
32940+
public void update(long bytesRead, long contentLength, boolean done) {
32941+
callback.onDownloadProgress(bytesRead, contentLength, done);
32942+
}
32943+
};
32944+
32945+
progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {
32946+
@Override
32947+
public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {
32948+
callback.onUploadProgress(bytesWritten, contentLength, done);
32949+
}
32950+
};
32951+
}
32952+
32953+
com.squareup.okhttp.Call call = postHtmlToPdfValidateBeforeCall(htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop, progressListener, progressRequestListener);
32954+
Type localVarReturnType = new TypeToken<File>(){}.getType();
32955+
apiClient.executeAsync(call, localVarReturnType, callback);
32956+
return call;
32957+
}
3278432958
/**
3278532959
* Build call for postImportFieldsFromFdf
3278632960
* @param name The document name. (required)

0 commit comments

Comments
 (0)