Skip to content

Commit

Permalink
2.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudmersive committed Mar 30, 2020
1 parent fdde1f8 commit ce75d5f
Show file tree
Hide file tree
Showing 11 changed files with 268 additions and 20 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Convert API lets you effortlessly convert file formats and types.
This Python package provides a native API client for [Cloudmersive Document Conversion](https://www.cloudmersive.com/convert-api)

- API version: v1
- Package version: 2.4.1
- Package version: 2.4.2
- Build package: io.swagger.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down Expand Up @@ -220,7 +220,8 @@ Class | Method | HTTP request | Description
*MergeDocumentApi* | [**merge_document_docx_multi**](docs/MergeDocumentApi.md#merge_document_docx_multi) | **POST** /convert/merge/docx/multi | Merge Multple Word DOCX Together
*MergeDocumentApi* | [**merge_document_pdf**](docs/MergeDocumentApi.md#merge_document_pdf) | **POST** /convert/merge/pdf | Merge Two PDF Files Together
*MergeDocumentApi* | [**merge_document_pdf_multi**](docs/MergeDocumentApi.md#merge_document_pdf_multi) | **POST** /convert/merge/pdf/multi | Merge Multple PDF Files Together
*MergeDocumentApi* | [**merge_document_png**](docs/MergeDocumentApi.md#merge_document_png) | **POST** /convert/merge/png/vertical | Merge Multple PNG Files Together
*MergeDocumentApi* | [**merge_document_png**](docs/MergeDocumentApi.md#merge_document_png) | **POST** /convert/merge/png/vertical | Merge Two PNG Files Together
*MergeDocumentApi* | [**merge_document_png_multi**](docs/MergeDocumentApi.md#merge_document_png_multi) | **POST** /convert/merge/png/vertical/multi | Merge Multple PNG Files Together
*MergeDocumentApi* | [**merge_document_pptx**](docs/MergeDocumentApi.md#merge_document_pptx) | **POST** /convert/merge/pptx | Merge Two PowerPoint PPTX Together
*MergeDocumentApi* | [**merge_document_pptx_multi**](docs/MergeDocumentApi.md#merge_document_pptx_multi) | **POST** /convert/merge/pptx/multi | Merge Multple PowerPoint PPTX Together
*MergeDocumentApi* | [**merge_document_txt**](docs/MergeDocumentApi.md#merge_document_txt) | **POST** /convert/merge/txt | Merge Two Text (TXT) Files Together
Expand Down
6 changes: 5 additions & 1 deletion cloudmersive_convert_api_client/api/edit_pdf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ def edit_pdf_get_pdf_text_by_pages(self, input_file, **kwargs): # noqa: E501
:param async_req bool
:param file input_file: Input file to perform the operation on. (required)
:param str text_formatting_mode: Optional; specify how whitespace should be handled when converting the document to text. Possible values are 'preserveWhitespace' which will attempt to preserve whitespace in the document and relative positioning of text within the document, and 'minimizeWhitespace' which will not insert additional spaces into the document in most cases. Default is 'preserveWhitespace'.
:return: PdfTextByPageResult
If the method is called asynchronously,
returns the request thread.
Expand All @@ -795,12 +796,13 @@ def edit_pdf_get_pdf_text_by_pages_with_http_info(self, input_file, **kwargs):
:param async_req bool
:param file input_file: Input file to perform the operation on. (required)
:param str text_formatting_mode: Optional; specify how whitespace should be handled when converting the document to text. Possible values are 'preserveWhitespace' which will attempt to preserve whitespace in the document and relative positioning of text within the document, and 'minimizeWhitespace' which will not insert additional spaces into the document in most cases. Default is 'preserveWhitespace'.
:return: PdfTextByPageResult
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['input_file'] # noqa: E501
all_params = ['input_file', 'text_formatting_mode'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
Expand All @@ -827,6 +829,8 @@ def edit_pdf_get_pdf_text_by_pages_with_http_info(self, input_file, **kwargs):
query_params = []

header_params = {}
if 'text_formatting_mode' in params:
header_params['textFormattingMode'] = params['text_formatting_mode'] # noqa: E501

form_params = []
local_var_files = {}
Expand Down
147 changes: 143 additions & 4 deletions cloudmersive_convert_api_client/api/merge_document_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,9 @@ def merge_document_pdf_multi_with_http_info(self, input_file1, input_file2, **kw
collection_formats=collection_formats)

def merge_document_png(self, input_file1, input_file2, **kwargs): # noqa: E501
"""Merge Multple PNG Files Together # noqa: E501
"""Merge Two PNG Files Together # noqa: E501
Combine multiple PNG files into a single PNG document, preserving the order of the input documents in the combined document by stacking them vertically # noqa: E501
Combine two PNG files into a single PNG document, preserving the order of the input documents in the combined document by stacking them vertically # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.merge_document_png(input_file1, input_file2, async_req=True)
Expand All @@ -549,9 +549,9 @@ def merge_document_png(self, input_file1, input_file2, **kwargs): # noqa: E501
return data

def merge_document_png_with_http_info(self, input_file1, input_file2, **kwargs): # noqa: E501
"""Merge Multple PNG Files Together # noqa: E501
"""Merge Two PNG Files Together # noqa: E501
Combine multiple PNG files into a single PNG document, preserving the order of the input documents in the combined document by stacking them vertically # noqa: E501
Combine two PNG files into a single PNG document, preserving the order of the input documents in the combined document by stacking them vertically # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.merge_document_png_with_http_info(input_file1, input_file2, async_req=True)
Expand Down Expand Up @@ -632,6 +632,145 @@ def merge_document_png_with_http_info(self, input_file1, input_file2, **kwargs):
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def merge_document_png_multi(self, input_file1, input_file2, **kwargs): # noqa: E501
"""Merge Multple PNG Files Together # noqa: E501
Combine multiple PNG files into a single PNG document, preserving the order of the input documents in the combined document by stacking them vertically # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.merge_document_png_multi(input_file1, input_file2, async_req=True)
>>> result = thread.get()
:param async_req bool
:param file input_file1: First input file to perform the operation on. (required)
:param file input_file2: Second input file to perform the operation on. (required)
:param file input_file3: Third input file to perform the operation on.
:param file input_file4: Fourth input file to perform the operation on.
:param file input_file5: Fifth input file to perform the operation on.
:param file input_file6: Sixth input file to perform the operation on.
:param file input_file7: Seventh input file to perform the operation on.
:param file input_file8: Eighth input file to perform the operation on.
:param file input_file9: Ninth input file to perform the operation on.
:param file input_file10: Tenth input file to perform the operation on.
:return: str
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.merge_document_png_multi_with_http_info(input_file1, input_file2, **kwargs) # noqa: E501
else:
(data) = self.merge_document_png_multi_with_http_info(input_file1, input_file2, **kwargs) # noqa: E501
return data

def merge_document_png_multi_with_http_info(self, input_file1, input_file2, **kwargs): # noqa: E501
"""Merge Multple PNG Files Together # noqa: E501
Combine multiple PNG files into a single PNG document, preserving the order of the input documents in the combined document by stacking them vertically # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.merge_document_png_multi_with_http_info(input_file1, input_file2, async_req=True)
>>> result = thread.get()
:param async_req bool
:param file input_file1: First input file to perform the operation on. (required)
:param file input_file2: Second input file to perform the operation on. (required)
:param file input_file3: Third input file to perform the operation on.
:param file input_file4: Fourth input file to perform the operation on.
:param file input_file5: Fifth input file to perform the operation on.
:param file input_file6: Sixth input file to perform the operation on.
:param file input_file7: Seventh input file to perform the operation on.
:param file input_file8: Eighth input file to perform the operation on.
:param file input_file9: Ninth input file to perform the operation on.
:param file input_file10: Tenth input file to perform the operation on.
:return: str
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['input_file1', 'input_file2', 'input_file3', 'input_file4', 'input_file5', 'input_file6', 'input_file7', 'input_file8', 'input_file9', 'input_file10'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method merge_document_png_multi" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'input_file1' is set
if ('input_file1' not in params or
params['input_file1'] is None):
raise ValueError("Missing the required parameter `input_file1` when calling `merge_document_png_multi`") # noqa: E501
# verify the required parameter 'input_file2' is set
if ('input_file2' not in params or
params['input_file2'] is None):
raise ValueError("Missing the required parameter `input_file2` when calling `merge_document_png_multi`") # noqa: E501

collection_formats = {}

path_params = {}

query_params = []

header_params = {}

form_params = []
local_var_files = {}
if 'input_file1' in params:
local_var_files['inputFile1'] = params['input_file1'] # noqa: E501
if 'input_file2' in params:
local_var_files['inputFile2'] = params['input_file2'] # noqa: E501
if 'input_file3' in params:
local_var_files['inputFile3'] = params['input_file3'] # noqa: E501
if 'input_file4' in params:
local_var_files['inputFile4'] = params['input_file4'] # noqa: E501
if 'input_file5' in params:
local_var_files['inputFile5'] = params['input_file5'] # noqa: E501
if 'input_file6' in params:
local_var_files['inputFile6'] = params['input_file6'] # noqa: E501
if 'input_file7' in params:
local_var_files['inputFile7'] = params['input_file7'] # noqa: E501
if 'input_file8' in params:
local_var_files['inputFile8'] = params['input_file8'] # noqa: E501
if 'input_file9' in params:
local_var_files['inputFile9'] = params['input_file9'] # noqa: E501
if 'input_file10' in params:
local_var_files['inputFile10'] = params['input_file10'] # noqa: E501

body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/octet-stream']) # noqa: E501

# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['multipart/form-data']) # noqa: E501

# Authentication setting
auth_settings = ['Apikey'] # noqa: E501

return self.api_client.call_api(
'/convert/merge/png/vertical/multi', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='str', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_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 merge_document_pptx(self, input_file1, input_file2, **kwargs): # noqa: E501
"""Merge Two PowerPoint PPTX Together # noqa: E501
Expand Down
2 changes: 1 addition & 1 deletion cloudmersive_convert_api_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'Swagger-Codegen/2.4.1/python'
self.user_agent = 'Swagger-Codegen/2.4.2/python'

def __del__(self):
if self._pool is not None:
Expand Down
2 changes: 1 addition & 1 deletion cloudmersive_convert_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,5 +240,5 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: v1\n"\
"SDK Package Version: 2.4.1".\
"SDK Package Version: 2.4.2".\
format(env=sys.platform, pyversion=sys.version)
34 changes: 31 additions & 3 deletions cloudmersive_convert_api_client/models/get_docx_pages_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,30 @@ class GetDocxPagesRequest(object):
"""
swagger_types = {
'input_file_bytes': 'str',
'input_file_url': 'str'
'input_file_url': 'str',
'maximum_pages': 'int'
}

attribute_map = {
'input_file_bytes': 'InputFileBytes',
'input_file_url': 'InputFileUrl'
'input_file_url': 'InputFileUrl',
'maximum_pages': 'MaximumPages'
}

def __init__(self, input_file_bytes=None, input_file_url=None): # noqa: E501
def __init__(self, input_file_bytes=None, input_file_url=None, maximum_pages=None): # noqa: E501
"""GetDocxPagesRequest - a model defined in Swagger""" # noqa: E501

self._input_file_bytes = None
self._input_file_url = None
self._maximum_pages = None
self.discriminator = None

if input_file_bytes is not None:
self.input_file_bytes = input_file_bytes
if input_file_url is not None:
self.input_file_url = input_file_url
if maximum_pages is not None:
self.maximum_pages = maximum_pages

@property
def input_file_bytes(self):
Expand Down Expand Up @@ -100,6 +105,29 @@ def input_file_url(self, input_file_url):

self._input_file_url = input_file_url

@property
def maximum_pages(self):
"""Gets the maximum_pages of this GetDocxPagesRequest. # noqa: E501
Optional: Maximum number of pages to return; set to 0 or do not supply to return all pages # noqa: E501
:return: The maximum_pages of this GetDocxPagesRequest. # noqa: E501
:rtype: int
"""
return self._maximum_pages

@maximum_pages.setter
def maximum_pages(self, maximum_pages):
"""Sets the maximum_pages of this GetDocxPagesRequest.
Optional: Maximum number of pages to return; set to 0 or do not supply to return all pages # noqa: E501
:param maximum_pages: The maximum_pages of this GetDocxPagesRequest. # noqa: E501
:type: int
"""

self._maximum_pages = maximum_pages

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
6 changes: 4 additions & 2 deletions docs/EditPdfApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,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)

# **edit_pdf_get_pdf_text_by_pages**
> PdfTextByPageResult edit_pdf_get_pdf_text_by_pages(input_file)
> PdfTextByPageResult edit_pdf_get_pdf_text_by_pages(input_file, text_formatting_mode=text_formatting_mode)
Get text in a PDF document by page

Expand All @@ -438,10 +438,11 @@ configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# create an instance of the API class
api_instance = cloudmersive_convert_api_client.EditPdfApi(cloudmersive_convert_api_client.ApiClient(configuration))
input_file = '/path/to/file.txt' # file | Input file to perform the operation on.
text_formatting_mode = 'text_formatting_mode_example' # str | Optional; specify how whitespace should be handled when converting the document to text. Possible values are 'preserveWhitespace' which will attempt to preserve whitespace in the document and relative positioning of text within the document, and 'minimizeWhitespace' which will not insert additional spaces into the document in most cases. Default is 'preserveWhitespace'. (optional)

try:
# Get text in a PDF document by page
api_response = api_instance.edit_pdf_get_pdf_text_by_pages(input_file)
api_response = api_instance.edit_pdf_get_pdf_text_by_pages(input_file, text_formatting_mode=text_formatting_mode)
pprint(api_response)
except ApiException as e:
print("Exception when calling EditPdfApi->edit_pdf_get_pdf_text_by_pages: %s\n" % e)
Expand All @@ -452,6 +453,7 @@ except ApiException as e:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**input_file** | **file**| Input file to perform the operation on. |
**text_formatting_mode** | **str**| Optional; specify how whitespace should be handled when converting the document to text. Possible values are 'preserveWhitespace' which will attempt to preserve whitespace in the document and relative positioning of text within the document, and 'minimizeWhitespace' which will not insert additional spaces into the document in most cases. Default is 'preserveWhitespace'. | [optional]

### Return type

Expand Down
1 change: 1 addition & 0 deletions docs/GetDocxPagesRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**input_file_bytes** | **str** | Optional: Bytes of the input file to operate on | [optional]
**input_file_url** | **str** | Optional: URL of a file to operate on as input. This can be a public URL, or you can also use the begin-editing API to upload a document and pass in the secure URL result from that operation as the URL here (this URL is not public). | [optional]
**maximum_pages** | **int** | Optional: Maximum number of pages to return; set to 0 or do not supply to return all pages | [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)

Expand Down
Loading

0 comments on commit ce75d5f

Please sign in to comment.