Skip to content

Commit ce40f5a

Browse files
authored
Merge pull request #77 from aspose-pdf-cloud/develop
update to 24.11
2 parents 2a87262 + cd9dd5f commit ce40f5a

File tree

14 files changed

+383
-10
lines changed

14 files changed

+383
-10
lines changed

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,10 @@ 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
34-
- Develop a method to add XMP metadata.
35-
- Develop a method to obtain XMP metadata in the XML form.
36-
- Develop a method to obtain XMP metadata in the JSON form.
33+
## Enhancements in Version 24.11
34+
- Add DocRecognitionMode EnhancedFlow mode.
3735
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
3836

39-
## Bugs fixed in Version 24.10
40-
- PDF XFA form to Acro from conversion API results corrupt PDF.
41-
4237
## Requirements.
4338
Python 2.7 and 3.4+
4439

asposepdfcloud/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@
262262
from .models.strike_out_annotation_response import StrikeOutAnnotationResponse
263263
from .models.strike_out_annotations import StrikeOutAnnotations
264264
from .models.strike_out_annotations_response import StrikeOutAnnotationsResponse
265+
from .models.svg_images import SvgImages
265266
from .models.table import Table
266267
from .models.table_recognized import TableRecognized
267268
from .models.table_recognized_response import TableRecognizedResponse

asposepdfcloud/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(self, app_key, app_sid, host=None, self_host=False):
8383
self.rest_client = RESTClientObject()
8484
self.default_headers = {}
8585
self.default_headers['x-aspose-client'] = 'python sdk'
86-
self.default_headers['x-aspose-client-version'] = '24.10.0'
86+
self.default_headers['x-aspose-client-version'] = '24.11.0'
8787

8888
self.self_host = self_host
8989
self.app_key = app_key

asposepdfcloud/apis/pdf_api.py

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10612,6 +10612,129 @@ def get_images_with_http_info(self, name, page_number, **kwargs):
1061210612
_request_timeout=params.get('_request_timeout'),
1061310613
collection_formats=collection_formats)
1061410614

10615+
def get_images_extract_svg(self, name, page_number, **kwargs):
10616+
"""
10617+
Extract SVG images from document page.
10618+
This method makes a synchronous HTTP request by default. To make an
10619+
asynchronous HTTP request, please define a `callback` function
10620+
to be invoked when receiving the response.
10621+
>>> def callback_function(response):
10622+
>>> pprint(response)
10623+
>>>
10624+
>>> thread = api.get_images_extract_svg(name, page_number, callback=callback_function)
10625+
10626+
:param callback function: The callback function
10627+
for asynchronous request. (optional)
10628+
:param str name: The document name. (required)
10629+
:param int page_number: The page number. (required)
10630+
:param str storage: The document storage.
10631+
:param str folder: The document folder.
10632+
:param str pass_base64: The password (Base64).
10633+
:return: SvgImages
10634+
If the method is called asynchronously,
10635+
returns the request thread.
10636+
"""
10637+
kwargs['_return_http_data_only'] = True
10638+
if kwargs.get('callback'):
10639+
return self.get_images_extract_svg_with_http_info(name, page_number, **kwargs)
10640+
else:
10641+
(data) = self.get_images_extract_svg_with_http_info(name, page_number, **kwargs)
10642+
return data
10643+
10644+
def get_images_extract_svg_with_http_info(self, name, page_number, **kwargs):
10645+
"""
10646+
Extract SVG images from document page.
10647+
This method makes a synchronous HTTP request by default. To make an
10648+
asynchronous HTTP request, please define a `callback` function
10649+
to be invoked when receiving the response.
10650+
>>> def callback_function(response):
10651+
>>> pprint(response)
10652+
>>>
10653+
>>> thread = api.get_images_extract_svg_with_http_info(name, page_number, callback=callback_function)
10654+
10655+
:param callback function: The callback function
10656+
for asynchronous request. (optional)
10657+
:param str name: The document name. (required)
10658+
:param int page_number: The page number. (required)
10659+
:param str storage: The document storage.
10660+
:param str folder: The document folder.
10661+
:param str pass_base64: The password (Base64).
10662+
:return: SvgImages
10663+
If the method is called asynchronously,
10664+
returns the request thread.
10665+
"""
10666+
10667+
all_params = ['name', 'page_number', 'storage', 'folder', 'pass_base64']
10668+
all_params.append('callback')
10669+
all_params.append('_return_http_data_only')
10670+
all_params.append('_preload_content')
10671+
all_params.append('_request_timeout')
10672+
10673+
params = locals()
10674+
for key, val in iteritems(params['kwargs']):
10675+
if key not in all_params:
10676+
raise TypeError(
10677+
"Got an unexpected keyword argument '%s'"
10678+
" to method get_images_extract_svg" % key
10679+
)
10680+
params[key] = val
10681+
del params['kwargs']
10682+
# verify the required parameter 'name' is set
10683+
if ('name' not in params) or (params['name'] is None):
10684+
raise ValueError("Missing the required parameter `name` when calling `get_images_extract_svg`")
10685+
# verify the required parameter 'page_number' is set
10686+
if ('page_number' not in params) or (params['page_number'] is None):
10687+
raise ValueError("Missing the required parameter `page_number` when calling `get_images_extract_svg`")
10688+
10689+
10690+
collection_formats = {}
10691+
10692+
path_params = {}
10693+
if 'name' in params:
10694+
path_params['name'] = params['name']
10695+
if 'page_number' in params:
10696+
path_params['pageNumber'] = params['page_number']
10697+
10698+
query_params = []
10699+
if 'storage' in params:
10700+
query_params.append(('storage', params['storage']))
10701+
if 'folder' in params:
10702+
query_params.append(('folder', params['folder']))
10703+
if 'pass_base64' in params:
10704+
query_params.append(('passBase64', params['pass_base64']))
10705+
10706+
header_params = {}
10707+
10708+
form_params = []
10709+
local_var_files = {}
10710+
10711+
body_params = None
10712+
# HTTP header `Accept`
10713+
header_params['Accept'] = self.api_client.\
10714+
select_header_accept(['application/json'])
10715+
10716+
# HTTP header `Content-Type`
10717+
header_params['Content-Type'] = self.api_client.\
10718+
select_header_content_type(['application/json'])
10719+
10720+
# Authentication setting
10721+
auth_settings = ['JWT']
10722+
10723+
return self.api_client.call_api('/pdf/{name}/pages/{pageNumber}/images/extract/svg', 'GET',
10724+
path_params,
10725+
query_params,
10726+
header_params,
10727+
body=body_params,
10728+
post_params=form_params,
10729+
files=local_var_files,
10730+
response_type='SvgImages',
10731+
auth_settings=auth_settings,
10732+
callback=params.get('callback'),
10733+
_return_http_data_only=params.get('_return_http_data_only'),
10734+
_preload_content=params.get('_preload_content', True),
10735+
_request_timeout=params.get('_request_timeout'),
10736+
collection_formats=collection_formats)
10737+
1061510738
def get_import_fields_from_fdf_in_storage(self, name, fdf_file_path, **kwargs):
1061610739
"""
1061710740
Update fields from FDF file in storage.

asposepdfcloud/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,5 @@ def to_debug_report(self):
199199
"OS: {env}\n"\
200200
"Python Version: {pyversion}\n"\
201201
"Version of the API: 3.0\n"\
202-
"SDK Package Version: 24.10.0".\
202+
"SDK Package Version: 24.11.0".\
203203
format(env=sys.platform, pyversion=sys.version)

asposepdfcloud/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@
262262
from .strike_out_annotation_response import StrikeOutAnnotationResponse
263263
from .strike_out_annotations import StrikeOutAnnotations
264264
from .strike_out_annotations_response import StrikeOutAnnotationsResponse
265+
from .svg_images import SvgImages
265266
from .table import Table
266267
from .table_recognized import TableRecognized
267268
from .table_recognized_response import TableRecognizedResponse

asposepdfcloud/models/doc_recognition_mode.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class DocRecognitionMode(object):
4444
"""
4545
TEXTBOX = "Textbox"
4646
FLOW = "Flow"
47+
ENHANCEDFLOW = "EnhancedFlow"
4748

4849
"""
4950
Attributes:

asposepdfcloud/models/svg_images.py

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
# coding: utf-8
2+
3+
"""
4+
Aspose.PDF Cloud API Reference
5+
6+
7+
Copyright (c) 2024 Aspose.PDF Cloud
8+
Permission is hereby granted, free of charge, to any person obtaining a copy
9+
of this software and associated documentation files (the "Software"), to deal
10+
in the Software without restriction, including without limitation the rights
11+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
copies of the Software, and to permit persons to whom the Software is
13+
furnished to do so, subject to the following conditions:
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+
24+
25+
26+
OpenAPI spec version: 3.0
27+
28+
"""
29+
30+
31+
from pprint import pformat
32+
from six import iteritems
33+
import re
34+
35+
36+
class SvgImages(object):
37+
"""
38+
NOTE: This class is auto generated by the swagger code generator program.
39+
Do not edit the class manually.
40+
"""
41+
42+
43+
"""
44+
Attributes:
45+
swagger_types (dict): The key is attribute name
46+
and the value is attribute type.
47+
attribute_map (dict): The key is attribute name
48+
and the value is json key in definition.
49+
"""
50+
swagger_types = {
51+
'code': 'int',
52+
'status': 'str',
53+
'list': 'list[str]'
54+
}
55+
56+
attribute_map = {
57+
'code': 'Code',
58+
'status': 'Status',
59+
'list': 'List'
60+
}
61+
62+
def __init__(self, code=None, status=None, list=None):
63+
"""
64+
SvgImages - a model defined in Swagger
65+
"""
66+
67+
self._code = None
68+
self._status = None
69+
self._list = None
70+
71+
self.code = code
72+
if status is not None:
73+
self.status = status
74+
if list is not None:
75+
self.list = list
76+
77+
@property
78+
def code(self):
79+
"""
80+
Gets the code of this SvgImages.
81+
Response status code.
82+
83+
:return: The code of this SvgImages.
84+
:rtype: int
85+
"""
86+
return self._code
87+
88+
@code.setter
89+
def code(self, code):
90+
"""
91+
Sets the code of this SvgImages.
92+
Response status code.
93+
94+
:param code: The code of this SvgImages.
95+
:type: int
96+
"""
97+
if code is None:
98+
raise ValueError("Invalid value for `code`, must not be `None`")
99+
100+
self._code = code
101+
102+
@property
103+
def status(self):
104+
"""
105+
Gets the status of this SvgImages.
106+
Response status.
107+
108+
:return: The status of this SvgImages.
109+
:rtype: str
110+
"""
111+
return self._status
112+
113+
@status.setter
114+
def status(self, status):
115+
"""
116+
Sets the status of this SvgImages.
117+
Response status.
118+
119+
:param status: The status of this SvgImages.
120+
:type: str
121+
"""
122+
123+
self._status = status
124+
125+
@property
126+
def list(self):
127+
"""
128+
Gets the list of this SvgImages.
129+
List of SVG images
130+
131+
:return: The list of this SvgImages.
132+
:rtype: list[str]
133+
"""
134+
return self._list
135+
136+
@list.setter
137+
def list(self, list):
138+
"""
139+
Sets the list of this SvgImages.
140+
List of SVG images
141+
142+
:param list: The list of this SvgImages.
143+
:type: list[str]
144+
"""
145+
146+
self._list = list
147+
148+
def to_dict(self):
149+
"""
150+
Returns the model properties as a dict
151+
"""
152+
result = {}
153+
154+
for attr, _ in iteritems(self.swagger_types):
155+
value = getattr(self, attr)
156+
if isinstance(value, list):
157+
result[attr] = list(map(
158+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
159+
value
160+
))
161+
elif hasattr(value, "to_dict"):
162+
result[attr] = value.to_dict()
163+
elif isinstance(value, dict):
164+
result[attr] = dict(map(
165+
lambda item: (item[0], item[1].to_dict())
166+
if hasattr(item[1], "to_dict") else item,
167+
value.items()
168+
))
169+
else:
170+
result[attr] = value
171+
172+
return result
173+
174+
def to_str(self):
175+
"""
176+
Returns the string representation of the model
177+
"""
178+
return pformat(self.to_dict())
179+
180+
def __repr__(self):
181+
"""
182+
For `print` and `pprint`
183+
"""
184+
return self.to_str()
185+
186+
def __eq__(self, other):
187+
"""
188+
Returns true if both objects are equal
189+
"""
190+
if not isinstance(other, SvgImages):
191+
return False
192+
193+
return self.__dict__ == other.__dict__
194+
195+
def __ne__(self, other):
196+
"""
197+
Returns true if both objects are not equal
198+
"""
199+
return not self == other

docs/DocRecognitionMode.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Value | Description
66
------------ | ------------- | ------------- | -------------
77
**TEXTBOX** | **str** | "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.
88
**FLOW** | **str** | "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.
9+
**ENHANCEDFLOW** | **str** | "EnhancedFlow" | An alternative Flow mode that supports the recognition of tables.
910

1011

1112
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

0 commit comments

Comments
 (0)