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,105 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
require_relative "Element"
|
3
|
+
require_relative "ElementType"
|
4
|
+
require_relative "TextBarcodeElement"
|
5
|
+
|
6
|
+
#
|
7
|
+
# Represents a Code 128 barcode element.
|
8
|
+
#
|
9
|
+
# This class can be used to place a Code 128 barcode on a page.
|
10
|
+
#
|
11
|
+
class Code128BarcodeElement < TextBarcodeElement
|
12
|
+
#
|
13
|
+
# Initializes a new instance of the Code128BarcodeElement class.
|
14
|
+
#
|
15
|
+
# Code sets can be specified along with data, in order to do this ProcessTilde property needs to be set
|
16
|
+
# to true. Example value: '~BHello ~AWORLD 1~C2345', where ~A, ~B and ~C representing code sets A, B and
|
17
|
+
# C respectively. However if any inline code set has invalid characters it will be shifted to an appropriate
|
18
|
+
# code set.
|
19
|
+
#
|
20
|
+
# @param value [String] The value of the barcode.
|
21
|
+
# @param placement [String] The placement of the barcode on the page.
|
22
|
+
# @param height [float] The height of the barcode.
|
23
|
+
# @param x_offset [float] The X coordinate of the barcode.
|
24
|
+
# @param y_offset [float] The Y coordinate of the barcode.
|
25
|
+
#
|
26
|
+
def initialize(value, height, placement = ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0)
|
27
|
+
@ucc_ean128 = false
|
28
|
+
@process_tilde = false
|
29
|
+
@_type = ElementType::CODE128_BARCODE
|
30
|
+
super(value, placement, x_offset, y_offset)
|
31
|
+
@height = height
|
32
|
+
end
|
33
|
+
|
34
|
+
attr_accessor :_type
|
35
|
+
|
36
|
+
#
|
37
|
+
# Gets or sets the height of the barcode.
|
38
|
+
#
|
39
|
+
attr_accessor :height
|
40
|
+
|
41
|
+
#
|
42
|
+
# Gets or sets a boolean representing if the barcode is a UCC / EAN Code 128 barcode.
|
43
|
+
#
|
44
|
+
# If true an FNC1 code will be the first character in the barcode.
|
45
|
+
#
|
46
|
+
attr_accessor :ucc_ean128
|
47
|
+
|
48
|
+
#
|
49
|
+
# Gets or Sets a boolean indicating whether to process the tilde character.
|
50
|
+
#
|
51
|
+
# If true checks for fnc1 (~1) character in the barcode Value and checks for the inline code sets if present
|
52
|
+
# in the data to process. Example value: '~BHello ~AWORLD 1~C2345', where ~A, ~B and ~C representing code
|
53
|
+
# sets A, B and C respectively. However if any inline code set has invalid characters it will be shifted
|
54
|
+
# to an appropriate code set. '\' is used as an escape character to add ~.
|
55
|
+
#
|
56
|
+
attr_accessor :process_tilde
|
57
|
+
|
58
|
+
def to_json(_options = {})
|
59
|
+
json_array = {}
|
60
|
+
|
61
|
+
json_array["type"] = "code128Barcode"
|
62
|
+
|
63
|
+
json_array["height"] = @height unless @height.nil?
|
64
|
+
|
65
|
+
# if(@ucc_ean128 != nil)
|
66
|
+
json_array["uccEan128"] = @ucc_ean128
|
67
|
+
|
68
|
+
# if(@process_tilde != nil)
|
69
|
+
json_array["processTilde"] = @process_tilde
|
70
|
+
|
71
|
+
#----------------TextBarcodeElement---------------------------------
|
72
|
+
json_array["font"] = @_font_name unless @_font_name.nil?
|
73
|
+
|
74
|
+
json_array["textColor"] = @text_color._color_string if !@text_color.nil? && !@text_color._color_string.nil?
|
75
|
+
|
76
|
+
json_array["fontSize"] = @font_size unless @font_size.nil?
|
77
|
+
|
78
|
+
json_array["showText"] = @show_text if @show_text != "nil"
|
79
|
+
|
80
|
+
#----------------barcodeElement--------------------------------
|
81
|
+
|
82
|
+
json_array["color"] = @color._color_string if !@color.nil? && !@color._color_string.nil?
|
83
|
+
|
84
|
+
json_array["xDimension"] = @x_dimension unless @x_dimension.nil?
|
85
|
+
|
86
|
+
json_array["value"] = @value unless @value.nil?
|
87
|
+
|
88
|
+
# ------------element---------------------
|
89
|
+
|
90
|
+
json_array["placement"] = @placement unless @placement.nil?
|
91
|
+
|
92
|
+
json_array["xOffset"] = @x_offset unless @x_offset.nil?
|
93
|
+
|
94
|
+
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
95
|
+
|
96
|
+
# if(@even_pages != nil)
|
97
|
+
json_array["evenPages"] = @even_pages
|
98
|
+
|
99
|
+
# if(@odd_pages != nil)
|
100
|
+
json_array["oddPages"] = @odd_pages
|
101
|
+
|
102
|
+
JSON.pretty_generate(json_array)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
require_relative "TextBarcodeElement"
|
3
|
+
require_relative "ElementPlacement"
|
4
|
+
require_relative "ElementType"
|
5
|
+
|
6
|
+
#
|
7
|
+
# Represents a Code 2 of 5 barcode element.
|
8
|
+
#
|
9
|
+
# This class can be used to place a Code 2 of 5 barcode on a page.
|
10
|
+
#
|
11
|
+
class Code25BarcodeElement < TextBarcodeElement
|
12
|
+
#
|
13
|
+
# Initializes a new instance of the Code25BarcodeElement class.
|
14
|
+
#
|
15
|
+
# @param value [String] The value of the barcode.
|
16
|
+
# @param placement [String] The placement of the barcode on the page.
|
17
|
+
# @param height [float] The height of the barcode.
|
18
|
+
# @param x_offset [float] The X coordinate of the barcode.
|
19
|
+
# @param y_offset [float] The Y coordinate of the barcode.
|
20
|
+
#
|
21
|
+
def initialize(value, height, placement = ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0)
|
22
|
+
super(value, placement, x_offset, y_offset)
|
23
|
+
@height = height
|
24
|
+
@_type = ElementType::CODE25_BARCODE
|
25
|
+
end
|
26
|
+
|
27
|
+
attr_accessor :_type
|
28
|
+
|
29
|
+
#
|
30
|
+
# Gets or sets the height of the barcode.
|
31
|
+
#
|
32
|
+
attr_accessor :height
|
33
|
+
|
34
|
+
def to_json(_options = {})
|
35
|
+
json_array = {}
|
36
|
+
|
37
|
+
json_array["type"] = "code25Barcode"
|
38
|
+
|
39
|
+
json_array["height"] = @height unless @height.nil?
|
40
|
+
|
41
|
+
#----------------TextBarcodeElement---------------------------------
|
42
|
+
json_array["font"] = @_font_name unless @_font_name.nil?
|
43
|
+
|
44
|
+
json_array["textColor"] = @text_color._color_string if !@text_color.nil? && !@text_color._color_string.nil?
|
45
|
+
|
46
|
+
json_array["fontSize"] = @font_size unless @font_size.nil?
|
47
|
+
|
48
|
+
json_array["showText"] = @show_text if @show_text != "nil"
|
49
|
+
|
50
|
+
#----------------barcodeElement--------------------------------
|
51
|
+
|
52
|
+
json_array["color"] = @color._color_string if !@color.nil? && !@color._color_string.nil?
|
53
|
+
|
54
|
+
json_array["xDimension"] = @x_dimension unless @x_dimension.nil?
|
55
|
+
|
56
|
+
json_array["value"] = @value unless @value.nil?
|
57
|
+
|
58
|
+
# ------------element---------------------
|
59
|
+
|
60
|
+
json_array["placement"] = @placement unless @placement.nil?
|
61
|
+
|
62
|
+
json_array["xOffset"] = @x_offset unless @x_offset.nil?
|
63
|
+
|
64
|
+
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
65
|
+
|
66
|
+
# if(@even_pages != nil)
|
67
|
+
json_array["evenPages"] = @even_pages
|
68
|
+
|
69
|
+
# if(@odd_pages != nil)
|
70
|
+
json_array["oddPages"] = @odd_pages
|
71
|
+
|
72
|
+
JSON.pretty_generate(json_array)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
require_relative "TextBarcodeElement"
|
3
|
+
require_relative "ElementPlacement"
|
4
|
+
require_relative "ElementType"
|
5
|
+
|
6
|
+
#
|
7
|
+
# Represents a Code 3 of 9 barcode element.
|
8
|
+
#
|
9
|
+
# This class can be used to place a Code 3 of 9 barcode on a page.
|
10
|
+
#
|
11
|
+
class Code39BarcodeElement < TextBarcodeElement
|
12
|
+
#
|
13
|
+
# Initializes a new instance of the Code39BarcodeElement class.
|
14
|
+
#
|
15
|
+
# @param value [String] The value of the barcode.
|
16
|
+
# @param placement [String] The placement of the barcode on the page.
|
17
|
+
# @param height [float] The height of the barcode.
|
18
|
+
# @param x_offset [float] The X coordinate of the barcode.
|
19
|
+
# @param y_offset [float] The Y coordinate of the barcode.
|
20
|
+
#
|
21
|
+
def initialize(value, height, placement = ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0)
|
22
|
+
@_type = ElementType::CODE39_BARCODE
|
23
|
+
super(value, placement, x_offset, y_offset)
|
24
|
+
@height = height
|
25
|
+
end
|
26
|
+
|
27
|
+
attr_accessor :_type
|
28
|
+
|
29
|
+
#
|
30
|
+
# Gets or sets the height of the barcode.
|
31
|
+
#
|
32
|
+
attr_accessor :height
|
33
|
+
|
34
|
+
def to_json(_options = {})
|
35
|
+
json_array = {}
|
36
|
+
|
37
|
+
json_array["type"] = "code39Barcode"
|
38
|
+
|
39
|
+
json_array["height"] = @height unless @height.nil?
|
40
|
+
|
41
|
+
#----------------TextBarcodeElement---------------------------------
|
42
|
+
json_array["font"] = @_font_name unless @_font_name.nil?
|
43
|
+
|
44
|
+
json_array["textColor"] = @text_color._color_string if !@text_color.nil? && !@text_color._color_string.nil?
|
45
|
+
|
46
|
+
json_array["fontSize"] = @font_size unless @font_size.nil?
|
47
|
+
|
48
|
+
json_array["showText"] = @show_text if @show_text != "nil"
|
49
|
+
|
50
|
+
#----------------barcodeElement--------------------------------
|
51
|
+
|
52
|
+
json_array["color"] = @color._color_string if !@color.nil? && !@color._color_string.nil?
|
53
|
+
|
54
|
+
json_array["xDimension"] = @x_dimension unless @x_dimension.nil?
|
55
|
+
|
56
|
+
json_array["value"] = @value unless @value.nil?
|
57
|
+
|
58
|
+
# ------------element---------------------
|
59
|
+
|
60
|
+
json_array["placement"] = @placement unless @placement.nil?
|
61
|
+
|
62
|
+
json_array["xOffset"] = @x_offset unless @x_offset.nil?
|
63
|
+
|
64
|
+
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
65
|
+
|
66
|
+
# if(@even_pages != nil)
|
67
|
+
json_array["evenPages"] = @even_pages
|
68
|
+
|
69
|
+
# if(@odd_pages != nil)
|
70
|
+
json_array["oddPages"] = @odd_pages
|
71
|
+
|
72
|
+
JSON.pretty_generate(json_array)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
require_relative "TextBarcodeElement"
|
3
|
+
require_relative "ElementPlacement"
|
4
|
+
require_relative "ElementType"
|
5
|
+
|
6
|
+
#
|
7
|
+
# Represents a Code93 barcode element.
|
8
|
+
#
|
9
|
+
# This class can be used to place a Code93 barcode on a page.
|
10
|
+
#
|
11
|
+
class Code93BarcodeElement < TextBarcodeElement
|
12
|
+
#
|
13
|
+
# Initializes a new instance of the Code93BarcodeElement class.
|
14
|
+
#
|
15
|
+
# @param value [String] The value of the barcode.
|
16
|
+
# @param placement [String] The placement of the barcode on the page.
|
17
|
+
# @param height [float] The height of the barcode.
|
18
|
+
# @param x_offset [float] The X coordinate of the barcode.
|
19
|
+
# @param y_offset [float] The Y coordinate of the barcode.
|
20
|
+
#
|
21
|
+
def initialize(value, height, placement = ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0)
|
22
|
+
@_type = ElementType::CODE93_BARCODE
|
23
|
+
super(value, placement, x_offset, y_offset)
|
24
|
+
@height = height
|
25
|
+
end
|
26
|
+
|
27
|
+
attr_accessor :_type
|
28
|
+
|
29
|
+
#
|
30
|
+
# Gets or sets the height of the barcode.
|
31
|
+
#
|
32
|
+
attr_accessor :height
|
33
|
+
|
34
|
+
def to_json(_options = {})
|
35
|
+
json_array = {}
|
36
|
+
|
37
|
+
json_array["type"] = "code93Barcode"
|
38
|
+
|
39
|
+
json_array["height"] = @height unless @height.nil?
|
40
|
+
|
41
|
+
#----------------TextBarcodeElement---------------------------------
|
42
|
+
json_array["font"] = @_font_name unless @_font_name.nil?
|
43
|
+
|
44
|
+
json_array["textColor"] = @text_color._color_string if !@text_color.nil? && !@text_color._color_string.nil?
|
45
|
+
|
46
|
+
json_array["fontSize"] = @font_size unless @font_size.nil?
|
47
|
+
|
48
|
+
json_array["showText"] = @show_text if @show_text != "nil"
|
49
|
+
|
50
|
+
#----------------barcodeElement--------------------------------
|
51
|
+
|
52
|
+
json_array["color"] = @color._color_string if !@color.nil? && !@color._color_string.nil?
|
53
|
+
|
54
|
+
json_array["xDimension"] = @x_dimension unless @x_dimension.nil?
|
55
|
+
|
56
|
+
json_array["value"] = @value unless @value.nil?
|
57
|
+
|
58
|
+
# ------------element---------------------
|
59
|
+
|
60
|
+
json_array["placement"] = @placement unless @placement.nil?
|
61
|
+
|
62
|
+
json_array["xOffset"] = @x_offset unless @x_offset.nil?
|
63
|
+
|
64
|
+
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
65
|
+
|
66
|
+
# if(@even_pages != nil)
|
67
|
+
json_array["evenPages"] = @even_pages
|
68
|
+
|
69
|
+
# if(@odd_pages != nil)
|
70
|
+
json_array["oddPages"] = @odd_pages
|
71
|
+
|
72
|
+
JSON.pretty_generate(json_array)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
# The type of Compaction to encode.
|
4
|
+
#
|
5
|
+
class Compaction
|
6
|
+
#
|
7
|
+
# Byte Compaction.
|
8
|
+
#
|
9
|
+
BYTE = "byte".freeze
|
10
|
+
|
11
|
+
#
|
12
|
+
# Text Compaction.
|
13
|
+
#
|
14
|
+
TEXT = "text".freeze
|
15
|
+
|
16
|
+
#
|
17
|
+
# Numeric Compaction.
|
18
|
+
#
|
19
|
+
NUMERIC = "numeric".freeze
|
20
|
+
|
21
|
+
#
|
22
|
+
# All Compactions.
|
23
|
+
#
|
24
|
+
AUTO = "auto".freeze
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
require_relative "Dim2BarcodeElement"
|
3
|
+
require_relative "ElementPlacement"
|
4
|
+
require_relative "ElementType"
|
5
|
+
require_relative "DataMatrixSymbolSize"
|
6
|
+
require_relative "DataMatrixEncodingType"
|
7
|
+
require_relative "DataMatrixFunctionCharacter"
|
8
|
+
|
9
|
+
#
|
10
|
+
# Represents a Data Matrix barcode element.
|
11
|
+
#
|
12
|
+
# With some of the .Net runtime (example: .Net Core 2.0), the ECI values 20, 28, 29 and 30 will give the
|
13
|
+
# error 'No data is available for encoding 'code page number'. For information on defining a custom encoding,
|
14
|
+
# see the documentation for the Encoding.RegisterProvider method.'.
|
15
|
+
#
|
16
|
+
class DataMatrixBarcodeElement < Dim2BarcodeElement
|
17
|
+
#
|
18
|
+
# Initializes a new instance of the DataMatrixBarcodeElement class.
|
19
|
+
#
|
20
|
+
# @param value [String]|array The value of the barcode either as string or as byte array.
|
21
|
+
# @param placement [String] The placement of the barcode on the page.
|
22
|
+
# @param x_offset [float] The X coordinate of the barcode.
|
23
|
+
# @param y_offset [float] The Y coordinate of the barcode.
|
24
|
+
# @param symbol_size [String] The symbol size of the barcode.
|
25
|
+
# @param encoding_type [String] The encoding type of the barcode.
|
26
|
+
# @param function_character [String] The def character of the barcode.
|
27
|
+
#
|
28
|
+
def initialize(value, placement = ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0, symbol_size = DataMatrixSymbolSize::AUTO, encoding_type = DataMatrixEncodingType::AUTO, function_character = DataMatrixFunctionCharacter::NONE)
|
29
|
+
@process_tilde = false
|
30
|
+
@_type = ElementType::DATA_MATRIX_BARCODE
|
31
|
+
super(value, placement, x_offset, y_offset)
|
32
|
+
@_data_matrix_symbol_size = symbol_size
|
33
|
+
@_data_matrix_encoding_type = encoding_type
|
34
|
+
@_data_matrix_function_character = function_character
|
35
|
+
end
|
36
|
+
|
37
|
+
attr_accessor :_type, :_data_matrix_symbol_size, :_data_matrix_encoding_type, :_data_matrix_function_character
|
38
|
+
|
39
|
+
#
|
40
|
+
# Gets or sets whether to process tilde character.
|
41
|
+
#
|
42
|
+
# Setting true will check for ~ character and processes it for FNC1 or ECI characters. With some of the
|
43
|
+
# .Net runtime (example: .Net Core 2.0), the ECI values 20, 28, 29 and 30 will give the error 'No data
|
44
|
+
# is available for encoding 'code page number'. For information on defining a custom encoding, see the
|
45
|
+
# documentation for the Encoding.RegisterProvider method.'.
|
46
|
+
#
|
47
|
+
attr_accessor :process_tilde
|
48
|
+
|
49
|
+
def to_json(_options = {})
|
50
|
+
json_array = {}
|
51
|
+
|
52
|
+
json_array["type"] = "dataMatrixBarcode"
|
53
|
+
|
54
|
+
# if(@process_tilde != nil)
|
55
|
+
json_array["processTilde"] = @process_tilde
|
56
|
+
|
57
|
+
json_array["dataMatrixSymbolSize"] = @_data_matrix_symbol_size unless @_data_matrix_symbol_size.nil?
|
58
|
+
|
59
|
+
json_array["dataMatrixEncodingType"] = @_data_matrix_encoding_type unless @_data_matrix_encoding_type.nil?
|
60
|
+
|
61
|
+
unless @_data_matrix_function_character.nil?
|
62
|
+
json_array["dataMatrixFunctionCharacter"] =
|
63
|
+
@_data_matrix_function_character
|
64
|
+
end
|
65
|
+
|
66
|
+
#--------------Dim2BarcodeElement------------------------------
|
67
|
+
|
68
|
+
json_array["valueType"] = @_value_type unless @_value_type.nil?
|
69
|
+
|
70
|
+
#----------------barcodeElement--------------------------------
|
71
|
+
|
72
|
+
json_array["color"] = @color._color_string if !@color.nil? && !@color._color_string.nil?
|
73
|
+
|
74
|
+
json_array["xDimension"] = @x_dimension unless @x_dimension.nil?
|
75
|
+
|
76
|
+
json_array["value"] = @value unless @value.nil?
|
77
|
+
|
78
|
+
# ------------element---------------------
|
79
|
+
|
80
|
+
json_array["placement"] = @placement unless @placement.nil?
|
81
|
+
|
82
|
+
json_array["xOffset"] = @x_offset unless @x_offset.nil?
|
83
|
+
|
84
|
+
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
85
|
+
|
86
|
+
# if(@even_pages != nil)
|
87
|
+
json_array["evenPages"] = @even_pages
|
88
|
+
|
89
|
+
# if(@odd_pages != nil)
|
90
|
+
json_array["oddPages"] = @odd_pages
|
91
|
+
|
92
|
+
JSON.pretty_generate(json_array)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
# Specifies EncodingType for DataMatrix Barcode.
|
4
|
+
#
|
5
|
+
class DataMatrixEncodingType
|
6
|
+
#
|
7
|
+
# Calculates Encoding based on Value.
|
8
|
+
#
|
9
|
+
AUTO = 'auto'.freeze
|
10
|
+
|
11
|
+
#
|
12
|
+
# Calculates ASCII Encoding based on Value.
|
13
|
+
#
|
14
|
+
AUTO_ASCII = 'autoAscii'.freeze
|
15
|
+
|
16
|
+
#
|
17
|
+
# ASCII Encoding.
|
18
|
+
#
|
19
|
+
ASCII = 'ascii'.freeze
|
20
|
+
|
21
|
+
#
|
22
|
+
# Extended ASCII Encoding.
|
23
|
+
#
|
24
|
+
EXTENDED_ASCII = 'extendedAscii'.freeze
|
25
|
+
|
26
|
+
#
|
27
|
+
# Double digit Encoding.
|
28
|
+
#
|
29
|
+
DOUBLE_DIGIT = 'doubleDigit'.freeze
|
30
|
+
|
31
|
+
#
|
32
|
+
# C40 Encoding.
|
33
|
+
#
|
34
|
+
C40 = 'c40'.freeze
|
35
|
+
|
36
|
+
#
|
37
|
+
# Text Encoding.
|
38
|
+
#
|
39
|
+
TEXT = 'text'.freeze
|
40
|
+
|
41
|
+
#
|
42
|
+
# ANSI X12 Encoding.
|
43
|
+
#
|
44
|
+
ANSI_X12 = 'ansiX12'.freeze
|
45
|
+
|
46
|
+
#
|
47
|
+
# EDIFACT Encoding.
|
48
|
+
#
|
49
|
+
EDIFACT = 'edifact'.freeze
|
50
|
+
|
51
|
+
#
|
52
|
+
# Base256 Encoding.
|
53
|
+
#
|
54
|
+
BASE256 = 'base256'.freeze
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
# Specifies the Function Character for a DataMatrix Barcode.
|
4
|
+
#
|
5
|
+
class DataMatrixFunctionCharacter
|
6
|
+
#
|
7
|
+
# Macro 05 Character.
|
8
|
+
#
|
9
|
+
MACRO05 = 'macro05'.freeze
|
10
|
+
|
11
|
+
#
|
12
|
+
# Macro 06 Character.
|
13
|
+
#
|
14
|
+
MACRO06 = 'macro06'.freeze
|
15
|
+
|
16
|
+
#
|
17
|
+
# ReaderProgramming Character.
|
18
|
+
#
|
19
|
+
READER_PROGRAMMING = 'readerProgramming'.freeze
|
20
|
+
|
21
|
+
#
|
22
|
+
# FNC1 Character.
|
23
|
+
#
|
24
|
+
FNC1 = 'fnC1'.freeze
|
25
|
+
|
26
|
+
#
|
27
|
+
# None.
|
28
|
+
#
|
29
|
+
NONE = 'none'.freeze
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,161 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
# Specifies the symbol size of a DataMatrix Barcode.
|
4
|
+
#
|
5
|
+
class DataMatrixSymbolSize
|
6
|
+
#
|
7
|
+
# Calculates symbol size based on the value.
|
8
|
+
#
|
9
|
+
AUTO = 'auto'.freeze
|
10
|
+
|
11
|
+
#
|
12
|
+
# 10 rows by 10 columns.
|
13
|
+
#
|
14
|
+
R10_X_C10 = 'r10xC10'.freeze
|
15
|
+
|
16
|
+
#
|
17
|
+
# 12 rows by 12 columns.
|
18
|
+
#
|
19
|
+
R12_X_C12 = 'r12xC12'.freeze
|
20
|
+
|
21
|
+
#
|
22
|
+
# 14 rows by 14 columns.
|
23
|
+
#
|
24
|
+
R14_X_C14 = 'r14xC14'.freeze
|
25
|
+
|
26
|
+
#
|
27
|
+
# 16 rows by 16 columns.
|
28
|
+
#
|
29
|
+
R16_X_C16 = 'r16xC16'.freeze
|
30
|
+
|
31
|
+
#
|
32
|
+
# 18 rows by 18 columns.
|
33
|
+
#
|
34
|
+
R18_X_C18 = 'r18xC18'.freeze
|
35
|
+
|
36
|
+
#
|
37
|
+
# 20 rows by 20 columns.
|
38
|
+
#
|
39
|
+
R20_X_C20 = 'r20xC20'.freeze
|
40
|
+
|
41
|
+
#
|
42
|
+
# 22 rows by 22 columns.
|
43
|
+
#
|
44
|
+
R22_X_C22 = 'r22xC22'.freeze
|
45
|
+
|
46
|
+
#
|
47
|
+
# 24 rows by 24 columns.
|
48
|
+
#
|
49
|
+
R24_X_C24 = 'r24xC24'.freeze
|
50
|
+
|
51
|
+
#
|
52
|
+
# 26 rows by 26 columns.
|
53
|
+
#
|
54
|
+
R26_X_C26 = 'r26xC26'.freeze
|
55
|
+
|
56
|
+
#
|
57
|
+
# 32 rows by 32 columns.
|
58
|
+
#
|
59
|
+
R32_X_C32 = 'r32xC32'.freeze
|
60
|
+
|
61
|
+
#
|
62
|
+
# 36 rows by 36 columns.
|
63
|
+
#
|
64
|
+
R36_X_C36 = 'r36xC36'.freeze
|
65
|
+
|
66
|
+
#
|
67
|
+
# 40 rows by 40 columns.
|
68
|
+
#
|
69
|
+
R40_X_C40 = 'r40xC40'.freeze
|
70
|
+
|
71
|
+
#
|
72
|
+
# 44 rows by 44 columns.
|
73
|
+
#
|
74
|
+
R44_X_C44 = 'r44xC44'.freeze
|
75
|
+
|
76
|
+
#
|
77
|
+
# 48 rows by 48 columns.
|
78
|
+
#
|
79
|
+
R48_X_C48 = 'r48xC48'.freeze
|
80
|
+
|
81
|
+
#
|
82
|
+
# 52 rows by 52 columns.
|
83
|
+
#
|
84
|
+
R52_X_C52 = 'r52xC52'.freeze
|
85
|
+
|
86
|
+
#
|
87
|
+
# 64 rows by 64 columns.
|
88
|
+
#
|
89
|
+
R64_X_C64 = 'r64xC64'.freeze
|
90
|
+
|
91
|
+
#
|
92
|
+
# 72 rows by 72 columns.
|
93
|
+
#
|
94
|
+
R72_X_C72 = 'r72xC72'.freeze
|
95
|
+
|
96
|
+
#
|
97
|
+
# 80 rows by 80 columns.
|
98
|
+
#
|
99
|
+
R80_X_C80 = 'r80xC80'.freeze
|
100
|
+
|
101
|
+
#
|
102
|
+
# 88 rows by 88 columns.
|
103
|
+
#
|
104
|
+
R88_X_C88 = 'r88xC88'.freeze
|
105
|
+
|
106
|
+
#
|
107
|
+
# 96 rows by 96 columns.
|
108
|
+
#
|
109
|
+
R96_X_C96 = 'r96xC96'.freeze
|
110
|
+
|
111
|
+
#
|
112
|
+
# 104 rows by 104 columns.
|
113
|
+
#
|
114
|
+
R104_X_C104 = 'r104xC104'.freeze
|
115
|
+
|
116
|
+
#
|
117
|
+
# 120 rows by 120 columns.
|
118
|
+
#
|
119
|
+
R120_X_C120 = 'r120xC120'.freeze
|
120
|
+
|
121
|
+
#
|
122
|
+
# 132 rows by 132 columns.
|
123
|
+
#
|
124
|
+
R132_X_C132 = 'r132xC132'.freeze
|
125
|
+
|
126
|
+
#
|
127
|
+
# 144 rows by 144 columns.
|
128
|
+
#
|
129
|
+
R144_X_C144 = 'r144xC144'.freeze
|
130
|
+
|
131
|
+
#
|
132
|
+
# 8 rows by 18 columns.
|
133
|
+
#
|
134
|
+
R8_X_C18 = 'r8xC18'.freeze
|
135
|
+
|
136
|
+
#
|
137
|
+
# 8 rows by 32 columns.
|
138
|
+
#
|
139
|
+
R8_X_C32 = 'r8xC32'.freeze
|
140
|
+
|
141
|
+
#
|
142
|
+
# 12 rows by 26 columns.
|
143
|
+
#
|
144
|
+
R12_X_C26 = 'r12xC26'.freeze
|
145
|
+
|
146
|
+
#
|
147
|
+
# 12 rows by 36 columns.
|
148
|
+
#
|
149
|
+
R12_X_C36 = 'r12xC36'.freeze
|
150
|
+
|
151
|
+
#
|
152
|
+
# 16 rows by 36 columns.
|
153
|
+
#
|
154
|
+
R16_X_C36 = 'r16xC36'.freeze
|
155
|
+
|
156
|
+
#
|
157
|
+
# 16 rows by 48 columns.
|
158
|
+
#
|
159
|
+
R16_X_C48 = 'r16xC48'.freeze
|
160
|
+
end
|
161
|
+
end
|