-
Notifications
You must be signed in to change notification settings - Fork 0
/
pdf_input.py
43 lines (36 loc) · 1.27 KB
/
pdf_input.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from .input import Input
from .input_type import InputType
class PdfInput(Input):
'''
Represents a pdf input
'''
def __init__(self, resource, options = None):
'''
Initializes a new instance of the `PdfInput` class.
Args:
resource (PdfResource | string): The resource of type PdfResource. | The resource path in cloud resource manager.
options (MergeOptions): The merge options for the pdf.
'''
super().__init__(resource)
# Gets or sets the merge options MergeOptions.
self.merge_options = options
# *Gets or sets the start page.
self.start_page = None
# Gets or sets the page count.
self.page_count = None
self._type = InputType.Pdf
def to_json(self):
json={
"id": self.id,
"resourceName": self.resource_name,
"type": self._type
}
if self._template_id:
json["templateId"] = self._template_id
if self.merge_options:
json["mergeOptions"] = self.merge_options.to_json()
if self.start_page != None:
json['startPage'] = self.start_page
if self.page_count != None:
json['pageCount'] = self.page_count
return json