dynamicpdf_api 1.0.1 → 1.1.1
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 +4 -4
- data/lib/ruby_client/Elements/AztecBarcodeElement.rb +6 -10
- data/lib/ruby_client/Elements/Code11BarcodeElement.rb +3 -5
- data/lib/ruby_client/Elements/Code128BarcodeElement.rb +7 -11
- data/lib/ruby_client/Elements/Code25BarcodeElement.rb +3 -5
- data/lib/ruby_client/Elements/Code39BarcodeElement.rb +4 -5
- data/lib/ruby_client/Elements/Code93BarcodeElement.rb +3 -5
- data/lib/ruby_client/Elements/DataMatrixBarcodeElement.rb +4 -7
- data/lib/ruby_client/Elements/Element.rb +2 -2
- data/lib/ruby_client/Elements/Gs1DataBarBarcodeElement.rb +3 -5
- data/lib/ruby_client/Elements/Iata25BarcodeElement.rb +5 -8
- data/lib/ruby_client/Elements/MsiBarcodeElement.rb +3 -5
- data/lib/ruby_client/Elements/Pdf417BarcodeElement.rb +6 -10
- data/lib/ruby_client/Elements/QrCodeElement.rb +2 -4
- data/lib/ruby_client/Elements/StackedGs1DataBarBarcodeElement.rb +3 -5
- data/lib/ruby_client/Elements/TextBarcodeElement.rb +1 -1
- data/lib/ruby_client/FormField.rb +4 -12
- data/lib/ruby_client/Imaging/BmpColorFormat.rb +20 -0
- data/lib/ruby_client/Imaging/BmpImageFormat.rb +32 -0
- data/lib/ruby_client/Imaging/BmpMonochromeColorFormat.rb +37 -0
- data/lib/ruby_client/Imaging/ColorFormat.rb +18 -0
- data/lib/ruby_client/Imaging/ColorFormatType.rb +31 -0
- data/lib/ruby_client/Imaging/CompressionType.rb +16 -0
- data/lib/ruby_client/Imaging/DitheringAlgorithm.rb +21 -0
- data/lib/ruby_client/Imaging/DpiImageSize.rb +36 -0
- data/lib/ruby_client/Imaging/FixedImageSize.rb +39 -0
- data/lib/ruby_client/Imaging/GifImageFormat.rb +33 -0
- data/lib/ruby_client/Imaging/ImageFormat.rb +31 -0
- data/lib/ruby_client/Imaging/ImageFormatType.rb +31 -0
- data/lib/ruby_client/Imaging/ImageSize.rb +26 -0
- data/lib/ruby_client/Imaging/ImageSizeType.rb +26 -0
- data/lib/ruby_client/Imaging/ImageSizeUnit.rb +21 -0
- data/lib/ruby_client/Imaging/JpegImageFormat.rb +31 -0
- data/lib/ruby_client/Imaging/MaxImageSize.rb +38 -0
- data/lib/ruby_client/Imaging/PdfImage.rb +210 -0
- data/lib/ruby_client/Imaging/PdfImageResponse.rb +40 -0
- data/lib/ruby_client/Imaging/PercentageImageSize.rb +35 -0
- data/lib/ruby_client/Imaging/PngColorFormat.rb +18 -0
- data/lib/ruby_client/Imaging/PngImageFormat.rb +33 -0
- data/lib/ruby_client/Imaging/PngIndexedColorFormat.rb +32 -0
- data/lib/ruby_client/Imaging/PngMonochromeColorFormat.rb +23 -0
- data/lib/ruby_client/Imaging/QuantizationAlgorithm.rb +26 -0
- data/lib/ruby_client/Imaging/TiffColorFormat.rb +17 -0
- data/lib/ruby_client/Imaging/TiffImageFormat.rb +34 -0
- data/lib/ruby_client/Imaging/TiffIndexedColorFormat.rb +37 -0
- data/lib/ruby_client/Imaging/TiffMonochromeColorFormat.rb +40 -0
- data/lib/ruby_client/MergeOptions.rb +30 -30
- data/lib/ruby_client/Outline.rb +0 -2
- data/lib/ruby_client/Pdf.rb +22 -3
- data/lib/ruby_client/PdfInput.rb +1 -1
- data/lib/ruby_client/PdfInstructions.rb +3 -3
- data/lib/ruby_client/version.rb +1 -1
- data/lib/ruby_client.rb +29 -0
- metadata +31 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4109120bdd17cb9a250a144ac5d70ab3bd76f159cde2a464ea2bb6b46277c3a
|
4
|
+
data.tar.gz: 1b0c03015bd985f960553f505086efc7ebf744e7811d7d5631c1cb3d5ec1aaba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c02430211c4ca94e5e9011fecee5a5cc8117127f1a1526b03f58dd8d81746964e9a81e1ee00c00028e743a75710f5f0a110119f992602d11308001619a93db15
|
7
|
+
data.tar.gz: d3d4145f7c2718dca04d42657d81b72f67ca173f12f96456fb27ec50fb4dc6c26a9b3a7447f9e2b792cfffb25ff797d51a7ad59b143488d1690646e8ddd93bfb
|
@@ -24,10 +24,10 @@ module DynamicPDFApi
|
|
24
24
|
#
|
25
25
|
def initialize(value, placement = ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0)
|
26
26
|
@_type = ElementType::AZTEC_BARCODE
|
27
|
-
@process_tilde =
|
27
|
+
@process_tilde = nil
|
28
28
|
@symbol_size = nil
|
29
29
|
@aztec_error_correction = 0
|
30
|
-
@reader_initialization_symbol =
|
30
|
+
@reader_initialization_symbol = nil
|
31
31
|
super(value, placement, x_offset, y_offset)
|
32
32
|
end
|
33
33
|
|
@@ -71,15 +71,13 @@ module DynamicPDFApi
|
|
71
71
|
|
72
72
|
json_array["type"] = "aztecBarcode"
|
73
73
|
|
74
|
-
|
75
|
-
json_array["processTilde"] = @process_tilde
|
74
|
+
json_array["processTilde"] = @process_tilde unless @process_tilde.nil?
|
76
75
|
|
77
76
|
json_array["symbolSize"] = @symbol_size unless @symbol_size.nil?
|
78
77
|
|
79
78
|
json_array["aztecErrorCorrection"] = @aztec_error_correction unless @aztec_error_correction.nil?
|
80
79
|
|
81
|
-
|
82
|
-
json_array["readerInitializationSymbol"] = @reader_initialization_symbol
|
80
|
+
json_array["readerInitializationSymbol"] = @reader_initialization_symbol unless @reader_initialization_symbol.nil?
|
83
81
|
|
84
82
|
#--------------Dim2BarcodeElement------------------------------
|
85
83
|
|
@@ -101,11 +99,9 @@ module DynamicPDFApi
|
|
101
99
|
|
102
100
|
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
103
101
|
|
104
|
-
|
105
|
-
json_array["evenPages"] = @even_pages
|
102
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
106
103
|
|
107
|
-
|
108
|
-
json_array["oddPages"] = @odd_pages
|
104
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
109
105
|
|
110
106
|
JSON.pretty_generate(json_array)
|
111
107
|
end
|
@@ -47,7 +47,7 @@ module DynamicPDFApi
|
|
47
47
|
|
48
48
|
json_array["fontSize"] = @font_size unless @font_size.nil?
|
49
49
|
|
50
|
-
json_array["showText"] = @show_text
|
50
|
+
json_array["showText"] = @show_text unless @show_text.nil?
|
51
51
|
|
52
52
|
#----------------barcodeElement--------------------------------
|
53
53
|
|
@@ -65,11 +65,9 @@ module DynamicPDFApi
|
|
65
65
|
|
66
66
|
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
67
67
|
|
68
|
-
|
69
|
-
json_array["evenPages"] = @even_pages
|
68
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
70
69
|
|
71
|
-
|
72
|
-
json_array["oddPages"] = @odd_pages
|
70
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
73
71
|
|
74
72
|
JSON.pretty_generate(json_array)
|
75
73
|
end
|
@@ -24,8 +24,8 @@ module DynamicPDFApi
|
|
24
24
|
# @param y_offset [float] The Y coordinate of the barcode.
|
25
25
|
#
|
26
26
|
def initialize(value, height, placement = ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0)
|
27
|
-
@ucc_ean128 =
|
28
|
-
@process_tilde =
|
27
|
+
@ucc_ean128 = nil
|
28
|
+
@process_tilde = nil
|
29
29
|
@_type = ElementType::CODE128_BARCODE
|
30
30
|
super(value, placement, x_offset, y_offset)
|
31
31
|
@height = height
|
@@ -62,11 +62,9 @@ module DynamicPDFApi
|
|
62
62
|
|
63
63
|
json_array["height"] = @height unless @height.nil?
|
64
64
|
|
65
|
-
|
66
|
-
json_array["uccEan128"] = @ucc_ean128
|
65
|
+
json_array["uccEan128"] = @ucc_ean128 unless @ucc_ean128.nil?
|
67
66
|
|
68
|
-
|
69
|
-
json_array["processTilde"] = @process_tilde
|
67
|
+
json_array["processTilde"] = @process_tilde unless @process_tilde.nil?
|
70
68
|
|
71
69
|
#----------------TextBarcodeElement---------------------------------
|
72
70
|
json_array["font"] = @_font_name unless @_font_name.nil?
|
@@ -75,7 +73,7 @@ module DynamicPDFApi
|
|
75
73
|
|
76
74
|
json_array["fontSize"] = @font_size unless @font_size.nil?
|
77
75
|
|
78
|
-
json_array["showText"] = @show_text
|
76
|
+
json_array["showText"] = @show_text unless @show_text.nil?
|
79
77
|
|
80
78
|
#----------------barcodeElement--------------------------------
|
81
79
|
|
@@ -93,11 +91,9 @@ module DynamicPDFApi
|
|
93
91
|
|
94
92
|
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
95
93
|
|
96
|
-
|
97
|
-
json_array["evenPages"] = @even_pages
|
94
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
98
95
|
|
99
|
-
|
100
|
-
json_array["oddPages"] = @odd_pages
|
96
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
101
97
|
|
102
98
|
JSON.pretty_generate(json_array)
|
103
99
|
end
|
@@ -45,7 +45,7 @@ module DynamicPDFApi
|
|
45
45
|
|
46
46
|
json_array["fontSize"] = @font_size unless @font_size.nil?
|
47
47
|
|
48
|
-
json_array["showText"] = @show_text
|
48
|
+
json_array["showText"] = @show_text unless @show_text.nil?
|
49
49
|
|
50
50
|
#----------------barcodeElement--------------------------------
|
51
51
|
|
@@ -63,11 +63,9 @@ module DynamicPDFApi
|
|
63
63
|
|
64
64
|
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
65
65
|
|
66
|
-
|
67
|
-
json_array["evenPages"] = @even_pages
|
66
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
68
67
|
|
69
|
-
|
70
|
-
json_array["oddPages"] = @odd_pages
|
68
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
71
69
|
|
72
70
|
JSON.pretty_generate(json_array)
|
73
71
|
end
|
@@ -45,7 +45,7 @@ module DynamicPDFApi
|
|
45
45
|
|
46
46
|
json_array["fontSize"] = @font_size unless @font_size.nil?
|
47
47
|
|
48
|
-
json_array["showText"] = @show_text
|
48
|
+
json_array["showText"] = @show_text unless @show_text.nil?
|
49
49
|
|
50
50
|
#----------------barcodeElement--------------------------------
|
51
51
|
|
@@ -63,11 +63,10 @@ module DynamicPDFApi
|
|
63
63
|
|
64
64
|
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
65
65
|
|
66
|
-
|
67
|
-
|
66
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
67
|
+
|
68
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
68
69
|
|
69
|
-
# if(@odd_pages != nil)
|
70
|
-
json_array["oddPages"] = @odd_pages
|
71
70
|
|
72
71
|
JSON.pretty_generate(json_array)
|
73
72
|
end
|
@@ -45,7 +45,7 @@ module DynamicPDFApi
|
|
45
45
|
|
46
46
|
json_array["fontSize"] = @font_size unless @font_size.nil?
|
47
47
|
|
48
|
-
json_array["showText"] = @show_text
|
48
|
+
json_array["showText"] = @show_text unless @show_text.nil?
|
49
49
|
|
50
50
|
#----------------barcodeElement--------------------------------
|
51
51
|
|
@@ -63,11 +63,9 @@ module DynamicPDFApi
|
|
63
63
|
|
64
64
|
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
65
65
|
|
66
|
-
|
67
|
-
json_array["evenPages"] = @even_pages
|
66
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
68
67
|
|
69
|
-
|
70
|
-
json_array["oddPages"] = @odd_pages
|
68
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
71
69
|
|
72
70
|
JSON.pretty_generate(json_array)
|
73
71
|
end
|
@@ -26,7 +26,7 @@ module DynamicPDFApi
|
|
26
26
|
# @param function_character [String] The def character of the barcode.
|
27
27
|
#
|
28
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 =
|
29
|
+
@process_tilde = nil
|
30
30
|
@_type = ElementType::DATA_MATRIX_BARCODE
|
31
31
|
super(value, placement, x_offset, y_offset)
|
32
32
|
@_data_matrix_symbol_size = symbol_size
|
@@ -51,8 +51,7 @@ module DynamicPDFApi
|
|
51
51
|
|
52
52
|
json_array["type"] = "dataMatrixBarcode"
|
53
53
|
|
54
|
-
|
55
|
-
json_array["processTilde"] = @process_tilde
|
54
|
+
json_array["processTilde"] = @process_tilde unless @process_tilde.nil?
|
56
55
|
|
57
56
|
json_array["dataMatrixSymbolSize"] = @_data_matrix_symbol_size unless @_data_matrix_symbol_size.nil?
|
58
57
|
|
@@ -83,11 +82,9 @@ module DynamicPDFApi
|
|
83
82
|
|
84
83
|
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
85
84
|
|
86
|
-
|
87
|
-
json_array["evenPages"] = @even_pages
|
85
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
88
86
|
|
89
|
-
|
90
|
-
json_array["oddPages"] = @odd_pages
|
87
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
91
88
|
|
92
89
|
JSON.pretty_generate(json_array)
|
93
90
|
end
|
@@ -46,7 +46,7 @@ module DynamicPDFApi
|
|
46
46
|
|
47
47
|
json_array["fontSize"] = @font_size unless @font_size.nil?
|
48
48
|
|
49
|
-
json_array["showText"] = @show_text
|
49
|
+
json_array["showText"] = @show_text unless @show_text.nil?
|
50
50
|
|
51
51
|
#----------------barcodeElement--------------------------------
|
52
52
|
|
@@ -64,11 +64,9 @@ module DynamicPDFApi
|
|
64
64
|
|
65
65
|
json_array["yOffset"] = @y_offset unless @y_offset.nil?
|
66
66
|
|
67
|
-
|
68
|
-
json_array["evenPages"] = @even_pages
|
67
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
69
68
|
|
70
|
-
|
71
|
-
json_array["oddPages"] = @odd_pages
|
69
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
72
70
|
|
73
71
|
JSON.pretty_generate(json_array)
|
74
72
|
end
|
@@ -19,7 +19,7 @@ module DynamicPDFApi
|
|
19
19
|
#
|
20
20
|
def initialize(value, height, placement= ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0)
|
21
21
|
@_type = ElementType::IATA25_BARCODE
|
22
|
-
@include_check_digit =
|
22
|
+
@include_check_digit = nil
|
23
23
|
@height = height
|
24
24
|
super(value, placement, x_offset, y_offset)
|
25
25
|
end
|
@@ -41,8 +41,7 @@ module DynamicPDFApi
|
|
41
41
|
|
42
42
|
json_array['type'] = 'iata25Barcode'
|
43
43
|
|
44
|
-
|
45
|
-
json_array['includeCheckDigit'] = @include_check_digit
|
44
|
+
json_array['includeCheckDigit'] = @include_check_digit unless @include_check_digit.nil?
|
46
45
|
|
47
46
|
json_array['height'] = @height unless @height.nil?
|
48
47
|
|
@@ -53,7 +52,7 @@ module DynamicPDFApi
|
|
53
52
|
|
54
53
|
json_array['fontSize'] = @font_size unless @font_size.nil?
|
55
54
|
|
56
|
-
json_array['showText'] = @show_text
|
55
|
+
json_array['showText'] = @show_text unless @show_text.nil?
|
57
56
|
|
58
57
|
#----------------barcodeElement--------------------------------
|
59
58
|
|
@@ -71,11 +70,9 @@ module DynamicPDFApi
|
|
71
70
|
|
72
71
|
json_array['yOffset'] = @y_offset unless @y_offset.nil?
|
73
72
|
|
74
|
-
|
75
|
-
json_array['evenPages'] = @even_pages
|
73
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
76
74
|
|
77
|
-
|
78
|
-
json_array['oddPages'] = @odd_pages
|
75
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
79
76
|
|
80
77
|
JSON.pretty_generate(json_array)
|
81
78
|
end
|
@@ -49,7 +49,7 @@ module DynamicPDFApi
|
|
49
49
|
|
50
50
|
json_array['fontSize'] = @font_size unless @font_size.nil?
|
51
51
|
|
52
|
-
json_array['showText'] = @show_text
|
52
|
+
json_array['showText'] = @show_text unless @show_text.nil?
|
53
53
|
|
54
54
|
#----------------barcodeElement--------------------------------
|
55
55
|
|
@@ -67,11 +67,9 @@ module DynamicPDFApi
|
|
67
67
|
|
68
68
|
json_array['yOffset'] = @y_offset unless @y_offset.nil?
|
69
69
|
|
70
|
-
|
71
|
-
json_array['evenPages'] = @even_pages
|
70
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
72
71
|
|
73
|
-
|
74
|
-
json_array['oddPages'] = @odd_pages
|
72
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
75
73
|
|
76
74
|
JSON.pretty_generate(json_array)
|
77
75
|
end
|
@@ -22,8 +22,8 @@ module DynamicPDFApi
|
|
22
22
|
def initialize(value, columns, placement= ElementPlacement::TOP_LEFT, x_offset = 0, y_offset = 0)
|
23
23
|
@columns = nil
|
24
24
|
@y_dimension = nil
|
25
|
-
@process_tilde =
|
26
|
-
@compact_pdf417 =
|
25
|
+
@process_tilde = nil
|
26
|
+
@compact_pdf417 = nil
|
27
27
|
@error_correction = nil
|
28
28
|
@compaction = nil
|
29
29
|
|
@@ -70,11 +70,9 @@ module DynamicPDFApi
|
|
70
70
|
|
71
71
|
json_array['yDimension'] = @y_dimension unless @y_dimension.nil?
|
72
72
|
|
73
|
-
|
74
|
-
json_array['processTilde'] = @process_tilde
|
73
|
+
json_array["processTilde"] = @process_tilde unless @process_tilde.nil?
|
75
74
|
|
76
|
-
|
77
|
-
json_array['compactPdf417'] = @compact_pdf417
|
75
|
+
json_array['compactPdf417'] = @compact_pdf417 unless @compact_pdf417.nil?
|
78
76
|
|
79
77
|
json_array['errorCorrection'] = @error_correction unless @error_correction.nil?
|
80
78
|
|
@@ -100,11 +98,9 @@ module DynamicPDFApi
|
|
100
98
|
|
101
99
|
json_array['yOffset'] = @y_offset unless @y_offset.nil?
|
102
100
|
|
103
|
-
|
104
|
-
json_array['evenPages'] = @even_pages
|
101
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
105
102
|
|
106
|
-
|
107
|
-
json_array['oddPages'] = @odd_pages
|
103
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
108
104
|
|
109
105
|
JSON.pretty_generate(json_array)
|
110
106
|
end
|
@@ -65,11 +65,9 @@ module DynamicPDFApi
|
|
65
65
|
|
66
66
|
json_array['yOffset'] = @y_offset unless @y_offset.nil?
|
67
67
|
|
68
|
-
|
69
|
-
json_array['evenPages'] = @even_pages
|
68
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
70
69
|
|
71
|
-
|
72
|
-
json_array['oddPages'] = @odd_pages
|
70
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
73
71
|
|
74
72
|
JSON.pretty_generate(json_array)
|
75
73
|
end
|
@@ -60,7 +60,7 @@ module DynamicPDFApi
|
|
60
60
|
|
61
61
|
json_array['fontSize'] = @font_size unless @font_size.nil?
|
62
62
|
|
63
|
-
json_array[
|
63
|
+
json_array["showText"] = @show_text unless @show_text.nil?
|
64
64
|
|
65
65
|
#----------------barcodeElement--------------------------------
|
66
66
|
|
@@ -78,11 +78,9 @@ module DynamicPDFApi
|
|
78
78
|
|
79
79
|
json_array['yOffset'] = @y_offset unless @y_offset.nil?
|
80
80
|
|
81
|
-
|
82
|
-
json_array['evenPages'] = @even_pages
|
81
|
+
json_array["evenPages"] = @even_pages unless @even_pages.nil?
|
83
82
|
|
84
|
-
|
85
|
-
json_array['oddPages'] = @odd_pages
|
83
|
+
json_array["oddPages"] = @odd_pages unless @odd_pages.nil?
|
86
84
|
|
87
85
|
JSON.pretty_generate(json_array)
|
88
86
|
end
|
@@ -42,21 +42,13 @@ module DynamicPDFApi
|
|
42
42
|
def to_json(_options = {})
|
43
43
|
json_array = {}
|
44
44
|
json_array['name'] = @name
|
45
|
-
json_array['value'] = @value
|
45
|
+
json_array['value'] = @value unless @value.nil?
|
46
46
|
|
47
|
-
json_array['flatten'] =
|
48
|
-
@flatten
|
49
|
-
else
|
50
|
-
false
|
51
|
-
end
|
47
|
+
json_array['flatten'] = @flatten unless @flatten.nil?
|
52
48
|
|
53
|
-
json_array['remove'] =
|
54
|
-
@remove
|
55
|
-
else
|
56
|
-
false
|
57
|
-
end
|
49
|
+
json_array['remove'] = @remove unless @remove.nil?
|
58
50
|
|
59
|
-
|
51
|
+
JSON.pretty_generate(json_array)
|
60
52
|
end
|
61
53
|
end
|
62
54
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
require_relative 'ColorFormat'
|
3
|
+
require_relative 'ColorFormatType'
|
4
|
+
|
5
|
+
#
|
6
|
+
# Base class for BMP color formats
|
7
|
+
#
|
8
|
+
class BmpColorFormat < ColorFormat
|
9
|
+
#
|
10
|
+
# Creates a new BmpColorFormat object with the given type.
|
11
|
+
#
|
12
|
+
def initialize(type)
|
13
|
+
if type != ColorFormatType::Monochrome
|
14
|
+
@type = ColorFormatType::RGB
|
15
|
+
else
|
16
|
+
@type = type
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
require_relative 'ImageFormat'
|
3
|
+
require_relative 'ImageFormatType'
|
4
|
+
|
5
|
+
#
|
6
|
+
# Represents BMP image format with color format.
|
7
|
+
#
|
8
|
+
class BmpImageFormat < ImageFormat
|
9
|
+
attr_accessor :color_format # Gets or sets the BmpColorFormat for BMP.
|
10
|
+
|
11
|
+
#
|
12
|
+
# Initializes a new instance of the BmpImageFormat class.
|
13
|
+
#
|
14
|
+
def initialize
|
15
|
+
super(ImageFormatType::BMP)
|
16
|
+
@color_format = nil
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# Returns a JSON representation of the BmpImageFormat object.
|
21
|
+
#
|
22
|
+
# @return [String] JSON string representing the BmpImageFormat object.
|
23
|
+
#
|
24
|
+
def to_json(_options = {})
|
25
|
+
json_array = {}
|
26
|
+
json_array['type'] = 'bmp'
|
27
|
+
|
28
|
+
json_array['colorFormat'] = @color_format
|
29
|
+
JSON.pretty_generate(json_array)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
require_relative 'BmpColorFormat'
|
3
|
+
require_relative 'ColorFormatType'
|
4
|
+
|
5
|
+
|
6
|
+
#
|
7
|
+
# Represents monochrome color format for BMP.
|
8
|
+
#
|
9
|
+
class BmpMonochromeColorFormat < BmpColorFormat
|
10
|
+
attr_accessor :black_threshold # Gets or sets the black threshold for monochrome BMP, ranges from 0-255.
|
11
|
+
attr_accessor :dithering_percent # Gets or sets the dithering percentage for BMP.
|
12
|
+
attr_accessor :dithering_algorithm # Gets or sets the dithering algorithm for BMP.
|
13
|
+
|
14
|
+
#
|
15
|
+
# Creates object for monochrome color format for BMP image format.
|
16
|
+
#
|
17
|
+
def initialize
|
18
|
+
super(ColorFormatType::Monochrome)
|
19
|
+
@black_threshold = nil
|
20
|
+
@dithering_percent = nil
|
21
|
+
@dithering_algorithm = nil
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# Returns a JSON representation of the BmpMonochromeColorFormat object.
|
26
|
+
#
|
27
|
+
# @return [String] JSON string representing the BmpMonochromeColorFormat object.
|
28
|
+
#
|
29
|
+
def to_json(_options = {})
|
30
|
+
json_array = {}
|
31
|
+
json_array['blackThreshold'] = @black_threshold
|
32
|
+
json_array['ditheringPercent'] = @dithering_percent
|
33
|
+
json_array['ditheringAlgorithm'] = @dithering_algorithm
|
34
|
+
JSON.pretty_generate(json_array)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
# Base class for all color formats.
|
4
|
+
#
|
5
|
+
class ColorFormat
|
6
|
+
#
|
7
|
+
# Initializes a new instance of ColorFormat.
|
8
|
+
#
|
9
|
+
def initialize
|
10
|
+
@type = nil
|
11
|
+
end
|
12
|
+
|
13
|
+
#
|
14
|
+
# Gets or sets the color format type.
|
15
|
+
#
|
16
|
+
attr_accessor :type
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
# Enum representing color formats.
|
4
|
+
#
|
5
|
+
class ColorFormatType
|
6
|
+
#
|
7
|
+
# RGB color format.
|
8
|
+
#
|
9
|
+
RGB = :Rgb.freeze
|
10
|
+
|
11
|
+
#
|
12
|
+
# RGBA color format.
|
13
|
+
#
|
14
|
+
RGBA = :Rgba.freeze
|
15
|
+
|
16
|
+
#
|
17
|
+
# Grayscale color format.
|
18
|
+
#
|
19
|
+
Grayscale = :Grayscale.freeze
|
20
|
+
|
21
|
+
#
|
22
|
+
# Monochrome color format.
|
23
|
+
#
|
24
|
+
Monochrome = :Monochrome.freeze
|
25
|
+
|
26
|
+
#
|
27
|
+
# Indexed color format.
|
28
|
+
#
|
29
|
+
Indexed = :Indexed.freeze
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
# Enum representing compression types.
|
4
|
+
#
|
5
|
+
class CompressionType
|
6
|
+
#
|
7
|
+
# CCIT Group 3 compression.
|
8
|
+
#
|
9
|
+
CcitGroup3 = :CcitGroup3.freeze
|
10
|
+
|
11
|
+
#
|
12
|
+
# CCIT Group 4 compression.
|
13
|
+
#
|
14
|
+
CcitGroup4 = :CcitGroup4.freeze
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module DynamicPDFApi
|
2
|
+
#
|
3
|
+
# Enum representing dithering algorithms.
|
4
|
+
#
|
5
|
+
class DitheringAlgorithm
|
6
|
+
#
|
7
|
+
# Floyd-Steinberg dithering algorithm.
|
8
|
+
#
|
9
|
+
FloydSteinberg = :FloydSteinberg.freeze
|
10
|
+
|
11
|
+
#
|
12
|
+
# Bayer dithering algorithm.
|
13
|
+
#
|
14
|
+
Bayer = :Bayer.freeze
|
15
|
+
|
16
|
+
#
|
17
|
+
# No dithering.
|
18
|
+
#
|
19
|
+
None = :None.freeze
|
20
|
+
end
|
21
|
+
end
|