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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ XLS, XLSX, PPTX, DOC, DOCX, MobiXML, JPEG, EMF, PNG, BMP, GIF, TIFF, Text
## Read PDF Formats
MHT, PCL, PS, XSLFO, MD

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

## Bugs fixed in Version 24.5
- Aspose.PDF Cloud Service Throws Bad Gateway Error intermittently.

## Installation

### NPM
Expand Down
28 changes: 28 additions & 0 deletions docs/PdfApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ Method | HTTP request | Description
*PdfApi* | [**postDocumentTextReplace**](PdfApi.md#postDocumentTextReplace) | **POST** /pdf/\{name}/text/replace | Document's replace text method.
*PdfApi* | [**postEncryptDocumentInStorage**](PdfApi.md#postEncryptDocumentInStorage) | **POST** /pdf/\{name}/encrypt | Encrypt document in storage.
*PdfApi* | [**postFlattenDocument**](PdfApi.md#postFlattenDocument) | **POST** /pdf/\{name}/flatten | Flatten the document.
*PdfApi* | [**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.
*PdfApi* | [**postImportFieldsFromFdf**](PdfApi.md#postImportFieldsFromFdf) | **POST** /pdf/\{name}/import/fdf | Update fields from FDF file in request.
*PdfApi* | [**postImportFieldsFromXfdf**](PdfApi.md#postImportFieldsFromXfdf) | **POST** /pdf/\{name}/import/xfdf | Update fields from XFDF file in request.
*PdfApi* | [**postImportFieldsFromXml**](PdfApi.md#postImportFieldsFromXml) | **POST** /pdf/\{name}/import/xml | Update fields from XML file in request.
Expand Down Expand Up @@ -5159,6 +5160,33 @@ Name | Type | Description | Notes
- **Content-Type**: application/json
- **Accept**: application/json

<a name="postHtmlToPdf"></a>
## **postHtmlToPdf**
> postHtmlToPdf(htmlFileName, height, width, isLandscape, marginLeft, marginBottom, marginRight, marginTop)

Convert HTML file (zip archive in request content) to PDF format and return resulting file in response.

### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**htmlFileName** | **string** | Name of HTML file in ZIP. | [optional]
**height** | **number** | Page height | [optional]
**width** | **number** | Page width | [optional]
**isLandscape** | **boolean** | Is page landscaped | [optional]
**marginLeft** | **number** | Page margin left | [optional]
**marginBottom** | **number** | Page margin bottom | [optional]
**marginRight** | **number** | Page margin right | [optional]
**marginTop** | **number** | Page margin top | [optional]

### Return type

**Buffer**

### HTTP request headers

- **Content-Type**: multipart/form-data
- **Accept**: multipart/form-data

<a name="postImportFieldsFromFdf"></a>
## **postImportFieldsFromFdf**
> postImportFieldsFromFdf(name, storage, folder, fdfData)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "asposepdfcloud",
"version": "24.4.0",
"version": "24.5.0",
"description": "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.",
"homepage": "https://products.aspose.cloud/pdf/cloud",
"author": {
Expand Down
75 changes: 75 additions & 0 deletions src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12814,6 +12814,81 @@ export class PdfApi {
}


/**
*
* @summary Convert HTML file (zip archive in request content) to PDF format and return resulting file in response.
* @param htmlFileName Name of HTML file in ZIP.
* @param height Page height
* @param width Page width
* @param isLandscape Is page landscaped
* @param marginLeft Page margin left
* @param marginBottom Page margin bottom
* @param marginRight Page margin right
* @param marginTop Page margin top
*/
public async postHtmlToPdf (htmlFileName?: string, height?: number, width?: number, isLandscape?: boolean, marginLeft?: number, marginBottom?: number, marginRight?: number, marginTop?: number) : Promise<{ response: http.IncomingMessage; body: Buffer; }> {
const localVarPath = this.basePath + '/pdf/create/html';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
let localVarFormParams: any = {};

if (htmlFileName !== undefined && null !== htmlFileName) {
localVarQueryParameters['htmlFileName'] = ObjectSerializer.serialize(htmlFileName, "string");
}

if (height !== undefined && null !== height) {
localVarQueryParameters['height'] = ObjectSerializer.serialize(height, "number");
}

if (width !== undefined && null !== width) {
localVarQueryParameters['width'] = ObjectSerializer.serialize(width, "number");
}

if (isLandscape !== undefined && null !== isLandscape) {
localVarQueryParameters['isLandscape'] = ObjectSerializer.serialize(isLandscape, "boolean");
}

if (marginLeft !== undefined && null !== marginLeft) {
localVarQueryParameters['marginLeft'] = ObjectSerializer.serialize(marginLeft, "number");
}

if (marginBottom !== undefined && null !== marginBottom) {
localVarQueryParameters['marginBottom'] = ObjectSerializer.serialize(marginBottom, "number");
}

if (marginRight !== undefined && null !== marginRight) {
localVarQueryParameters['marginRight'] = ObjectSerializer.serialize(marginRight, "number");
}

if (marginTop !== undefined && null !== marginTop) {
localVarQueryParameters['marginTop'] = ObjectSerializer.serialize(marginTop, "number");
}


let localVarUseFormData = false;
let fileData = null;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
encoding: null,
};

if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData);
const result = ObjectSerializer.deserialize(response.body, "Buffer");
return Promise.resolve({body: result, response});
}


/**
*
* @summary Update fields from FDF file in request.
Expand Down
2 changes: 1 addition & 1 deletion src/requestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function invokeApiMethodInternal(requestOptions: request.Options, confgura
//headers
sa.set("User-Agent", "pdf nodejs sdk");
sa.set("x-aspose-client", "nodejs sdk");
sa.set("x-aspose-client-version", "24.4.0");
sa.set("x-aspose-client-version", "24.5.0");

if (!requestOptions.headers) {
requestOptions.headers = {};
Expand Down