From ca280c0db302bd14ce77d48dba61f1769abba94d Mon Sep 17 00:00:00 2001 From: Oleg Subachev Date: Tue, 25 Oct 2022 07:33:26 -0500 Subject: [PATCH] update to 22.10 --- README.md | 16 +- asposepdfcloud/__init__.py | 2 + asposepdfcloud/api_client.py | 2 +- asposepdfcloud/apis/pdf_api.py | 215 ++++++++++++++++-- asposepdfcloud/configuration.py | 2 +- asposepdfcloud/models/__init__.py | 2 + asposepdfcloud/models/page_range.py | 166 ++++++++++++++ .../models/split_range_pdf_options.py | 140 ++++++++++++ docs/PageRange.md | 12 + docs/PdfApi.md | 79 +++++-- docs/SplitRangePdfOptions.md | 11 + setup.py | 2 +- test/pdf_tests.py | 33 ++- 13 files changed, 629 insertions(+), 53 deletions(-) create mode 100644 asposepdfcloud/models/page_range.py create mode 100644 asposepdfcloud/models/split_range_pdf_options.py create mode 100644 docs/PageRange.md create mode 100644 docs/SplitRangePdfOptions.md diff --git a/README.md b/README.md index 023de76..7c93daa 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,16 @@ XLS, XLSX, PPTX, DOC, DOCX, MobiXML, JPEG, EMF, PNG, BMP, GIF, TIFF, Text ## Read PDF Formats MHT, PCL, PS, XSLFO, MD -## Enhancements in Version 22.9 +## Enhancements in Version 22.10 +- Convert password protected PDF to DOC. +- Support to convert password protected document to graphic formats. +- Support to convert pages of password protected PDF to JPEG using GetPageConvertToJpeg. +- Add new REST API endpoint to parse PDF document into PDF parts containing specified page ranges. - A new version of Aspose.PDF Cloud was prepared using the latest version of Aspose.PDF for .NET. +## Bugs fixed in Version 22.10 +- The PostSplitDocument API method is throwing 504 Gateway Error. + ## Requirements. Python 2.7 and 3.4+ @@ -226,7 +233,7 @@ Class | Method | HTTP request | Description *PdfApi* | [**get_pages**](docs/PdfApi.md#get_pages) | **GET** /pdf/\{name}/pages | Read document pages info. *PdfApi* | [**get_pcl_in_storage_to_pdf**](docs/PdfApi.md#get_pcl_in_storage_to_pdf) | **GET** /pdf/create/pcl | Convert PCL file (located on storage) to PDF format and return resulting file in response. *PdfApi* | [**get_pdf_a_in_storage_to_pdf**](docs/PdfApi.md#get_pdf_a_in_storage_to_pdf) | **GET** /pdf/create/pdfa | Convert PDFA file (located on storage) to PDF format and return resulting file in response. -*PdfApi* | [**get_pdf_in_storage_to_doc**](docs/PdfApi.md#get_pdf_in_storage_to_doc) | **GET** /pdf/\{name}/convert/doc | Converts PDF document (located on storage) to DOC format and returns resulting file in response content +*PdfApi* | [**get_pdf_in_storage_to_doc**](docs/PdfApi.md#get_pdf_in_storage_to_doc) | **GET** /pdf/\{name}/convert/doc | Converts PDF document (located on storage) to DOC format and returns resulting file in response content. *PdfApi* | [**get_pdf_in_storage_to_epub**](docs/PdfApi.md#get_pdf_in_storage_to_epub) | **GET** /pdf/\{name}/convert/epub | Converts PDF document (located on storage) to EPUB format and returns resulting file in response content *PdfApi* | [**get_pdf_in_storage_to_html**](docs/PdfApi.md#get_pdf_in_storage_to_html) | **GET** /pdf/\{name}/convert/html | Converts PDF document (located on storage) to Html format and returns resulting file in response content *PdfApi* | [**get_pdf_in_storage_to_mobi_xml**](docs/PdfApi.md#get_pdf_in_storage_to_mobi_xml) | **GET** /pdf/\{name}/convert/mobixml | Converts PDF document (located on storage) to MOBIXML format and returns resulting ZIP archive file in response content. @@ -327,6 +334,7 @@ Class | Method | HTTP request | Description *PdfApi* | [**post_sign_page**](docs/PdfApi.md#post_sign_page) | **POST** /pdf/\{name}/pages/\{pageNumber}/sign | Sign page. *PdfApi* | [**post_signature_field**](docs/PdfApi.md#post_signature_field) | **POST** /pdf/\{name}/fields/signature | Add document signature field. *PdfApi* | [**post_split_document**](docs/PdfApi.md#post_split_document) | **POST** /pdf/\{name}/split | Split document to parts. +*PdfApi* | [**post_split_range_pdf_document**](docs/PdfApi.md#post_split_range_pdf_document) | **POST** /pdf/\{name}/splitrangepdf | *PdfApi* | [**post_text_box_fields**](docs/PdfApi.md#post_text_box_fields) | **POST** /pdf/\{name}/fields/textbox | Add document text box fields. *PdfApi* | [**put_add_new_page**](docs/PdfApi.md#put_add_new_page) | **PUT** /pdf/\{name}/pages | Add new page to end of the document. *PdfApi* | [**put_add_text**](docs/PdfApi.md#put_add_text) | **PUT** /pdf/\{name}/pages/\{pageNumber}/text | Add text to PDF document page. @@ -393,7 +401,7 @@ Class | Method | HTTP request | Description *PdfApi* | [**put_pdf_in_request_to_xlsx**](docs/PdfApi.md#put_pdf_in_request_to_xlsx) | **PUT** /pdf/convert/xlsx | Converts PDF document (in request content) to XLSX format and uploads resulting file to storage. *PdfApi* | [**put_pdf_in_request_to_xml**](docs/PdfApi.md#put_pdf_in_request_to_xml) | **PUT** /pdf/convert/xml | Converts PDF document (in request content) to XML format and uploads resulting file to storage. *PdfApi* | [**put_pdf_in_request_to_xps**](docs/PdfApi.md#put_pdf_in_request_to_xps) | **PUT** /pdf/convert/xps | Converts PDF document (in request content) to XPS format and uploads resulting file to storage. -*PdfApi* | [**put_pdf_in_storage_to_doc**](docs/PdfApi.md#put_pdf_in_storage_to_doc) | **PUT** /pdf/\{name}/convert/doc | Converts PDF document (located on storage) to DOC format and uploads resulting file to storage +*PdfApi* | [**put_pdf_in_storage_to_doc**](docs/PdfApi.md#put_pdf_in_storage_to_doc) | **PUT** /pdf/\{name}/convert/doc | Converts PDF document (located on storage) to DOC format and uploads resulting file to storage. *PdfApi* | [**put_pdf_in_storage_to_epub**](docs/PdfApi.md#put_pdf_in_storage_to_epub) | **PUT** /pdf/\{name}/convert/epub | Converts PDF document (located on storage) to EPUB format and uploads resulting file to storage *PdfApi* | [**put_pdf_in_storage_to_html**](docs/PdfApi.md#put_pdf_in_storage_to_html) | **PUT** /pdf/\{name}/convert/html | Converts PDF document (located on storage) to Html format and uploads resulting file to storage *PdfApi* | [**put_pdf_in_storage_to_mobi_xml**](docs/PdfApi.md#put_pdf_in_storage_to_mobi_xml) | **PUT** /pdf/\{name}/convert/mobixml | Converts PDF document (located on storage) to MOBIXML format and uploads resulting ZIP archive file to storage @@ -515,6 +523,7 @@ Class | Method | HTTP request | Description - [OutputFormat](docs/OutputFormat.md) - [PageLayout](docs/PageLayout.md) - [PageMode](docs/PageMode.md) + - [PageRange](docs/PageRange.md) - [PageWordCount](docs/PageWordCount.md) - [Paragraph](docs/Paragraph.md) - [PartsEmbeddingModes](docs/PartsEmbeddingModes.md) @@ -535,6 +544,7 @@ Class | Method | HTTP request | Description - [SignatureType](docs/SignatureType.md) - [SoundEncoding](docs/SoundEncoding.md) - [SoundIcon](docs/SoundIcon.md) + - [SplitRangePdfOptions](docs/SplitRangePdfOptions.md) - [SplitResult](docs/SplitResult.md) - [Stamp](docs/Stamp.md) - [StampIcon](docs/StampIcon.md) diff --git a/asposepdfcloud/__init__.py b/asposepdfcloud/__init__.py index 9d05337..bd55e71 100644 --- a/asposepdfcloud/__init__.py +++ b/asposepdfcloud/__init__.py @@ -100,6 +100,7 @@ from .models.output_format import OutputFormat from .models.page_layout import PageLayout from .models.page_mode import PageMode +from .models.page_range import PageRange from .models.page_word_count import PageWordCount from .models.paragraph import Paragraph from .models.parts_embedding_modes import PartsEmbeddingModes @@ -120,6 +121,7 @@ from .models.signature_type import SignatureType from .models.sound_encoding import SoundEncoding from .models.sound_icon import SoundIcon +from .models.split_range_pdf_options import SplitRangePdfOptions from .models.split_result import SplitResult from .models.stamp import Stamp from .models.stamp_icon import StampIcon diff --git a/asposepdfcloud/api_client.py b/asposepdfcloud/api_client.py index a38a6b3..528cef9 100644 --- a/asposepdfcloud/api_client.py +++ b/asposepdfcloud/api_client.py @@ -83,7 +83,7 @@ def __init__(self, app_key, app_sid, host=None): self.rest_client = RESTClientObject() self.default_headers = {} self.default_headers['x-aspose-client'] = 'python sdk' - self.default_headers['x-aspose-client-version'] = '22.9.0' + self.default_headers['x-aspose-client-version'] = '22.10.0' self.app_key = app_key self.app_sid = app_sid diff --git a/asposepdfcloud/apis/pdf_api.py b/asposepdfcloud/apis/pdf_api.py index 62d067f..caaf526 100644 --- a/asposepdfcloud/apis/pdf_api.py +++ b/asposepdfcloud/apis/pdf_api.py @@ -12215,6 +12215,7 @@ def get_page_convert_to_bmp(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. @@ -12245,12 +12246,13 @@ def get_page_convert_to_bmp_with_http_info(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -12290,6 +12292,8 @@ def get_page_convert_to_bmp_with_http_info(self, name, page_number, **kwargs): query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -12342,6 +12346,7 @@ def get_page_convert_to_emf(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. @@ -12372,12 +12377,13 @@ def get_page_convert_to_emf_with_http_info(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -12417,6 +12423,8 @@ def get_page_convert_to_emf_with_http_info(self, name, page_number, **kwargs): query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -12469,6 +12477,7 @@ def get_page_convert_to_gif(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. @@ -12499,12 +12508,13 @@ def get_page_convert_to_gif_with_http_info(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -12544,6 +12554,8 @@ def get_page_convert_to_gif_with_http_info(self, name, page_number, **kwargs): query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -12596,6 +12608,7 @@ def get_page_convert_to_jpeg(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. @@ -12626,12 +12639,13 @@ def get_page_convert_to_jpeg_with_http_info(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -12671,6 +12685,8 @@ def get_page_convert_to_jpeg_with_http_info(self, name, page_number, **kwargs): query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -12723,6 +12739,7 @@ def get_page_convert_to_png(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. @@ -12753,12 +12770,13 @@ def get_page_convert_to_png_with_http_info(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -12798,6 +12816,8 @@ def get_page_convert_to_png_with_http_info(self, name, page_number, **kwargs): query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -12850,6 +12870,7 @@ def get_page_convert_to_tiff(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. @@ -12880,12 +12901,13 @@ def get_page_convert_to_tiff_with_http_info(self, name, page_number, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -12925,6 +12947,8 @@ def get_page_convert_to_tiff_with_http_info(self, name, page_number, **kwargs): query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -16553,7 +16577,7 @@ def get_pdf_a_in_storage_to_pdf_with_http_info(self, src_path, **kwargs): def get_pdf_in_storage_to_doc(self, name, **kwargs): """ - Converts PDF document (located on storage) to DOC format and returns resulting file in response content + Converts PDF document (located on storage) to DOC format and returns resulting file in response content. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. @@ -16575,6 +16599,7 @@ def get_pdf_in_storage_to_doc(self, name, **kwargs): :param float relative_horizontal_proximity: Relative horizontal proximity. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. @@ -16588,7 +16613,7 @@ def get_pdf_in_storage_to_doc(self, name, **kwargs): def get_pdf_in_storage_to_doc_with_http_info(self, name, **kwargs): """ - Converts PDF document (located on storage) to DOC format and returns resulting file in response content + Converts PDF document (located on storage) to DOC format and returns resulting file in response content. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. @@ -16610,12 +16635,13 @@ def get_pdf_in_storage_to_doc_with_http_info(self, name, **kwargs): :param float relative_horizontal_proximity: Relative horizontal proximity. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: file If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'add_return_to_line_end', 'format', 'image_resolution_x', 'image_resolution_y', 'max_distance_between_text_lines', 'mode', 'recognize_bullets', 'relative_horizontal_proximity', 'folder', 'storage'] + all_params = ['name', 'add_return_to_line_end', 'format', 'image_resolution_x', 'image_resolution_y', 'max_distance_between_text_lines', 'mode', 'recognize_bullets', 'relative_horizontal_proximity', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -16662,6 +16688,8 @@ def get_pdf_in_storage_to_doc_with_http_info(self, name, **kwargs): query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -29097,6 +29125,123 @@ def post_split_document_with_http_info(self, name, **kwargs): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def post_split_range_pdf_document(self, name, options, **kwargs): + """ + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.post_split_range_pdf_document(name, options, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str name: (required) + :param SplitRangePdfOptions options: (required) + :param str storage: + :param str folder: + :return: SplitResultResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('callback'): + return self.post_split_range_pdf_document_with_http_info(name, options, **kwargs) + else: + (data) = self.post_split_range_pdf_document_with_http_info(name, options, **kwargs) + return data + + def post_split_range_pdf_document_with_http_info(self, name, options, **kwargs): + """ + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.post_split_range_pdf_document_with_http_info(name, options, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str name: (required) + :param SplitRangePdfOptions options: (required) + :param str storage: + :param str folder: + :return: SplitResultResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['name', 'options', 'storage', 'folder'] + all_params.append('callback') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method post_split_range_pdf_document" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'name' is set + if ('name' not in params) or (params['name'] is None): + raise ValueError("Missing the required parameter `name` when calling `post_split_range_pdf_document`") + # verify the required parameter 'options' is set + if ('options' not in params) or (params['options'] is None): + raise ValueError("Missing the required parameter `options` when calling `post_split_range_pdf_document`") + + + collection_formats = {} + + path_params = {} + if 'name' in params: + path_params['name'] = params['name'] + + query_params = [] + if 'storage' in params: + query_params.append(('storage', params['storage'])) + if 'folder' in params: + query_params.append(('folder', params['folder'])) + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'options' in params: + body_params = params['options'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json']) + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json']) + + # Authentication setting + auth_settings = ['JWT'] + + return self.api_client.call_api('/pdf/{name}/splitrangepdf', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='SplitResultResponse', + auth_settings=auth_settings, + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def post_text_box_fields(self, name, fields, **kwargs): """ Add document text box fields. @@ -34731,6 +34876,7 @@ def put_page_convert_to_bmp(self, name, page_number, out_path, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. @@ -34762,12 +34908,13 @@ def put_page_convert_to_bmp_with_http_info(self, name, page_number, out_path, ** :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -34812,6 +34959,8 @@ def put_page_convert_to_bmp_with_http_info(self, name, page_number, out_path, ** query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -34865,6 +35014,7 @@ def put_page_convert_to_emf(self, name, page_number, out_path, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. @@ -34896,12 +35046,13 @@ def put_page_convert_to_emf_with_http_info(self, name, page_number, out_path, ** :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -34946,6 +35097,8 @@ def put_page_convert_to_emf_with_http_info(self, name, page_number, out_path, ** query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -34999,6 +35152,7 @@ def put_page_convert_to_gif(self, name, page_number, out_path, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. @@ -35030,12 +35184,13 @@ def put_page_convert_to_gif_with_http_info(self, name, page_number, out_path, ** :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -35080,6 +35235,8 @@ def put_page_convert_to_gif_with_http_info(self, name, page_number, out_path, ** query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -35133,6 +35290,7 @@ def put_page_convert_to_jpeg(self, name, page_number, out_path, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. @@ -35164,12 +35322,13 @@ def put_page_convert_to_jpeg_with_http_info(self, name, page_number, out_path, * :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -35214,6 +35373,8 @@ def put_page_convert_to_jpeg_with_http_info(self, name, page_number, out_path, * query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -35267,6 +35428,7 @@ def put_page_convert_to_png(self, name, page_number, out_path, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. @@ -35298,12 +35460,13 @@ def put_page_convert_to_png_with_http_info(self, name, page_number, out_path, ** :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -35348,6 +35511,8 @@ def put_page_convert_to_png_with_http_info(self, name, page_number, out_path, ** query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -35401,6 +35566,7 @@ def put_page_convert_to_tiff(self, name, page_number, out_path, **kwargs): :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. @@ -35432,12 +35598,13 @@ def put_page_convert_to_tiff_with_http_info(self, name, page_number, out_path, * :param int height: The converted image height. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage'] + all_params = ['name', 'page_number', 'out_path', 'width', 'height', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -35482,6 +35649,8 @@ def put_page_convert_to_tiff_with_http_info(self, name, page_number, out_path, * query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -35780,6 +35949,7 @@ def put_pdf_in_request_to_doc(self, out_path, **kwargs): :param bool recognize_bullets: Recognize bullets. :param float relative_horizontal_proximity: Relative horizontal proximity. :param str storage: The document storage. + :param str password: The password (Base64). :param file file: A file to be converted. :return: AsposeResponse If the method is called asynchronously, @@ -35815,13 +35985,14 @@ def put_pdf_in_request_to_doc_with_http_info(self, out_path, **kwargs): :param bool recognize_bullets: Recognize bullets. :param float relative_horizontal_proximity: Relative horizontal proximity. :param str storage: The document storage. + :param str password: The password (Base64). :param file file: A file to be converted. :return: AsposeResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['out_path', 'add_return_to_line_end', 'format', 'image_resolution_x', 'image_resolution_y', 'max_distance_between_text_lines', 'mode', 'recognize_bullets', 'relative_horizontal_proximity', 'storage', 'file'] + all_params = ['out_path', 'add_return_to_line_end', 'format', 'image_resolution_x', 'image_resolution_y', 'max_distance_between_text_lines', 'mode', 'recognize_bullets', 'relative_horizontal_proximity', 'storage', 'password', 'file'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -35866,6 +36037,8 @@ def put_pdf_in_request_to_doc_with_http_info(self, out_path, **kwargs): query_params.append(('relativeHorizontalProximity', params['relative_horizontal_proximity'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} @@ -37479,7 +37652,7 @@ def put_pdf_in_request_to_xps_with_http_info(self, out_path, **kwargs): def put_pdf_in_storage_to_doc(self, name, out_path, **kwargs): """ - Converts PDF document (located on storage) to DOC format and uploads resulting file to storage + Converts PDF document (located on storage) to DOC format and uploads resulting file to storage. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. @@ -37502,6 +37675,7 @@ def put_pdf_in_storage_to_doc(self, name, out_path, **kwargs): :param float relative_horizontal_proximity: Relative horizontal proximity. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. @@ -37515,7 +37689,7 @@ def put_pdf_in_storage_to_doc(self, name, out_path, **kwargs): def put_pdf_in_storage_to_doc_with_http_info(self, name, out_path, **kwargs): """ - Converts PDF document (located on storage) to DOC format and uploads resulting file to storage + Converts PDF document (located on storage) to DOC format and uploads resulting file to storage. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. @@ -37538,12 +37712,13 @@ def put_pdf_in_storage_to_doc_with_http_info(self, name, out_path, **kwargs): :param float relative_horizontal_proximity: Relative horizontal proximity. :param str folder: The document folder. :param str storage: The document storage. + :param str password: The password (Base64). :return: AsposeResponse If the method is called asynchronously, returns the request thread. """ - all_params = ['name', 'out_path', 'add_return_to_line_end', 'format', 'image_resolution_x', 'image_resolution_y', 'max_distance_between_text_lines', 'mode', 'recognize_bullets', 'relative_horizontal_proximity', 'folder', 'storage'] + all_params = ['name', 'out_path', 'add_return_to_line_end', 'format', 'image_resolution_x', 'image_resolution_y', 'max_distance_between_text_lines', 'mode', 'recognize_bullets', 'relative_horizontal_proximity', 'folder', 'storage', 'password'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -37595,6 +37770,8 @@ def put_pdf_in_storage_to_doc_with_http_info(self, name, out_path, **kwargs): query_params.append(('folder', params['folder'])) if 'storage' in params: query_params.append(('storage', params['storage'])) + if 'password' in params: + query_params.append(('password', params['password'])) header_params = {} diff --git a/asposepdfcloud/configuration.py b/asposepdfcloud/configuration.py index fb91579..bc5be6d 100644 --- a/asposepdfcloud/configuration.py +++ b/asposepdfcloud/configuration.py @@ -199,5 +199,5 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 3.0\n"\ - "SDK Package Version: 22.9.0".\ + "SDK Package Version: 22.10.0".\ format(env=sys.platform, pyversion=sys.version) diff --git a/asposepdfcloud/models/__init__.py b/asposepdfcloud/models/__init__.py index c94392d..7e0ca00 100644 --- a/asposepdfcloud/models/__init__.py +++ b/asposepdfcloud/models/__init__.py @@ -100,6 +100,7 @@ from .output_format import OutputFormat from .page_layout import PageLayout from .page_mode import PageMode +from .page_range import PageRange from .page_word_count import PageWordCount from .paragraph import Paragraph from .parts_embedding_modes import PartsEmbeddingModes @@ -120,6 +121,7 @@ from .signature_type import SignatureType from .sound_encoding import SoundEncoding from .sound_icon import SoundIcon +from .split_range_pdf_options import SplitRangePdfOptions from .split_result import SplitResult from .stamp import Stamp from .stamp_icon import StampIcon diff --git a/asposepdfcloud/models/page_range.py b/asposepdfcloud/models/page_range.py new file mode 100644 index 0000000..3c7ba8e --- /dev/null +++ b/asposepdfcloud/models/page_range.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + Aspose.PDF Cloud API Reference + + +Copyright (c) 2022 Aspose.PDF Cloud +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + + OpenAPI spec version: 3.0 + +""" + + +from pprint import pformat +from six import iteritems +import re + + +class PageRange(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_from': 'int', + 'to': 'int' + } + + attribute_map = { + '_from': 'from', + 'to': 'to' + } + + def __init__(self, _from=None, to=None): + """ + PageRange - a model defined in Swagger + """ + + self.__from = None + self._to = None + + if _from is not None: + self._from = _from + if to is not None: + self.to = to + + @property + def _from(self): + """ + Gets the _from of this PageRange. + + :return: The _from of this PageRange. + :rtype: int + """ + return self.__from + + @_from.setter + def _from(self, _from): + """ + Sets the _from of this PageRange. + + :param _from: The _from of this PageRange. + :type: int + """ + + self.__from = _from + + @property + def to(self): + """ + Gets the to of this PageRange. + + :return: The to of this PageRange. + :rtype: int + """ + return self._to + + @to.setter + def to(self, to): + """ + Sets the to of this PageRange. + + :param to: The to of this PageRange. + :type: int + """ + + self._to = to + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, PageRange): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/asposepdfcloud/models/split_range_pdf_options.py b/asposepdfcloud/models/split_range_pdf_options.py new file mode 100644 index 0000000..9a04086 --- /dev/null +++ b/asposepdfcloud/models/split_range_pdf_options.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Aspose.PDF Cloud API Reference + + +Copyright (c) 2022 Aspose.PDF Cloud +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + + + OpenAPI spec version: 3.0 + +""" + + +from pprint import pformat +from six import iteritems +import re + + +class SplitRangePdfOptions(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'page_ranges': 'list[PageRange]' + } + + attribute_map = { + 'page_ranges': 'PageRanges' + } + + def __init__(self, page_ranges=None): + """ + SplitRangePdfOptions - a model defined in Swagger + """ + + self._page_ranges = None + + if page_ranges is not None: + self.page_ranges = page_ranges + + @property + def page_ranges(self): + """ + Gets the page_ranges of this SplitRangePdfOptions. + + :return: The page_ranges of this SplitRangePdfOptions. + :rtype: list[PageRange] + """ + return self._page_ranges + + @page_ranges.setter + def page_ranges(self, page_ranges): + """ + Sets the page_ranges of this SplitRangePdfOptions. + + :param page_ranges: The page_ranges of this SplitRangePdfOptions. + :type: list[PageRange] + """ + + self._page_ranges = page_ranges + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + if not isinstance(other, SplitRangePdfOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other diff --git a/docs/PageRange.md b/docs/PageRange.md new file mode 100644 index 0000000..045c38c --- /dev/null +++ b/docs/PageRange.md @@ -0,0 +1,12 @@ +# PageRange + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_from** | **int** | | [optional] +**to** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PdfApi.md b/docs/PdfApi.md index 609224e..e4a7513 100644 --- a/docs/PdfApi.md +++ b/docs/PdfApi.md @@ -145,7 +145,7 @@ Method | HTTP request | Description [**get_pages**](PdfApi.md#get_pages) | **GET** /pdf/\{name}/pages | Read document pages info. [**get_pcl_in_storage_to_pdf**](PdfApi.md#get_pcl_in_storage_to_pdf) | **GET** /pdf/create/pcl | Convert PCL file (located on storage) to PDF format and return resulting file in response. [**get_pdf_a_in_storage_to_pdf**](PdfApi.md#get_pdf_a_in_storage_to_pdf) | **GET** /pdf/create/pdfa | Convert PDFA file (located on storage) to PDF format and return resulting file in response. -[**get_pdf_in_storage_to_doc**](PdfApi.md#get_pdf_in_storage_to_doc) | **GET** /pdf/\{name}/convert/doc | Converts PDF document (located on storage) to DOC format and returns resulting file in response content +[**get_pdf_in_storage_to_doc**](PdfApi.md#get_pdf_in_storage_to_doc) | **GET** /pdf/\{name}/convert/doc | Converts PDF document (located on storage) to DOC format and returns resulting file in response content. [**get_pdf_in_storage_to_epub**](PdfApi.md#get_pdf_in_storage_to_epub) | **GET** /pdf/\{name}/convert/epub | Converts PDF document (located on storage) to EPUB format and returns resulting file in response content [**get_pdf_in_storage_to_html**](PdfApi.md#get_pdf_in_storage_to_html) | **GET** /pdf/\{name}/convert/html | Converts PDF document (located on storage) to Html format and returns resulting file in response content [**get_pdf_in_storage_to_mobi_xml**](PdfApi.md#get_pdf_in_storage_to_mobi_xml) | **GET** /pdf/\{name}/convert/mobixml | Converts PDF document (located on storage) to MOBIXML format and returns resulting ZIP archive file in response content. @@ -246,6 +246,7 @@ Method | HTTP request | Description [**post_sign_page**](PdfApi.md#post_sign_page) | **POST** /pdf/\{name}/pages/\{pageNumber}/sign | Sign page. [**post_signature_field**](PdfApi.md#post_signature_field) | **POST** /pdf/\{name}/fields/signature | Add document signature field. [**post_split_document**](PdfApi.md#post_split_document) | **POST** /pdf/\{name}/split | Split document to parts. +[**post_split_range_pdf_document**](PdfApi.md#post_split_range_pdf_document) | **POST** /pdf/\{name}/splitrangepdf | [**post_text_box_fields**](PdfApi.md#post_text_box_fields) | **POST** /pdf/\{name}/fields/textbox | Add document text box fields. [**put_add_new_page**](PdfApi.md#put_add_new_page) | **PUT** /pdf/\{name}/pages | Add new page to end of the document. [**put_add_text**](PdfApi.md#put_add_text) | **PUT** /pdf/\{name}/pages/\{pageNumber}/text | Add text to PDF document page. @@ -312,7 +313,7 @@ Method | HTTP request | Description [**put_pdf_in_request_to_xlsx**](PdfApi.md#put_pdf_in_request_to_xlsx) | **PUT** /pdf/convert/xlsx | Converts PDF document (in request content) to XLSX format and uploads resulting file to storage. [**put_pdf_in_request_to_xml**](PdfApi.md#put_pdf_in_request_to_xml) | **PUT** /pdf/convert/xml | Converts PDF document (in request content) to XML format and uploads resulting file to storage. [**put_pdf_in_request_to_xps**](PdfApi.md#put_pdf_in_request_to_xps) | **PUT** /pdf/convert/xps | Converts PDF document (in request content) to XPS format and uploads resulting file to storage. -[**put_pdf_in_storage_to_doc**](PdfApi.md#put_pdf_in_storage_to_doc) | **PUT** /pdf/\{name}/convert/doc | Converts PDF document (located on storage) to DOC format and uploads resulting file to storage +[**put_pdf_in_storage_to_doc**](PdfApi.md#put_pdf_in_storage_to_doc) | **PUT** /pdf/\{name}/convert/doc | Converts PDF document (located on storage) to DOC format and uploads resulting file to storage. [**put_pdf_in_storage_to_epub**](PdfApi.md#put_pdf_in_storage_to_epub) | **PUT** /pdf/\{name}/convert/epub | Converts PDF document (located on storage) to EPUB format and uploads resulting file to storage [**put_pdf_in_storage_to_html**](PdfApi.md#put_pdf_in_storage_to_html) | **PUT** /pdf/\{name}/convert/html | Converts PDF document (located on storage) to Html format and uploads resulting file to storage [**put_pdf_in_storage_to_mobi_xml**](PdfApi.md#put_pdf_in_storage_to_mobi_xml) | **PUT** /pdf/\{name}/convert/mobixml | Converts PDF document (located on storage) to MOBIXML format and uploads resulting ZIP archive file to storage @@ -2942,7 +2943,7 @@ Name | Type | Description | Notes [[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) # **get_page_convert_to_bmp** -> file get_page_convert_to_bmp(name, page_number, width=width, height=height, folder=folder, storage=storage) +> file get_page_convert_to_bmp(name, page_number, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to Bmp image and return resulting file in response. @@ -2956,6 +2957,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -2969,7 +2971,7 @@ Name | Type | Description | Notes [[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) # **get_page_convert_to_emf** -> file get_page_convert_to_emf(name, page_number, width=width, height=height, folder=folder, storage=storage) +> file get_page_convert_to_emf(name, page_number, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to Emf image and return resulting file in response. @@ -2983,6 +2985,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -2996,7 +2999,7 @@ Name | Type | Description | Notes [[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) # **get_page_convert_to_gif** -> file get_page_convert_to_gif(name, page_number, width=width, height=height, folder=folder, storage=storage) +> file get_page_convert_to_gif(name, page_number, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to Gif image and return resulting file in response. @@ -3010,6 +3013,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -3023,7 +3027,7 @@ Name | Type | Description | Notes [[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) # **get_page_convert_to_jpeg** -> file get_page_convert_to_jpeg(name, page_number, width=width, height=height, folder=folder, storage=storage) +> file get_page_convert_to_jpeg(name, page_number, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to Jpeg image and return resulting file in response. @@ -3037,6 +3041,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -3050,7 +3055,7 @@ Name | Type | Description | Notes [[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) # **get_page_convert_to_png** -> file get_page_convert_to_png(name, page_number, width=width, height=height, folder=folder, storage=storage) +> file get_page_convert_to_png(name, page_number, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to Png image and return resulting file in response. @@ -3064,6 +3069,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -3077,7 +3083,7 @@ Name | Type | Description | Notes [[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) # **get_page_convert_to_tiff** -> file get_page_convert_to_tiff(name, page_number, width=width, height=height, folder=folder, storage=storage) +> file get_page_convert_to_tiff(name, page_number, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to Tiff image and return resulting file in response. @@ -3091,6 +3097,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -3858,9 +3865,9 @@ Name | Type | Description | Notes [[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) # **get_pdf_in_storage_to_doc** -> file get_pdf_in_storage_to_doc(name, add_return_to_line_end=add_return_to_line_end, format=format, image_resolution_x=image_resolution_x, image_resolution_y=image_resolution_y, max_distance_between_text_lines=max_distance_between_text_lines, mode=mode, recognize_bullets=recognize_bullets, relative_horizontal_proximity=relative_horizontal_proximity, folder=folder, storage=storage) +> file get_pdf_in_storage_to_doc(name, add_return_to_line_end=add_return_to_line_end, format=format, image_resolution_x=image_resolution_x, image_resolution_y=image_resolution_y, max_distance_between_text_lines=max_distance_between_text_lines, mode=mode, recognize_bullets=recognize_bullets, relative_horizontal_proximity=relative_horizontal_proximity, folder=folder, storage=storage, password=password) -Converts PDF document (located on storage) to DOC format and returns resulting file in response content +Converts PDF document (located on storage) to DOC format and returns resulting file in response content. ### Parameters @@ -3877,6 +3884,7 @@ Name | Type | Description | Notes **relative_horizontal_proximity** | **float**| Relative horizontal proximity. | [optional] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -6501,6 +6509,31 @@ Name | Type | Description | Notes [[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) +# **post_split_range_pdf_document** +> SplitResultResponse post_split_range_pdf_document(name, options, storage=storage, folder=folder) + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| | + **options** | [**SplitRangePdfOptions**](SplitRangePdfOptions.md)| | + **storage** | **str**| | [optional] + **folder** | **str**| | [optional] + +### Return type + +[**SplitResultResponse**](SplitResultResponse.md) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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) + # **post_text_box_fields** > AsposeResponse post_text_box_fields(name, fields, storage=storage, folder=folder) @@ -7680,7 +7713,7 @@ Name | Type | Description | Notes [[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) # **put_page_convert_to_bmp** -> AsposeResponse put_page_convert_to_bmp(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage) +> AsposeResponse put_page_convert_to_bmp(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to bmp image and upload resulting file to storage. @@ -7695,6 +7728,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -7708,7 +7742,7 @@ Name | Type | Description | Notes [[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) # **put_page_convert_to_emf** -> AsposeResponse put_page_convert_to_emf(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage) +> AsposeResponse put_page_convert_to_emf(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to emf image and upload resulting file to storage. @@ -7723,6 +7757,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -7736,7 +7771,7 @@ Name | Type | Description | Notes [[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) # **put_page_convert_to_gif** -> AsposeResponse put_page_convert_to_gif(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage) +> AsposeResponse put_page_convert_to_gif(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to gif image and upload resulting file to storage. @@ -7751,6 +7786,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -7764,7 +7800,7 @@ Name | Type | Description | Notes [[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) # **put_page_convert_to_jpeg** -> AsposeResponse put_page_convert_to_jpeg(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage) +> AsposeResponse put_page_convert_to_jpeg(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to Jpeg image and upload resulting file to storage. @@ -7779,6 +7815,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -7792,7 +7829,7 @@ Name | Type | Description | Notes [[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) # **put_page_convert_to_png** -> AsposeResponse put_page_convert_to_png(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage) +> AsposeResponse put_page_convert_to_png(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to png image and upload resulting file to storage. @@ -7807,6 +7844,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -7820,7 +7858,7 @@ Name | Type | Description | Notes [[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) # **put_page_convert_to_tiff** -> AsposeResponse put_page_convert_to_tiff(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage) +> AsposeResponse put_page_convert_to_tiff(name, page_number, out_path, width=width, height=height, folder=folder, storage=storage, password=password) Convert document page to Tiff image and upload resulting file to storage. @@ -7835,6 +7873,7 @@ Name | Type | Description | Notes **height** | **int**| The converted image height. | [optional] [default to 0] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type @@ -7899,7 +7938,7 @@ Name | Type | Description | Notes [[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) # **put_pdf_in_request_to_doc** -> AsposeResponse put_pdf_in_request_to_doc(out_path, add_return_to_line_end=add_return_to_line_end, format=format, image_resolution_x=image_resolution_x, image_resolution_y=image_resolution_y, max_distance_between_text_lines=max_distance_between_text_lines, mode=mode, recognize_bullets=recognize_bullets, relative_horizontal_proximity=relative_horizontal_proximity, storage=storage, file=file) +> AsposeResponse put_pdf_in_request_to_doc(out_path, add_return_to_line_end=add_return_to_line_end, format=format, image_resolution_x=image_resolution_x, image_resolution_y=image_resolution_y, max_distance_between_text_lines=max_distance_between_text_lines, mode=mode, recognize_bullets=recognize_bullets, relative_horizontal_proximity=relative_horizontal_proximity, storage=storage, password=password, file=file) Converts PDF document (in request content) to DOC format and uploads resulting file to storage. @@ -7917,6 +7956,7 @@ Name | Type | Description | Notes **recognize_bullets** | **bool**| Recognize bullets. | [optional] **relative_horizontal_proximity** | **float**| Relative horizontal proximity. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] **file** | **file**| A file to be converted. | [optional] ### Return type @@ -8276,9 +8316,9 @@ Name | Type | Description | Notes [[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) # **put_pdf_in_storage_to_doc** -> AsposeResponse put_pdf_in_storage_to_doc(name, out_path, add_return_to_line_end=add_return_to_line_end, format=format, image_resolution_x=image_resolution_x, image_resolution_y=image_resolution_y, max_distance_between_text_lines=max_distance_between_text_lines, mode=mode, recognize_bullets=recognize_bullets, relative_horizontal_proximity=relative_horizontal_proximity, folder=folder, storage=storage) +> AsposeResponse put_pdf_in_storage_to_doc(name, out_path, add_return_to_line_end=add_return_to_line_end, format=format, image_resolution_x=image_resolution_x, image_resolution_y=image_resolution_y, max_distance_between_text_lines=max_distance_between_text_lines, mode=mode, recognize_bullets=recognize_bullets, relative_horizontal_proximity=relative_horizontal_proximity, folder=folder, storage=storage, password=password) -Converts PDF document (located on storage) to DOC format and uploads resulting file to storage +Converts PDF document (located on storage) to DOC format and uploads resulting file to storage. ### Parameters @@ -8296,6 +8336,7 @@ Name | Type | Description | Notes **relative_horizontal_proximity** | **float**| Relative horizontal proximity. | [optional] **folder** | **str**| The document folder. | [optional] **storage** | **str**| The document storage. | [optional] + **password** | **str**| The password (Base64). | [optional] ### Return type diff --git a/docs/SplitRangePdfOptions.md b/docs/SplitRangePdfOptions.md new file mode 100644 index 0000000..dab729c --- /dev/null +++ b/docs/SplitRangePdfOptions.md @@ -0,0 +1,11 @@ +# SplitRangePdfOptions + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page_ranges** | [**list[PageRange]**](PageRange.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/setup.py b/setup.py index 9639df1..e8cd6d8 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ from setuptools import setup, find_packages NAME = "asposepdfcloud" -VERSION = "22.9.0" +VERSION = "22.10.0" # To install the library, run the following # # python setup.py install diff --git a/test/pdf_tests.py b/test/pdf_tests.py index 01aeb9d..0a1f705 100644 --- a/test/pdf_tests.py +++ b/test/pdf_tests.py @@ -3151,7 +3151,6 @@ def testGetDocument(self): response = self.pdf_api.get_document(file_name, **opts) self.assertEqual(response.code, 200) - def testPostOptimizeDocument(self): file_name = '4pages.pdf' self.uploadFile(file_name) @@ -3163,36 +3162,52 @@ def testPostOptimizeDocument(self): link_duplcate_streams=True, remove_unused_objects=True, remove_unused_streams=True, - unembed_fonts=True) - + unembed_fonts=True) opts = { "options" : optimize_options, "folder" : self.temp_folder } - response = self.pdf_api.post_optimize_document(file_name, **opts) self.assertEqual(response.code, 200) - - def testPostSplitDocument(self): file_name = '4pages.pdf' self.uploadFile(file_name) - opts = { "folder" : self.temp_folder } response = self.pdf_api.post_split_document(file_name, **opts) self.assertEqual(response.code, 200) + def testPostSplitRangeDocument(self): + file_name = '4pages.pdf' + self.uploadFile(file_name) + range_options = asposepdfcloud.models.SplitRangePdfOptions( + page_ranges=[ + asposepdfcloud.models.PageRange( + to=2 + ), + asposepdfcloud.models.PageRange( + _from=3 + ), + asposepdfcloud.models.PageRange( + _from=2, + to=3 + ) + ] + ) + opts = { + "options" : range_options, + "folder" : self.temp_folder + } + response = self.pdf_api.post_split_range_pdf_document(file_name, **opts) + self.assertEqual(response.code, 200) def testPutCreateEmptyDocument(self): file_name = 'empty.pdf' - opts = { "folder" : self.temp_folder } - response = self.pdf_api.put_create_document(file_name, **opts) self.assertEqual(response.code, 200)