-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
255eec5
commit 5d9e3c5
Showing
10 changed files
with
673 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |