Skip to content

Commit e31093b

Browse files
authored
Merge pull request #114 from aspose-pdf-cloud/develop
update to 25.8
2 parents 92db167 + dc21faf commit e31093b

File tree

7 files changed

+182
-7
lines changed

7 files changed

+182
-7
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ 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 25.7
34-
- Add possibility to hide subject field in signature appearance.
33+
## Enhancements in Version 25.8
34+
- Implement document page resize functionality using the Pdf.Cloud API library.
3535
- A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET.
3636

37-
## Bugs fixed in Version 25.7
38-
- PostDeleteStamps removing stamps from PDF page is incorrect.
37+
## Bugs fixed in Version 25.8
38+
- Implement delete watermark from PDF document using the Pdf.Cloud API library.
3939

4040
## Requirements.
4141
Python 2.7 and 3.4+

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'] = '25.7.0'
86+
self.default_headers['x-aspose-client-version'] = '25.8.0'
8787

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

asposepdfcloud/apis/pdf_api.py

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24907,6 +24907,143 @@ def post_document_page_number_stamps_with_http_info(self, name, stamp, **kwargs)
2490724907
_request_timeout=params.get('_request_timeout'),
2490824908
collection_formats=collection_formats)
2490924909

24910+
def post_document_pages_resize(self, name, height, width, pages, **kwargs):
24911+
"""
24912+
Rsize PDF document.
24913+
This method makes a synchronous HTTP request by default. To make an
24914+
asynchronous HTTP request, please define a `callback` function
24915+
to be invoked when receiving the response.
24916+
>>> def callback_function(response):
24917+
>>> pprint(response)
24918+
>>>
24919+
>>> thread = api.post_document_pages_resize(name, height, width, pages, callback=callback_function)
24920+
24921+
:param callback function: The callback function
24922+
for asynchronous request. (optional)
24923+
:param str name: The document name. (required)
24924+
:param float height: Page Height (required)
24925+
:param float width: Page width (required)
24926+
:param str pages: Comma separated list of pages and page ranges. (Example: 1,3-5,8) (required)
24927+
:param str storage: The document storage.
24928+
:param str folder: The document folder.
24929+
:param str password: Base64 encoded password.
24930+
:return: AsposeResponse
24931+
If the method is called asynchronously,
24932+
returns the request thread.
24933+
"""
24934+
kwargs['_return_http_data_only'] = True
24935+
if kwargs.get('callback'):
24936+
return self.post_document_pages_resize_with_http_info(name, height, width, pages, **kwargs)
24937+
else:
24938+
(data) = self.post_document_pages_resize_with_http_info(name, height, width, pages, **kwargs)
24939+
return data
24940+
24941+
def post_document_pages_resize_with_http_info(self, name, height, width, pages, **kwargs):
24942+
"""
24943+
Rsize PDF document.
24944+
This method makes a synchronous HTTP request by default. To make an
24945+
asynchronous HTTP request, please define a `callback` function
24946+
to be invoked when receiving the response.
24947+
>>> def callback_function(response):
24948+
>>> pprint(response)
24949+
>>>
24950+
>>> thread = api.post_document_pages_resize_with_http_info(name, height, width, pages, callback=callback_function)
24951+
24952+
:param callback function: The callback function
24953+
for asynchronous request. (optional)
24954+
:param str name: The document name. (required)
24955+
:param float height: Page Height (required)
24956+
:param float width: Page width (required)
24957+
:param str pages: Comma separated list of pages and page ranges. (Example: 1,3-5,8) (required)
24958+
:param str storage: The document storage.
24959+
:param str folder: The document folder.
24960+
:param str password: Base64 encoded password.
24961+
:return: AsposeResponse
24962+
If the method is called asynchronously,
24963+
returns the request thread.
24964+
"""
24965+
24966+
all_params = ['name', 'height', 'width', 'pages', 'storage', 'folder', 'password']
24967+
all_params.append('callback')
24968+
all_params.append('_return_http_data_only')
24969+
all_params.append('_preload_content')
24970+
all_params.append('_request_timeout')
24971+
24972+
params = locals()
24973+
for key, val in iteritems(params['kwargs']):
24974+
if key not in all_params:
24975+
raise TypeError(
24976+
"Got an unexpected keyword argument '%s'"
24977+
" to method post_document_pages_resize" % key
24978+
)
24979+
params[key] = val
24980+
del params['kwargs']
24981+
# verify the required parameter 'name' is set
24982+
if ('name' not in params) or (params['name'] is None):
24983+
raise ValueError("Missing the required parameter `name` when calling `post_document_pages_resize`")
24984+
# verify the required parameter 'height' is set
24985+
if ('height' not in params) or (params['height'] is None):
24986+
raise ValueError("Missing the required parameter `height` when calling `post_document_pages_resize`")
24987+
# verify the required parameter 'width' is set
24988+
if ('width' not in params) or (params['width'] is None):
24989+
raise ValueError("Missing the required parameter `width` when calling `post_document_pages_resize`")
24990+
# verify the required parameter 'pages' is set
24991+
if ('pages' not in params) or (params['pages'] is None):
24992+
raise ValueError("Missing the required parameter `pages` when calling `post_document_pages_resize`")
24993+
24994+
24995+
collection_formats = {}
24996+
24997+
path_params = {}
24998+
if 'name' in params:
24999+
path_params['name'] = params['name']
25000+
25001+
query_params = []
25002+
if 'height' in params:
25003+
query_params.append(('height', params['height']))
25004+
if 'width' in params:
25005+
query_params.append(('width', params['width']))
25006+
if 'pages' in params:
25007+
query_params.append(('pages', params['pages']))
25008+
if 'storage' in params:
25009+
query_params.append(('storage', params['storage']))
25010+
if 'folder' in params:
25011+
query_params.append(('folder', params['folder']))
25012+
if 'password' in params:
25013+
query_params.append(('password', params['password']))
25014+
25015+
header_params = {}
25016+
25017+
form_params = []
25018+
local_var_files = {}
25019+
25020+
body_params = None
25021+
# HTTP header `Accept`
25022+
header_params['Accept'] = self.api_client.\
25023+
select_header_accept(['application/json'])
25024+
25025+
# HTTP header `Content-Type`
25026+
header_params['Content-Type'] = self.api_client.\
25027+
select_header_content_type(['application/json'])
25028+
25029+
# Authentication setting
25030+
auth_settings = ['JWT']
25031+
25032+
return self.api_client.call_api('/pdf/{name}/resize', 'POST',
25033+
path_params,
25034+
query_params,
25035+
header_params,
25036+
body=body_params,
25037+
post_params=form_params,
25038+
files=local_var_files,
25039+
response_type='AsposeResponse',
25040+
auth_settings=auth_settings,
25041+
callback=params.get('callback'),
25042+
_return_http_data_only=params.get('_return_http_data_only'),
25043+
_preload_content=params.get('_preload_content', True),
25044+
_request_timeout=params.get('_request_timeout'),
25045+
collection_formats=collection_formats)
25046+
2491025047
def post_document_pages_rotate(self, name, rotation_angle, pages, **kwargs):
2491125048
"""
2491225049
Rotate PDF document.

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: 25.7.0".\
202+
"SDK Package Version: 25.8.0".\
203203
format(env=sys.platform, pyversion=sys.version)

docs/PdfApi.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ Method | HTTP request | Description
212212
[**post_document_image_stamps**](PdfApi.md#post_document_image_stamps) | **POST** /pdf/\{name}/stamps/image | Add document pages image stamps.
213213
[**post_document_image_stamps_page_specified**](PdfApi.md#post_document_image_stamps_page_specified) | **POST** /pdf/\{name}/stamps/image/pagespecified | Add document image stamps to specified pages.
214214
[**post_document_page_number_stamps**](PdfApi.md#post_document_page_number_stamps) | **POST** /pdf/\{name}/stamps/pagenumber | Add document page number stamps.
215+
[**post_document_pages_resize**](PdfApi.md#post_document_pages_resize) | **POST** /pdf/\{name}/resize | Rsize PDF document.
215216
[**post_document_pages_rotate**](PdfApi.md#post_document_pages_rotate) | **POST** /pdf/\{name}/rotate | Rotate PDF document.
216217
[**post_document_text_footer**](PdfApi.md#post_document_text_footer) | **POST** /pdf/\{name}/footer/text | Add document text footer.
217218
[**post_document_text_header**](PdfApi.md#post_document_text_header) | **POST** /pdf/\{name}/header/text | Add document text header.
@@ -5661,6 +5662,34 @@ Name | Type | Description | Notes
56615662

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

5665+
# **post_document_pages_resize**
5666+
> AsposeResponse post_document_pages_resize(name, height, width, pages, storage=storage, folder=folder, password=password)
5667+
5668+
Rsize PDF document.
5669+
5670+
### Parameters
5671+
5672+
Name | Type | Description | Notes
5673+
------------- | ------------- | ------------- | -------------
5674+
**name** | **str**| The document name. |
5675+
**height** | **float**| Page Height |
5676+
**width** | **float**| Page width |
5677+
**pages** | **str**| Comma separated list of pages and page ranges. (Example: 1,3-5,8) |
5678+
**storage** | **str**| The document storage. | [optional]
5679+
**folder** | **str**| The document folder. | [optional]
5680+
**password** | **str**| Base64 encoded password. | [optional]
5681+
5682+
### Return type
5683+
5684+
[**AsposeResponse**](AsposeResponse.md)
5685+
5686+
### HTTP request headers
5687+
5688+
- **Content-Type**: application/json
5689+
- **Accept**: application/json
5690+
5691+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
5692+
56645693
# **post_document_pages_rotate**
56655694
> AsposeResponse post_document_pages_rotate(name, rotation_angle, pages, storage=storage, folder=folder, password=password)
56665695

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from setuptools import setup, find_packages
3333

3434
NAME = "asposepdfcloud"
35-
VERSION = "25.7.0"
35+
VERSION = "25.8.0"
3636
# To install the library, run the following
3737
#
3838
# python setup.py install

test/pdf_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3453,6 +3453,15 @@ def testPostDocumentPagesRotate(self):
34533453
response = self.pdf_api.post_document_pages_rotate(file_name, asposepdfcloud.models.Rotation.ON90, '2-3', **opts)
34543454
self.assertEqual(response.code, 200)
34553455

3456+
def testPostDocumentPagesResize(self):
3457+
file_name = '4pages.pdf'
3458+
self.uploadFile(file_name)
3459+
opts = {
3460+
"folder" : self.temp_folder
3461+
}
3462+
response = self.pdf_api.post_document_pages_resize(file_name, 100, 200, '2-3', **opts)
3463+
self.assertEqual(response.code, 200)
3464+
34563465
# Fields Tests
34573466

34583467
def testGetField(self):

0 commit comments

Comments
 (0)