Skip to content

Commit

Permalink
2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloudmersive committed Nov 3, 2019
1 parent 255eec5 commit 5d9e3c5
Show file tree
Hide file tree
Showing 10 changed files with 673 additions and 5 deletions.
5 changes: 4 additions & 1 deletion 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.1.4
- Package version: 2.1.5
- Build package: io.swagger.codegen.languages.PythonClientCodegen

## Requirements.
Expand Down Expand Up @@ -143,6 +143,9 @@ Class | Method | HTTP request | Description
*EditDocumentApi* | [**edit_document_xlsx_get_styles**](docs/EditDocumentApi.md#edit_document_xlsx_get_styles) | **POST** /convert/edit/xlsx/get-styles | Get styles from a XLSX worksheet
*EditDocumentApi* | [**edit_document_xlsx_get_worksheets**](docs/EditDocumentApi.md#edit_document_xlsx_get_worksheets) | **POST** /convert/edit/xlsx/get-worksheets | Get worksheets from a XLSX
*EditDocumentApi* | [**edit_document_xlsx_insert_worksheet**](docs/EditDocumentApi.md#edit_document_xlsx_insert_worksheet) | **POST** /convert/edit/xlsx/insert-worksheet | Insert a new worksheet into an XLSX spreadsheet
*EditPdfApi* | [**edit_pdf_encrypt**](docs/EditPdfApi.md#edit_pdf_encrypt) | **POST** /convert/edit/pdf/encrypt | Encrypt and password-protect a PDF
*EditPdfApi* | [**edit_pdf_set_permissions**](docs/EditPdfApi.md#edit_pdf_set_permissions) | **POST** /convert/edit/pdf/encrypt/set-permissions | Encrypt, password-protect and set restricted permissions on a PDF
*EditPdfApi* | [**edit_pdf_watermark_text**](docs/EditPdfApi.md#edit_pdf_watermark_text) | **POST** /convert/edit/pdf/watermark/text | Add a text watermark to a PDF
*MergeDocumentApi* | [**merge_document_docx**](docs/MergeDocumentApi.md#merge_document_docx) | **POST** /convert/merge/docx | Merge Multple Word DOCX Together
*MergeDocumentApi* | [**merge_document_pdf**](docs/MergeDocumentApi.md#merge_document_pdf) | **POST** /convert/merge/pdf | 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
Expand Down
1 change: 1 addition & 0 deletions cloudmersive_convert_api_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from cloudmersive_convert_api_client.api.convert_template_api import ConvertTemplateApi
from cloudmersive_convert_api_client.api.convert_web_api import ConvertWebApi
from cloudmersive_convert_api_client.api.edit_document_api import EditDocumentApi
from cloudmersive_convert_api_client.api.edit_pdf_api import EditPdfApi
from cloudmersive_convert_api_client.api.merge_document_api import MergeDocumentApi
from cloudmersive_convert_api_client.api.split_document_api import SplitDocumentApi
from cloudmersive_convert_api_client.api.validate_document_api import ValidateDocumentApi
Expand Down
1 change: 1 addition & 0 deletions cloudmersive_convert_api_client/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from cloudmersive_convert_api_client.api.convert_template_api import ConvertTemplateApi
from cloudmersive_convert_api_client.api.convert_web_api import ConvertWebApi
from cloudmersive_convert_api_client.api.edit_document_api import EditDocumentApi
from cloudmersive_convert_api_client.api.edit_pdf_api import EditPdfApi
from cloudmersive_convert_api_client.api.merge_document_api import MergeDocumentApi
from cloudmersive_convert_api_client.api.split_document_api import SplitDocumentApi
from cloudmersive_convert_api_client.api.validate_document_api import ValidateDocumentApi
Expand Down
403 changes: 403 additions & 0 deletions cloudmersive_convert_api_client/api/edit_pdf_api.py

Large diffs are not rendered by default.

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.1.4/python'
self.user_agent = 'Swagger-Codegen/2.1.5/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.1.4".\
"SDK Package Version: 2.1.5".\
format(env=sys.platform, pyversion=sys.version)
205 changes: 205 additions & 0 deletions docs/EditPdfApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
# cloudmersive_convert_api_client.EditPdfApi

All URIs are relative to *https://api.cloudmersive.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**edit_pdf_encrypt**](EditPdfApi.md#edit_pdf_encrypt) | **POST** /convert/edit/pdf/encrypt | Encrypt and password-protect a PDF
[**edit_pdf_set_permissions**](EditPdfApi.md#edit_pdf_set_permissions) | **POST** /convert/edit/pdf/encrypt/set-permissions | Encrypt, password-protect and set restricted permissions on a PDF
[**edit_pdf_watermark_text**](EditPdfApi.md#edit_pdf_watermark_text) | **POST** /convert/edit/pdf/watermark/text | Add a text watermark to a PDF


# **edit_pdf_encrypt**
> str edit_pdf_encrypt(input_file, user_password=user_password, owner_password=owner_password)
Encrypt and password-protect a PDF

Encrypt a PDF document with a password. Set an owner password to control owner (editor/creator) permissions, and set a user (reader) password to control the viewer of the PDF. Set the password fields null to omit the given password.

### Example
```python
from __future__ import print_function
import time
import cloudmersive_convert_api_client
from cloudmersive_convert_api_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: Apikey
configuration = cloudmersive_convert_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Apikey'] = 'Bearer'

# 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.
user_password = 'user_password_example' # str | Password of a user (reader) of the PDF file (optional)
owner_password = 'owner_password_example' # str | Password of a owner (creator/editor) of the PDF file (optional)

try:
# Encrypt and password-protect a PDF
api_response = api_instance.edit_pdf_encrypt(input_file, user_password=user_password, owner_password=owner_password)
pprint(api_response)
except ApiException as e:
print("Exception when calling EditPdfApi->edit_pdf_encrypt: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**input_file** | **file**| Input file to perform the operation on. |
**user_password** | **str**| Password of a user (reader) of the PDF file | [optional]
**owner_password** | **str**| Password of a owner (creator/editor) of the PDF file | [optional]

### Return type

**str**

### Authorization

[Apikey](../README.md#Apikey)

### HTTP request headers

- **Content-Type**: multipart/form-data
- **Accept**: application/octet-stream

[[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_set_permissions**
> str edit_pdf_set_permissions(owner_password, input_file, user_password=user_password, allow_printing=allow_printing, allow_document_assembly=allow_document_assembly, allow_content_extraction=allow_content_extraction, allow_form_filling=allow_form_filling, allow_editing=allow_editing, allow_annotations=allow_annotations, allow_degraded_printing=allow_degraded_printing)
Encrypt, password-protect and set restricted permissions on a PDF

Encrypt a PDF document with a password, and set permissions on the PDF. Set an owner password to control owner (editor/creator) permissions [required], and set a user (reader) password to control the viewer of the PDF [optional]. Set the reader password to null to omit the password. Restrict or allow printing, copying content, document assembly, editing (read-only), form filling, modification of annotations, and degraded printing through document Digital Rights Management (DRM).

### Example
```python
from __future__ import print_function
import time
import cloudmersive_convert_api_client
from cloudmersive_convert_api_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: Apikey
configuration = cloudmersive_convert_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Apikey'] = 'Bearer'

# create an instance of the API class
api_instance = cloudmersive_convert_api_client.EditPdfApi(cloudmersive_convert_api_client.ApiClient(configuration))
owner_password = 'owner_password_example' # str | Password of a owner (creator/editor) of the PDF file (required)
input_file = '/path/to/file.txt' # file | Input file to perform the operation on.
user_password = 'user_password_example' # str | Password of a user (reader) of the PDF file (optional) (optional)
allow_printing = true # bool | Set to false to disable printing through DRM. Default is true. (optional)
allow_document_assembly = true # bool | Set to false to disable document assembly through DRM. Default is true. (optional)
allow_content_extraction = true # bool | Set to false to disable copying/extracting content out of the PDF through DRM. Default is true. (optional)
allow_form_filling = true # bool | Set to false to disable filling out form fields in the PDF through DRM. Default is true. (optional)
allow_editing = true # bool | Set to false to disable editing in the PDF through DRM (making the PDF read-only). Default is true. (optional)
allow_annotations = true # bool | Set to false to disable annotations and editing of annotations in the PDF through DRM. Default is true. (optional)
allow_degraded_printing = true # bool | Set to false to disable degraded printing of the PDF through DRM. Default is true. (optional)

try:
# Encrypt, password-protect and set restricted permissions on a PDF
api_response = api_instance.edit_pdf_set_permissions(owner_password, input_file, user_password=user_password, allow_printing=allow_printing, allow_document_assembly=allow_document_assembly, allow_content_extraction=allow_content_extraction, allow_form_filling=allow_form_filling, allow_editing=allow_editing, allow_annotations=allow_annotations, allow_degraded_printing=allow_degraded_printing)
pprint(api_response)
except ApiException as e:
print("Exception when calling EditPdfApi->edit_pdf_set_permissions: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**owner_password** | **str**| Password of a owner (creator/editor) of the PDF file (required) |
**input_file** | **file**| Input file to perform the operation on. |
**user_password** | **str**| Password of a user (reader) of the PDF file (optional) | [optional]
**allow_printing** | **bool**| Set to false to disable printing through DRM. Default is true. | [optional]
**allow_document_assembly** | **bool**| Set to false to disable document assembly through DRM. Default is true. | [optional]
**allow_content_extraction** | **bool**| Set to false to disable copying/extracting content out of the PDF through DRM. Default is true. | [optional]
**allow_form_filling** | **bool**| Set to false to disable filling out form fields in the PDF through DRM. Default is true. | [optional]
**allow_editing** | **bool**| Set to false to disable editing in the PDF through DRM (making the PDF read-only). Default is true. | [optional]
**allow_annotations** | **bool**| Set to false to disable annotations and editing of annotations in the PDF through DRM. Default is true. | [optional]
**allow_degraded_printing** | **bool**| Set to false to disable degraded printing of the PDF through DRM. Default is true. | [optional]

### Return type

**str**

### Authorization

[Apikey](../README.md#Apikey)

### HTTP request headers

- **Content-Type**: multipart/form-data
- **Accept**: application/octet-stream

[[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_watermark_text**
> str edit_pdf_watermark_text(watermark_text, input_file, font_name=font_name, font_size=font_size, font_color=font_color, font_transparency=font_transparency)
Add a text watermark to a PDF

Adds a text watermark to a PDF

### Example
```python
from __future__ import print_function
import time
import cloudmersive_convert_api_client
from cloudmersive_convert_api_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: Apikey
configuration = cloudmersive_convert_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Apikey'] = 'Bearer'

# create an instance of the API class
api_instance = cloudmersive_convert_api_client.EditPdfApi(cloudmersive_convert_api_client.ApiClient(configuration))
watermark_text = 'watermark_text_example' # str | Watermark text to add to the PDF (required)
input_file = '/path/to/file.txt' # file | Input file to perform the operation on.
font_name = 'font_name_example' # str | Font Family Name for the watermark text; default is Times New Roman (optional)
font_size = 8.14 # float | Font Size in points of the text; default is 150 (optional)
font_color = 'font_color_example' # str | Font color in hexadecimal or HTML color name; default is Red (optional)
font_transparency = 8.14 # float | Font transparency between 0.0 (completely transparent) to 1.0 (fully opaque); default is 0.5 (optional)

try:
# Add a text watermark to a PDF
api_response = api_instance.edit_pdf_watermark_text(watermark_text, input_file, font_name=font_name, font_size=font_size, font_color=font_color, font_transparency=font_transparency)
pprint(api_response)
except ApiException as e:
print("Exception when calling EditPdfApi->edit_pdf_watermark_text: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**watermark_text** | **str**| Watermark text to add to the PDF (required) |
**input_file** | **file**| Input file to perform the operation on. |
**font_name** | **str**| Font Family Name for the watermark text; default is Times New Roman | [optional]
**font_size** | **float**| Font Size in points of the text; default is 150 | [optional]
**font_color** | **str**| Font color in hexadecimal or HTML color name; default is Red | [optional]
**font_transparency** | **float**| Font transparency between 0.0 (completely transparent) to 1.0 (fully opaque); default is 0.5 | [optional]

### Return type

**str**

### Authorization

[Apikey](../README.md#Apikey)

### HTTP request headers

- **Content-Type**: multipart/form-data
- **Accept**: application/octet-stream

[[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)

2 changes: 1 addition & 1 deletion packageconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projectName" : "cloudmersive_convert_api_client",
"packageName" : "cloudmersive_convert_api_client",
"packageVersion": "2.1.4",
"packageVersion": "2.1.5",
"packageUrl": "https://www.cloudmersive.com/convert-api"
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from setuptools import setup, find_packages # noqa: H301

NAME = "cloudmersive_convert_api_client"
VERSION = "2.1.4"
VERSION = "2.1.5"
# To install the library, run the following
#
# python setup.py install
Expand Down
55 changes: 55 additions & 0 deletions test/test_edit_pdf_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# coding: utf-8

"""
convertapi
Convert API lets you effortlessly convert file formats and types. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import unittest

import cloudmersive_convert_api_client
from cloudmersive_convert_api_client.api.edit_pdf_api import EditPdfApi # noqa: E501
from cloudmersive_convert_api_client.rest import ApiException


class TestEditPdfApi(unittest.TestCase):
"""EditPdfApi unit test stubs"""

def setUp(self):
self.api = cloudmersive_convert_api_client.api.edit_pdf_api.EditPdfApi() # noqa: E501

def tearDown(self):
pass

def test_edit_pdf_encrypt(self):
"""Test case for edit_pdf_encrypt
Encrypt and password-protect a PDF # noqa: E501
"""
pass

def test_edit_pdf_set_permissions(self):
"""Test case for edit_pdf_set_permissions
Encrypt, password-protect and set restricted permissions on a PDF # noqa: E501
"""
pass

def test_edit_pdf_watermark_text(self):
"""Test case for edit_pdf_watermark_text
Add a text watermark to a PDF # noqa: E501
"""
pass


if __name__ == '__main__':
unittest.main()

0 comments on commit 5d9e3c5

Please sign in to comment.