Skip to content

Commit 27abd44

Browse files
Merge branch 'master' into release
2 parents 653ea77 + ff258cc commit 27abd44

23 files changed

+1400
-10
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ Python Cloud SDK wraps Aspose.Words Cloud API so you could seamlessly integrate
1616
- [Convert a document to desired file format](https://docs.aspose.cloud/display/wordscloud/Convert+Document+to+Destination+Format+with+Detailed+Settings+and+Save+Result+to+Storage) along with detailed settings.
1717
- Convert an encrypted PDF document into Word document format.
1818

19+
## Enhancements in Version 22.7
20+
21+
- Expand 'AppendDocument' API method to support 'ImageEntryList' for directly appending images to documents and another images.
22+
- Added 'CompressDocument' API method to support compression and resizing images inside the document for reduce the size of the document.
23+
24+
1925
## Enhancements in Version 22.6
2026

2127
- Added 'DeleteBookmark' and 'DeleteBookmarkOnline' API methods for delete bookmarks by name from the document.
232 KB
Binary file not shown.

asposewordscloud/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# import models into sdk package
1313
from asposewordscloud.models.api_error import ApiError
1414
from asposewordscloud.models.available_fonts_response import AvailableFontsResponse
15+
from asposewordscloud.models.base_entry import BaseEntry
1516
from asposewordscloud.models.bmp_save_options_data import BmpSaveOptionsData
1617
from asposewordscloud.models.bookmark import Bookmark
1718
from asposewordscloud.models.bookmark_data import BookmarkData
@@ -35,6 +36,8 @@
3536
from asposewordscloud.models.comment_update import CommentUpdate
3637
from asposewordscloud.models.compare_data import CompareData
3738
from asposewordscloud.models.compare_options import CompareOptions
39+
from asposewordscloud.models.compress_options import CompressOptions
40+
from asposewordscloud.models.compress_response import CompressResponse
3841
from asposewordscloud.models.csv_data_load_options import CsvDataLoadOptions
3942
from asposewordscloud.models.custom_xml_part import CustomXmlPart
4043
from asposewordscloud.models.custom_xml_part_insert import CustomXmlPartInsert
@@ -120,6 +123,8 @@
120123
from asposewordscloud.models.hyperlink_response import HyperlinkResponse
121124
from asposewordscloud.models.hyperlinks import Hyperlinks
122125
from asposewordscloud.models.hyperlinks_response import HyperlinksResponse
126+
from asposewordscloud.models.image_entry import ImageEntry
127+
from asposewordscloud.models.image_entry_list import ImageEntryList
123128
from asposewordscloud.models.info_additional_item import InfoAdditionalItem
124129
from asposewordscloud.models.info_response import InfoResponse
125130
from asposewordscloud.models.jpeg_save_options_data import JpegSaveOptionsData

asposewordscloud/api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
8383

8484
self.pool = None
8585
self.rest_client = rest.RESTClientObject(configuration)
86-
self.default_headers = {'x-aspose-client': 'python sdk', 'x-aspose-version': '22.6'}
86+
self.default_headers = {'x-aspose-client': 'python sdk', 'x-aspose-version': '22.7'}
8787
if header_name is not None:
8888
self.default_headers[header_name] = header_value
8989
self.cookie = cookie
9090
# Set default User-Agent.
91-
self.user_agent = 'python sdk 22.6'
91+
self.user_agent = 'python sdk 22.7'
9292

9393
def __del__(self):
9494
if not self.pool is None:

asposewordscloud/apis/words_api.py

Lines changed: 162 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def append_document(self, request, **kwargs): # noqa: E501
232232

233233
:param is_async bool
234234
:param name str : The filename of the input document. (required)
235-
:param document_list DocumentEntryList : <see cref="DocumentEntryList"/> with a list of documents to append. (required)
235+
:param document_list BaseEntryList : <see cref="BaseEntryList"/> with a list of entries to append. (required)
236236
:param folder str : Original document folder.
237237
:param storage str : Original document storage.
238238
:param load_encoding str : Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
@@ -315,7 +315,7 @@ def append_document_online(self, request, **kwargs): # noqa: E501
315315

316316
:param is_async bool
317317
:param document file : Original document. (required)
318-
:param document_list DocumentEntryList : <see cref="DocumentEntryList"/> with a list of documents to append. (required)
318+
:param document_list BaseEntryList : <see cref="BaseEntryList"/> with a list of entries to append. (required)
319319
:param load_encoding str : Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
320320
:param password str : Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
321321
:param encrypted_password str : Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
@@ -1108,6 +1108,166 @@ def compare_document_online_with_http_info(self, request, **kwargs): # noqa: E5
11081108
_request_timeout=params.get('_request_timeout'),
11091109
collection_formats=http_params['collection_formats']))
11101110

1111+
def compress_document(self, request, **kwargs): # noqa: E501
1112+
"""The default settings allows to reduce the size of the document without any visible degradation of images quality. # noqa: E501
1113+
1114+
This method makes a synchronous HTTP request by default. To make an
1115+
asynchronous HTTP request, please pass is_async=True
1116+
1117+
:param is_async bool
1118+
:param name str : The filename of the input document. (required)
1119+
:param compress_options CompressOptions : Options for compress the document. (required)
1120+
:param folder str : Original document folder.
1121+
:param storage str : Original document storage.
1122+
:param load_encoding str : Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
1123+
:param password str : Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
1124+
:param encrypted_password str : Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
1125+
:param dest_file_name str : Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.
1126+
:return: CompressResponse
1127+
If the method is called asynchronously,
1128+
returns the request thread.
1129+
"""
1130+
try:
1131+
if kwargs.get('is_async'):
1132+
return self.compress_document_with_http_info(request, **kwargs) # noqa: E501
1133+
data = self.compress_document_with_http_info(request, **kwargs) # noqa: E501
1134+
return data
1135+
except ApiException as e:
1136+
if e.status == 401:
1137+
self.api_client.request_token()
1138+
if kwargs.get('is_async'):
1139+
return self.compress_document_with_http_info(request, **kwargs) # noqa: E501
1140+
data = self.compress_document_with_http_info(request, **kwargs) # noqa: E501
1141+
return data
1142+
1143+
def compress_document_with_http_info(self, request, **kwargs): # noqa: E501
1144+
"""The default settings allows to reduce the size of the document without any visible degradation of images quality. # noqa: E501
1145+
1146+
This method makes a synchronous HTTP request by default. To make an
1147+
asynchronous HTTP request, please pass is_async=True
1148+
1149+
:param is_async bool
1150+
:param request CompressDocumentRequest object with parameters
1151+
:return: CompressResponse
1152+
If the method is called asynchronously,
1153+
returns the request thread.
1154+
"""
1155+
1156+
params = locals()
1157+
params['is_async'] = ''
1158+
params['_preload_content'] = True
1159+
params['_request_timeout'] = self.timeout
1160+
for key, val in six.iteritems(params['kwargs']):
1161+
if key not in params:
1162+
raise TypeError(
1163+
"Got an unexpected keyword argument '%s'"
1164+
" to method compress_document" % key
1165+
)
1166+
params[key] = val
1167+
del params['kwargs']
1168+
http_params = request.create_http_request(self.api_client)
1169+
1170+
# HTTP header `Accept`
1171+
http_params['header_params']['Accept'] = self.api_client.select_header_accept(
1172+
['application/xml', 'application/json']) # noqa: E501
1173+
# Authentication setting
1174+
auth_settings = ['JWT'] # noqa: E501
1175+
1176+
self.api_client.handle_password(http_params, self)
1177+
1178+
return request.deserialize_response(self.api_client, self.api_client.call_api(
1179+
http_params['path'],
1180+
http_params['method'],
1181+
http_params['query_params'],
1182+
http_params['header_params'],
1183+
body=http_params['body'],
1184+
post_params=http_params['form_params'],
1185+
response_type=http_params['response_type'], # noqa: E501
1186+
auth_settings=auth_settings,
1187+
is_async=params.get('is_async'),
1188+
_preload_content=params.get('_preload_content', True),
1189+
_request_timeout=params.get('_request_timeout'),
1190+
collection_formats=http_params['collection_formats']))
1191+
1192+
def compress_document_online(self, request, **kwargs): # noqa: E501
1193+
"""Compress and resize images inside the document. # noqa: E501
1194+
1195+
This method makes a synchronous HTTP request by default. To make an
1196+
asynchronous HTTP request, please pass is_async=True
1197+
1198+
:param is_async bool
1199+
:param document file : The document. (required)
1200+
:param compress_options CompressOptions : Options for compress the document. (required)
1201+
:param load_encoding str : Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
1202+
:param password str : Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
1203+
:param encrypted_password str : Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
1204+
:param dest_file_name str : Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.
1205+
:return: CompressDocumentOnlineResponse
1206+
If the method is called asynchronously,
1207+
returns the request thread.
1208+
"""
1209+
try:
1210+
if kwargs.get('is_async'):
1211+
return self.compress_document_online_with_http_info(request, **kwargs) # noqa: E501
1212+
data = self.compress_document_online_with_http_info(request, **kwargs) # noqa: E501
1213+
return data
1214+
except ApiException as e:
1215+
if e.status == 401:
1216+
self.api_client.request_token()
1217+
if kwargs.get('is_async'):
1218+
return self.compress_document_online_with_http_info(request, **kwargs) # noqa: E501
1219+
data = self.compress_document_online_with_http_info(request, **kwargs) # noqa: E501
1220+
return data
1221+
1222+
def compress_document_online_with_http_info(self, request, **kwargs): # noqa: E501
1223+
"""Compress and resize images inside the document. # noqa: E501
1224+
1225+
This method makes a synchronous HTTP request by default. To make an
1226+
asynchronous HTTP request, please pass is_async=True
1227+
1228+
:param is_async bool
1229+
:param request CompressDocumentOnlineRequest object with parameters
1230+
:return: CompressDocumentOnlineResponse
1231+
If the method is called asynchronously,
1232+
returns the request thread.
1233+
"""
1234+
1235+
params = locals()
1236+
params['is_async'] = ''
1237+
params['_preload_content'] = True
1238+
params['_request_timeout'] = self.timeout
1239+
for key, val in six.iteritems(params['kwargs']):
1240+
if key not in params:
1241+
raise TypeError(
1242+
"Got an unexpected keyword argument '%s'"
1243+
" to method compress_document_online" % key
1244+
)
1245+
params[key] = val
1246+
del params['kwargs']
1247+
http_params = request.create_http_request(self.api_client)
1248+
1249+
# HTTP header `Accept`
1250+
http_params['header_params']['Accept'] = self.api_client.select_header_accept(
1251+
['application/xml', 'application/json']) # noqa: E501
1252+
# Authentication setting
1253+
auth_settings = ['JWT'] # noqa: E501
1254+
1255+
self.api_client.handle_password(http_params, self)
1256+
1257+
return request.deserialize_response(self.api_client, self.api_client.call_api(
1258+
http_params['path'],
1259+
http_params['method'],
1260+
http_params['query_params'],
1261+
http_params['header_params'],
1262+
body=http_params['body'],
1263+
post_params=http_params['form_params'],
1264+
response_type=http_params['response_type'], # noqa: E501
1265+
auth_settings=auth_settings,
1266+
is_async=params.get('is_async'),
1267+
_preload_content=params.get('_preload_content', True),
1268+
_request_timeout=params.get('_request_timeout'),
1269+
collection_formats=http_params['collection_formats']))
1270+
11111271
def convert_document(self, request, **kwargs): # noqa: E501
11121272
"""Converts a document on a local drive to the specified format. # noqa: E501
11131273

asposewordscloud/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,6 @@ def to_debug_report(self):
262262
return "Python SDK Debug Report:\n"\
263263
"OS: {env}\n"\
264264
"Python Version: {pyversion}\n"\
265-
"Version of the API: 22.6\n"\
266-
"SDK Package Version: 22.6".\
265+
"Version of the API: 22.7\n"\
266+
"SDK Package Version: 22.7".\
267267
format(env=sys.platform, pyversion=sys.version)

asposewordscloud/models/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# import models into model package
88
from asposewordscloud.models.api_error import ApiError
99
from asposewordscloud.models.available_fonts_response import AvailableFontsResponse
10+
from asposewordscloud.models.base_entry import BaseEntry
1011
from asposewordscloud.models.bmp_save_options_data import BmpSaveOptionsData
1112
from asposewordscloud.models.bookmark import Bookmark
1213
from asposewordscloud.models.bookmark_data import BookmarkData
@@ -30,6 +31,8 @@
3031
from asposewordscloud.models.comment_update import CommentUpdate
3132
from asposewordscloud.models.compare_data import CompareData
3233
from asposewordscloud.models.compare_options import CompareOptions
34+
from asposewordscloud.models.compress_options import CompressOptions
35+
from asposewordscloud.models.compress_response import CompressResponse
3336
from asposewordscloud.models.csv_data_load_options import CsvDataLoadOptions
3437
from asposewordscloud.models.custom_xml_part import CustomXmlPart
3538
from asposewordscloud.models.custom_xml_part_insert import CustomXmlPartInsert
@@ -115,6 +118,8 @@
115118
from asposewordscloud.models.hyperlink_response import HyperlinkResponse
116119
from asposewordscloud.models.hyperlinks import Hyperlinks
117120
from asposewordscloud.models.hyperlinks_response import HyperlinksResponse
121+
from asposewordscloud.models.image_entry import ImageEntry
122+
from asposewordscloud.models.image_entry_list import ImageEntryList
118123
from asposewordscloud.models.info_additional_item import InfoAdditionalItem
119124
from asposewordscloud.models.info_response import InfoResponse
120125
from asposewordscloud.models.jpeg_save_options_data import JpegSaveOptionsData

0 commit comments

Comments
 (0)