dynamicpdf_api 1.0.0.pre.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/ruby_client/Action.rb +15 -0
- data/lib/ruby_client/AdditionalResource.rb +113 -0
- data/lib/ruby_client/AdditionalResourceType.rb +27 -0
- data/lib/ruby_client/Aes128Security.rb +70 -0
- data/lib/ruby_client/Aes256Security.rb +70 -0
- data/lib/ruby_client/Align.rb +21 -0
- data/lib/ruby_client/ButtonFieldInformation.rb +48 -0
- data/lib/ruby_client/ButtonFieldType.rb +16 -0
- data/lib/ruby_client/ChoiceFieldInformation.rb +52 -0
- data/lib/ruby_client/ChoiceFieldType.rb +16 -0
- data/lib/ruby_client/CmykColor.rb +47 -0
- data/lib/ruby_client/Color.rb +12 -0
- data/lib/ruby_client/ColorSpaceType.rb +36 -0
- data/lib/ruby_client/ConverterInput.rb +100 -0
- data/lib/ruby_client/DlexInput.rb +61 -0
- data/lib/ruby_client/DlexLayout.rb +135 -0
- data/lib/ruby_client/DlexResource.rb +40 -0
- data/lib/ruby_client/Elements/AztecBarcodeElement.rb +113 -0
- data/lib/ruby_client/Elements/AztecSymbolSize.rb +206 -0
- data/lib/ruby_client/Elements/BarcodeElement.rb +37 -0
- data/lib/ruby_client/Elements/Code11BarcodeElement.rb +77 -0
- data/lib/ruby_client/Elements/Code128BarcodeElement.rb +105 -0
- data/lib/ruby_client/Elements/Code25BarcodeElement.rb +75 -0
- data/lib/ruby_client/Elements/Code39BarcodeElement.rb +75 -0
- data/lib/ruby_client/Elements/Code93BarcodeElement.rb +75 -0
- data/lib/ruby_client/Elements/Compaction.rb +26 -0
- data/lib/ruby_client/Elements/DataMatrixBarcodeElement.rb +95 -0
- data/lib/ruby_client/Elements/DataMatrixEncodingType.rb +56 -0
- data/lib/ruby_client/Elements/DataMatrixFunctionCharacter.rb +31 -0
- data/lib/ruby_client/Elements/DataMatrixSymbolSize.rb +161 -0
- data/lib/ruby_client/Elements/Dim2BarcodeElement.rb +28 -0
- data/lib/ruby_client/Elements/Element.rb +46 -0
- data/lib/ruby_client/Elements/ElementPlacement.rb +36 -0
- data/lib/ruby_client/Elements/ElementType.rb +96 -0
- data/lib/ruby_client/Elements/ErrorCorrection.rb +56 -0
- data/lib/ruby_client/Elements/Gs1DataBarBarcodeElement.rb +76 -0
- data/lib/ruby_client/Elements/Gs1DataBarType.rb +22 -0
- data/lib/ruby_client/Elements/Iata25BarcodeElement.rb +83 -0
- data/lib/ruby_client/Elements/ImageElement.rb +108 -0
- data/lib/ruby_client/Elements/LineElement.rb +92 -0
- data/lib/ruby_client/Elements/MsiBarcodeCheckDigitMode.rb +31 -0
- data/lib/ruby_client/Elements/MsiBarcodeElement.rb +79 -0
- data/lib/ruby_client/Elements/PageNumberingElement.rb +91 -0
- data/lib/ruby_client/Elements/Pdf417BarcodeElement.rb +112 -0
- data/lib/ruby_client/Elements/QrCodeElement.rb +77 -0
- data/lib/ruby_client/Elements/QrCodeFnc1.rb +22 -0
- data/lib/ruby_client/Elements/RectangleElement.rb +109 -0
- data/lib/ruby_client/Elements/StackedGs1DataBarBarcodeElement.rb +90 -0
- data/lib/ruby_client/Elements/StackedGs1DataBarType.rb +23 -0
- data/lib/ruby_client/Elements/TextBarcodeElement.rb +48 -0
- data/lib/ruby_client/Elements/TextElement.rb +83 -0
- data/lib/ruby_client/Elements/ValueType.rb +16 -0
- data/lib/ruby_client/EncryptDocumentComponents.rb +16 -0
- data/lib/ruby_client/EndPointException.rb +7 -0
- data/lib/ruby_client/Endpoint.rb +38 -0
- data/lib/ruby_client/EndpointResource.rb +7 -0
- data/lib/ruby_client/ExcelInput.rb +49 -0
- data/lib/ruby_client/ExcelResource.rb +79 -0
- data/lib/ruby_client/Font.rb +276 -0
- data/lib/ruby_client/FontInformation.rb +9 -0
- data/lib/ruby_client/FontResource.rb +35 -0
- data/lib/ruby_client/FormField.rb +62 -0
- data/lib/ruby_client/FormFieldInformation.rb +45 -0
- data/lib/ruby_client/GoToAction.rb +53 -0
- data/lib/ruby_client/Grayscale.rb +41 -0
- data/lib/ruby_client/HtmlInput.rb +60 -0
- data/lib/ruby_client/HtmlResource.rb +34 -0
- data/lib/ruby_client/ImageInfo.rb +69 -0
- data/lib/ruby_client/ImageInformation.rb +57 -0
- data/lib/ruby_client/ImageInput.rb +150 -0
- data/lib/ruby_client/ImageResource.rb +89 -0
- data/lib/ruby_client/ImageResponse.rb +24 -0
- data/lib/ruby_client/Input.rb +53 -0
- data/lib/ruby_client/InputType.rb +41 -0
- data/lib/ruby_client/JsonResponse.rb +18 -0
- data/lib/ruby_client/LayoutDataResource.rb +48 -0
- data/lib/ruby_client/LineStyle.rb +79 -0
- data/lib/ruby_client/MergeOptions.rb +135 -0
- data/lib/ruby_client/MultiSelectListBoxInformation.rb +45 -0
- data/lib/ruby_client/Outline.rb +113 -0
- data/lib/ruby_client/OutlineList.rb +57 -0
- data/lib/ruby_client/OutlineStyle.rb +28 -0
- data/lib/ruby_client/OutputSize.rb +10 -0
- data/lib/ruby_client/PageInformation.rb +27 -0
- data/lib/ruby_client/PageInput.rb +152 -0
- data/lib/ruby_client/PageOrientation.rb +17 -0
- data/lib/ruby_client/PageSize.rb +127 -0
- data/lib/ruby_client/PageZoom.rb +33 -0
- data/lib/ruby_client/Pdf.rb +417 -0
- data/lib/ruby_client/PdfContent.rb +21 -0
- data/lib/ruby_client/PdfInfo.rb +68 -0
- data/lib/ruby_client/PdfInfoResponse.rb +27 -0
- data/lib/ruby_client/PdfInformation.rb +81 -0
- data/lib/ruby_client/PdfInput.rb +66 -0
- data/lib/ruby_client/PdfInstructions.rb +97 -0
- data/lib/ruby_client/PdfResource.rb +36 -0
- data/lib/ruby_client/PdfResponse.rb +23 -0
- data/lib/ruby_client/PdfText.rb +85 -0
- data/lib/ruby_client/PdfTextResponse.rb +27 -0
- data/lib/ruby_client/PdfXmp.rb +67 -0
- data/lib/ruby_client/PushButtonInformation.rb +21 -0
- data/lib/ruby_client/RC4128Security.rb +62 -0
- data/lib/ruby_client/Resource.rb +51 -0
- data/lib/ruby_client/ResourceType.rb +48 -0
- data/lib/ruby_client/Response.rb +39 -0
- data/lib/ruby_client/RgbColor.rb +1048 -0
- data/lib/ruby_client/Security.rb +73 -0
- data/lib/ruby_client/SecurityType.rb +23 -0
- data/lib/ruby_client/SignatureFieldInformation.rb +21 -0
- data/lib/ruby_client/Template.rb +46 -0
- data/lib/ruby_client/TextFieldInformation.rb +27 -0
- data/lib/ruby_client/TextReplace.rb +43 -0
- data/lib/ruby_client/UnitConverter.rb +111 -0
- data/lib/ruby_client/UrlAction.rb +31 -0
- data/lib/ruby_client/VAlign.rb +21 -0
- data/lib/ruby_client/WebColor.rb +18 -0
- data/lib/ruby_client/WordInput.rb +65 -0
- data/lib/ruby_client/WordResource.rb +82 -0
- data/lib/ruby_client/XmlResponse.rb +23 -0
- data/lib/ruby_client/version.rb +5 -0
- data/lib/ruby_client.rb +123 -0
- metadata +169 -0
@@ -0,0 +1,152 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
require_relative "InputType"
|
3
|
+
|
4
|
+
#
|
5
|
+
# Represents a page input.
|
6
|
+
#
|
7
|
+
class PageInput < Input
|
8
|
+
DefaultPageHeight = 792.0.freeze
|
9
|
+
DefaultPagewidth = 612.0.freeze
|
10
|
+
#
|
11
|
+
# Initializes a new instance of the PageInput class.
|
12
|
+
#
|
13
|
+
# @param page_width [float] The width of the page.
|
14
|
+
# @param page_height [float] The height of the page.
|
15
|
+
#
|
16
|
+
def initialize(page_width = nil, page_height = nil)
|
17
|
+
@page_size = nil
|
18
|
+
@page_orientation = nil
|
19
|
+
super()
|
20
|
+
@_resources = []
|
21
|
+
@elements = []
|
22
|
+
@_type = InputType::PAGE
|
23
|
+
@page_width = page_width
|
24
|
+
@page_height = page_height
|
25
|
+
end
|
26
|
+
|
27
|
+
#
|
28
|
+
# Initializes a new instance of the PageInput class.
|
29
|
+
#
|
30
|
+
# @param size [string] The size of the page.
|
31
|
+
# @param orientation [string] The orientation of the page.
|
32
|
+
# @param margins [float] The margins of the page.
|
33
|
+
def PageInputCreate(size = PageSize.Letter, orientation = PageOrientation.Portrait, margins = nil)
|
34
|
+
@page_size = size
|
35
|
+
@page_orientation = orientation
|
36
|
+
|
37
|
+
if (margins != nil)
|
38
|
+
@top_margin = margins
|
39
|
+
@bottom_margin = margins
|
40
|
+
@right_margin = margins
|
41
|
+
@left_margin = margins
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
attr_accessor :_type, :elements
|
46
|
+
|
47
|
+
#
|
48
|
+
# Gets or sets the width of the page.
|
49
|
+
#
|
50
|
+
attr_accessor :page_width
|
51
|
+
|
52
|
+
#
|
53
|
+
# Gets or sets the height of the page.
|
54
|
+
#
|
55
|
+
attr_accessor :page_height
|
56
|
+
|
57
|
+
#
|
58
|
+
# Gets or sets the top margin.
|
59
|
+
#
|
60
|
+
attr_accessor :top_margin
|
61
|
+
|
62
|
+
#
|
63
|
+
# Gets or sets the left margin.
|
64
|
+
#
|
65
|
+
attr_accessor :left_margin
|
66
|
+
|
67
|
+
#
|
68
|
+
# Gets or sets the bottom margin.
|
69
|
+
#
|
70
|
+
attr_accessor :bottom_margin
|
71
|
+
|
72
|
+
#
|
73
|
+
# Gets or sets the right margin.
|
74
|
+
#
|
75
|
+
attr_accessor :right_margin
|
76
|
+
|
77
|
+
#
|
78
|
+
# Gets or sets the Page size.
|
79
|
+
#
|
80
|
+
def page_size=(value)
|
81
|
+
@page_size = value
|
82
|
+
|
83
|
+
@output_size = UnitConverter.GetPaperSize(value)
|
84
|
+
|
85
|
+
if (PageOrientation == PageOrientation.Portrait)
|
86
|
+
@page_height = @output_size.larger
|
87
|
+
@page_width = @output_size.smaller
|
88
|
+
else
|
89
|
+
@page_height = @output_size.smaller
|
90
|
+
@page_width = @output_size.larger
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
#
|
95
|
+
# Gets or sets page orientation.
|
96
|
+
#
|
97
|
+
def page_orientation=(value)
|
98
|
+
@page_orientation = value
|
99
|
+
|
100
|
+
if (@width > @page_height)
|
101
|
+
@smaller = @page_height
|
102
|
+
@larger_Width = @page_width
|
103
|
+
else
|
104
|
+
@smaller = @page_width
|
105
|
+
@larger_width = @page_height
|
106
|
+
end
|
107
|
+
|
108
|
+
if (page_orientation == PageOrientation.Portrait)
|
109
|
+
@page_height = @larger_width
|
110
|
+
@page_width = @smaller
|
111
|
+
else
|
112
|
+
@page_height = @smaller
|
113
|
+
@page_width = @larger_width
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
#
|
118
|
+
# Gets or sets the elements of the page.
|
119
|
+
#
|
120
|
+
# @return array Elements of the page.
|
121
|
+
#
|
122
|
+
def get_elements
|
123
|
+
@elements
|
124
|
+
end
|
125
|
+
|
126
|
+
def to_json(_options = {})
|
127
|
+
json_element = []
|
128
|
+
@elements.each do |element|
|
129
|
+
json_element << element unless element.nil?
|
130
|
+
end
|
131
|
+
|
132
|
+
json_array = {}
|
133
|
+
|
134
|
+
json_array["type"] = "page"
|
135
|
+
|
136
|
+
json_array["pageWidth"] = @page_width unless @page_width.nil?
|
137
|
+
|
138
|
+
json_array["pageHeight"] = @page_height unless @page_height.nil?
|
139
|
+
|
140
|
+
json_array["elements"] = json_element
|
141
|
+
|
142
|
+
#---------------------------------------------------
|
143
|
+
json_array["templateId"] = @_template_id unless @_template_id.nil?
|
144
|
+
|
145
|
+
json_array["resourceName"] = @resource_name unless @resource_name.nil?
|
146
|
+
|
147
|
+
json_array["id"] = @id unless @id.nil?
|
148
|
+
|
149
|
+
JSON.pretty_generate(json_array)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
# Represents different types of the page orientation.
|
4
|
+
#
|
5
|
+
class PageOrientation
|
6
|
+
|
7
|
+
#
|
8
|
+
# Page Orientation of portrait.
|
9
|
+
#
|
10
|
+
PORTRAIT = "Portrait".freeze
|
11
|
+
|
12
|
+
#
|
13
|
+
# Page Orientation of landscape.
|
14
|
+
#
|
15
|
+
LANDSCAPE = "Landscape".freeze
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,127 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
# Represents different types of the page size.
|
4
|
+
#
|
5
|
+
class PageSize
|
6
|
+
|
7
|
+
#
|
8
|
+
# Page Size of A3.
|
9
|
+
#
|
10
|
+
A3 = "A3".freeze
|
11
|
+
|
12
|
+
#
|
13
|
+
# Page Size of A4.
|
14
|
+
#
|
15
|
+
A4 = "A4".freeze
|
16
|
+
|
17
|
+
#
|
18
|
+
# Page Size of A5.
|
19
|
+
#
|
20
|
+
A5 = "A5".freeze
|
21
|
+
|
22
|
+
#
|
23
|
+
# Page Size of A5.
|
24
|
+
#
|
25
|
+
A6 = "A6".freeze
|
26
|
+
|
27
|
+
#
|
28
|
+
# Page Size of B3.
|
29
|
+
#
|
30
|
+
B3 = "B3".freeze
|
31
|
+
|
32
|
+
#
|
33
|
+
# Page Size of B4.
|
34
|
+
#
|
35
|
+
B4 = "B4".freeze
|
36
|
+
|
37
|
+
#
|
38
|
+
# Page Size of B5.
|
39
|
+
#
|
40
|
+
B5 = "B5".freeze
|
41
|
+
|
42
|
+
#
|
43
|
+
# Page Size of B5JIS.
|
44
|
+
#
|
45
|
+
B5JIS = "B5JIS".freeze
|
46
|
+
|
47
|
+
#
|
48
|
+
# Page Size of DoublePostcard.
|
49
|
+
#
|
50
|
+
DOUBLEPOSTCARD = "DoublePostcard".freeze
|
51
|
+
|
52
|
+
#
|
53
|
+
# Page Size of Envelope10.
|
54
|
+
#
|
55
|
+
ENVELOPE10 = "Envelope10".freeze
|
56
|
+
|
57
|
+
#
|
58
|
+
# Page Size of EnvelopeDL.
|
59
|
+
#
|
60
|
+
ENVELOPEDL = "EnvelopeDL".freeze
|
61
|
+
|
62
|
+
#
|
63
|
+
# Page Size of EnvelopeC5.
|
64
|
+
#
|
65
|
+
ENVELOPEC5 = "EnvelopeC5".freeze
|
66
|
+
|
67
|
+
#
|
68
|
+
# Page Size of EnvelopeB5.
|
69
|
+
#
|
70
|
+
ENVELOPEB5 = "EnvelopeB5".freeze
|
71
|
+
|
72
|
+
#
|
73
|
+
# Page Size of EnvelopeMonarch.
|
74
|
+
#
|
75
|
+
ENVELOPEMONARCH = "EnvelopeMonarch".freeze
|
76
|
+
|
77
|
+
#
|
78
|
+
# Page Size of Executive.
|
79
|
+
#
|
80
|
+
EXECUTIVE = "Executive".freeze
|
81
|
+
|
82
|
+
#
|
83
|
+
# Page Size of Legal.
|
84
|
+
#
|
85
|
+
LEGAL = "Legal".freeze
|
86
|
+
|
87
|
+
#
|
88
|
+
# Page Size of Folio.
|
89
|
+
#
|
90
|
+
FOLIO = "Folio".freeze
|
91
|
+
|
92
|
+
#
|
93
|
+
# Page Size of Letter.
|
94
|
+
#
|
95
|
+
LETTER = "Letter".freeze
|
96
|
+
|
97
|
+
#
|
98
|
+
# Page Size of Postcard.
|
99
|
+
#
|
100
|
+
POSTCARD = "Postcard".freeze
|
101
|
+
|
102
|
+
#
|
103
|
+
# Page Size of PRC16K.
|
104
|
+
#
|
105
|
+
PRC16K = "PRC16K".freeze
|
106
|
+
|
107
|
+
#
|
108
|
+
# Page Size of PRC32K.
|
109
|
+
#
|
110
|
+
PRC32K = "PRC32K".freeze
|
111
|
+
|
112
|
+
#
|
113
|
+
# Page Size of Quatro.
|
114
|
+
#
|
115
|
+
QUATRO = "Quatro".freeze
|
116
|
+
|
117
|
+
#
|
118
|
+
# Page Size of Statement.
|
119
|
+
#
|
120
|
+
STATEMENT = "Statement".freeze
|
121
|
+
|
122
|
+
#
|
123
|
+
# Page Size of Tabloid.
|
124
|
+
#
|
125
|
+
TABLOID = "Tabloid".freeze
|
126
|
+
end
|
127
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
#
|
4
|
+
# Specifies type of page zoom.
|
5
|
+
#
|
6
|
+
#
|
7
|
+
class PageZoom
|
8
|
+
#
|
9
|
+
# Keep unchanged.
|
10
|
+
#
|
11
|
+
RETAIN = 'retain'.freeze
|
12
|
+
|
13
|
+
#
|
14
|
+
# Fit page in window.
|
15
|
+
#
|
16
|
+
FIT_PAGE = 'fitPage'.freeze
|
17
|
+
|
18
|
+
#
|
19
|
+
# Fit width of page in window.
|
20
|
+
#
|
21
|
+
FIT_WIDTH = 'fitWidth'.freeze
|
22
|
+
|
23
|
+
#
|
24
|
+
# Fit height of page in window.
|
25
|
+
#
|
26
|
+
FIT_HEIGHT = 'fitHeight'.freeze
|
27
|
+
|
28
|
+
#
|
29
|
+
# Fit all elements of page in window.
|
30
|
+
#
|
31
|
+
FIT_BOX = 'fitBox'.freeze
|
32
|
+
end
|
33
|
+
end
|