Skip to content

Commit 984d909

Browse files
update to 24.11
1 parent 0be9e44 commit 984d909

12 files changed

+168
-69
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ 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.10
33+
## Enhancements in Version 24.11
3434
- Develop DeleteDocumentLayer Method.
3535
- Develop GetDocumentLayers Method.
3636
- How to extract PDF layer elements and create a new PDF

docs/DocRecognitionMode.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Allows to control how a PDF document is converted into a word processing documen
44
## Enum
55
Name | Type | Value | Description
66
------------ | ------------- | ------------- | -------------
7+
**EnhancedFlow** | **string** | 'EnhancedFlow' | An alternative Flow mode that supports the recognition of tables.
78
**Flow** | **string** | 'Flow' | Full recognition mode, the engine performs grouping and multi-level analysis to restore the original document author's intent and produce a maximally editable document. The downside is that the output document might look different from the original PDF file.
89
**Textbox** | **string** | 'Textbox' | This mode is fast and good for maximally preserving original look of the PDF file, but editability of the resulting document could be limited.Every visually grouped block of text int the original PDF file is converted into a textbox in the resulting document. This achieves maximal resemblance of the output document to the original PDF file. The output document will look good, but it will consist entirely of textboxes and it could makes further editing of the document in Microsoft Word quite hard.This is the default mode.
910

docs/PdfApi.md

+25
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Method | HTTP request | Description
9595
*PdfApi* | [**getImageExtractAsPng**](PdfApi.md#getImageExtractAsPng) | **GET** /pdf/\{name}/images/\{imageId}/extract/png | Extract document image in PNG format
9696
*PdfApi* | [**getImageExtractAsTiff**](PdfApi.md#getImageExtractAsTiff) | **GET** /pdf/\{name}/images/\{imageId}/extract/tiff | Extract document image in TIFF format
9797
*PdfApi* | [**getImages**](PdfApi.md#getImages) | **GET** /pdf/\{name}/pages/\{pageNumber}/images | Read document images.
98+
*PdfApi* | [**getImagesExtractSvg**](PdfApi.md#getImagesExtractSvg) | **GET** /pdf/\{name}/pages/\{pageNumber}/images/extract/svg | Extract SVG images from document page.
9899
*PdfApi* | [**getImportFieldsFromFdfInStorage**](PdfApi.md#getImportFieldsFromFdfInStorage) | **GET** /pdf/\{name}/import/fdf | Update fields from FDF file in storage.
99100
*PdfApi* | [**getImportFieldsFromXfdfInStorage**](PdfApi.md#getImportFieldsFromXfdfInStorage) | **GET** /pdf/\{name}/import/xfdf | Update fields from XFDF file in storage.
100101
*PdfApi* | [**getImportFieldsFromXmlInStorage**](PdfApi.md#getImportFieldsFromXmlInStorage) | **GET** /pdf/\{name}/import/xml | Import from XML file (located on storage) to PDF format and return resulting file in response.
@@ -2437,6 +2438,30 @@ Name | Type | Description | Notes
24372438

24382439
[**ImagesResponse**](ImagesResponse.md)
24392440

2441+
### HTTP request headers
2442+
2443+
- **Content-Type**: application/json
2444+
- **Accept**: application/json
2445+
2446+
<a name="getImagesExtractSvg"></a>
2447+
## **getImagesExtractSvg**
2448+
> getImagesExtractSvg(name, pageNumber, storage, folder, passBase64)
2449+
2450+
Extract SVG images from document page.
2451+
2452+
### Parameters
2453+
Name | Type | Description | Notes
2454+
------------- | ------------- | ------------- | -------------
2455+
**name** | **string** | The document name. |
2456+
**pageNumber** | **number** | The page number. |
2457+
**storage** | **string** | The document storage. | [optional]
2458+
**folder** | **string** | The document folder. | [optional]
2459+
**passBase64** | **string** | The password (Base64). | [optional]
2460+
2461+
### Return type
2462+
2463+
[**SvgImages**](SvgImages.md)
2464+
24402465
### HTTP request headers
24412466

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

docs/SvgImages.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SvgImages
2+
SvgImages class
3+
4+
*Inherited from [AsposeResponse](AsposeResponse.md)*
5+
## Properties
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**list** | **Array&lt;string&gt;** | List of SVG images | [optional]
9+
**code** | **number** | Response status code.<br />*Inherited from [AsposeResponse](AsposeResponse.md)* |
10+
**status** | **string** | Response status.<br />*Inherited from [AsposeResponse](AsposeResponse.md)* | [optional]
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[View Source]](../src/models/svgImages.ts)
13+

src/api/api.ts

+65
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ import { StampsInfoResponse } from "../models/stampsInfoResponse";
250250
import { StrikeOutAnnotationResponse } from "../models/strikeOutAnnotationResponse";
251251
import { StrikeOutAnnotations } from "../models/strikeOutAnnotations";
252252
import { StrikeOutAnnotationsResponse } from "../models/strikeOutAnnotationsResponse";
253+
import { SvgImages } from "../models/svgImages";
253254
import { Table } from "../models/table";
254255
import { TableRecognized } from "../models/tableRecognized";
255256
import { TableRecognizedResponse } from "../models/tableRecognizedResponse";
@@ -5503,6 +5504,70 @@ export class PdfApi {
55035504
}
55045505

55055506

5507+
/**
5508+
*
5509+
* @summary Extract SVG images from document page.
5510+
* @param name The document name.
5511+
* @param pageNumber The page number.
5512+
* @param storage The document storage.
5513+
* @param folder The document folder.
5514+
* @param passBase64 The password (Base64).
5515+
*/
5516+
public async getImagesExtractSvg (name: string, pageNumber: number, storage?: string, folder?: string, passBase64?: string) : Promise<{ response: http.IncomingMessage; body: SvgImages; }> {
5517+
const localVarPath = this.basePath + '/pdf/{name}/pages/{pageNumber}/images/extract/svg'
5518+
.replace('{' + 'name' + '}', encodeURIComponent(String(name)).replace('%2F', '/'))
5519+
.replace('{' + 'pageNumber' + '}', encodeURIComponent(String(pageNumber)).replace('%2F', '/'));
5520+
let localVarQueryParameters: any = {};
5521+
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
5522+
let localVarFormParams: any = {};
5523+
5524+
// verify required parameter 'name' is not null or undefined
5525+
if (name === null || name === undefined) {
5526+
throw new Error('Required parameter name was null or undefined when calling getImagesExtractSvg.');
5527+
}
5528+
5529+
// verify required parameter 'pageNumber' is not null or undefined
5530+
if (pageNumber === null || pageNumber === undefined) {
5531+
throw new Error('Required parameter pageNumber was null or undefined when calling getImagesExtractSvg.');
5532+
}
5533+
5534+
if (storage !== undefined && null !== storage) {
5535+
localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string");
5536+
}
5537+
5538+
if (folder !== undefined && null !== folder) {
5539+
localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string");
5540+
}
5541+
5542+
if (passBase64 !== undefined && null !== passBase64) {
5543+
localVarQueryParameters['passBase64'] = ObjectSerializer.serialize(passBase64, "string");
5544+
}
5545+
5546+
5547+
let localVarUseFormData = false;
5548+
let fileData = null;
5549+
let localVarRequestOptions: localVarRequest.Options = {
5550+
method: 'GET',
5551+
qs: localVarQueryParameters,
5552+
headers: localVarHeaderParams,
5553+
uri: localVarPath,
5554+
useQuerystring: this._useQuerystring,
5555+
json: true,
5556+
};
5557+
5558+
if (Object.keys(localVarFormParams).length) {
5559+
if (localVarUseFormData) {
5560+
(<any>localVarRequestOptions).formData = localVarFormParams;
5561+
} else {
5562+
localVarRequestOptions.form = localVarFormParams;
5563+
}
5564+
}
5565+
const response = await invokeApiMethod(localVarRequestOptions, this.configuration, false, fileData);
5566+
const result = ObjectSerializer.deserialize(response.body, "SvgImages");
5567+
return Promise.resolve({body: result, response});
5568+
}
5569+
5570+
55065571
/**
55075572
*
55085573
* @summary Update fields from FDF file in storage.

src/models/docRecognitionMode.ts

+1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@
2222
export enum DocRecognitionMode {
2323
Textbox = 'Textbox',
2424
Flow = 'Flow',
25+
EnhancedFlow = 'EnhancedFlow',
2526
}

src/models/svgImages.ts

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
 /**
2+
*
3+
* Copyright (c) 2024 Aspose.PDF Cloud
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
* The above copyright notice and this permission notice shall be included in all
11+
* copies or substantial portions of the Software.
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
18+
* SOFTWARE.
19+
*
20+
*/
21+
22+
import { AsposeResponse } from "./asposeResponse";
23+
24+
/**
25+
* SvgImages class
26+
*/
27+
export class SvgImages extends AsposeResponse {
28+
/**
29+
* List of SVG images
30+
*/
31+
'list': Array<string>;
32+
33+
static discriminator = undefined;
34+
35+
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
36+
{
37+
"name": "list",
38+
"baseName": "List",
39+
"type": "Array<string>"
40+
} ];
41+
42+
static getAttributeTypeMap() {
43+
return super.getAttributeTypeMap().concat(SvgImages.attributeTypeMap);
44+
}
45+
}
46+
47+

src/objectSerializer.ts

+2
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ import { StampsInfoResponse } from "./models/stampsInfoResponse";
250250
import { StrikeOutAnnotationResponse } from "./models/strikeOutAnnotationResponse";
251251
import { StrikeOutAnnotations } from "./models/strikeOutAnnotations";
252252
import { StrikeOutAnnotationsResponse } from "./models/strikeOutAnnotationsResponse";
253+
import { SvgImages } from "./models/svgImages";
253254
import { Table } from "./models/table";
254255
import { TableRecognized } from "./models/tableRecognized";
255256
import { TableRecognizedResponse } from "./models/tableRecognizedResponse";
@@ -544,6 +545,7 @@ let typeMap: {[index: string]: any} = {
544545
"StrikeOutAnnotationResponse": StrikeOutAnnotationResponse,
545546
"StrikeOutAnnotations": StrikeOutAnnotations,
546547
"StrikeOutAnnotationsResponse": StrikeOutAnnotationsResponse,
548+
"SvgImages": SvgImages,
547549
"Table": Table,
548550
"TableRecognized": TableRecognized,
549551
"TableRecognizedResponse": TableRecognizedResponse,

src/requestHelper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async function invokeApiMethodInternal(requestOptions: request.Options, confgura
9595
//headers
9696
sa.set("User-Agent", "pdf nodejs sdk");
9797
sa.set("x-aspose-client", "nodejs sdk");
98-
sa.set("x-aspose-client-version", "24.10.0");
98+
sa.set("x-aspose-client-version", "24.11.0");
9999

100100
if (!requestOptions.headers) {
101101
requestOptions.headers = {};

test/testImages.ts

+12
Original file line numberDiff line numberDiff line change
@@ -273,5 +273,17 @@ describe("Images Tests", () => {
273273
});
274274
});
275275
});
276+
277+
describe("GetImagesExtractAsSvg Test", () => {
278+
279+
it("should return response with code 200", async () => {
280+
281+
return BaseTest.getPdfApi().getImagesExtractSvg("Alfa.pdf", pageNumber, null, BaseTest.remoteTempFolder, null)
282+
.then((result) => {
283+
assert.equal(result.response.statusCode, 200);
284+
assert.equal(13, result.body.list.length);
285+
});
286+
});
287+
});
276288
});
277289
});

testData/alfa.pdf

290 KB
Binary file not shown.

useCases/textDeletejs

-67
This file was deleted.

0 commit comments

Comments
 (0)