dynamicpdf_api 1.1.0 → 1.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6f42bc787613e44286e726d180adfc0ea445d5398dfe16cedc82c493fc4ccd1a
4
- data.tar.gz: de16d1e726916f97f16113f877b39fae03e86d412af0adbdb993e5a4bfff0ec7
3
+ metadata.gz: 7606afef6a8e95caba5eb455e80d639e5677e5f8c461fa915f38dff459bddd07
4
+ data.tar.gz: d9ac229a6451da9c8395f90ebc299d95771ed98150690b35db53ac67ad1bf9d4
5
5
  SHA512:
6
- metadata.gz: ce716f34048b25deb919ba964523acb9fffc6933e646b8f0286d9995019541284fa2b0be5bf7aaa58ccf6303557ba15e6795306a8634ca01ff43a10805af5720
7
- data.tar.gz: 559e545b54529731b213a4a12b47c15717addefd878d447eeba751740f2cef2fc685624396e17564c315be32caaad62efa0fe4179f2510b6557e65d1534b1854
6
+ metadata.gz: 364f59d5200af9cd9797481f6240ed365c7541fea8d66d4387c881da919a8e13e3804011dac32959c9dee789d137c1a31da391623970b82f3901139ca04a3876
7
+ data.tar.gz: 42e982b35c3650b421dac10d14b945fdd309a62f74ead5e3a68b80ca46471be0ffc6f3e16ec8b207c46c3e83d2501d96a1d07512bbe529f04bbdb9365b832998
@@ -119,6 +119,9 @@ module DynamicPDFApi
119
119
  ret_object = PdfResponse.new(out_data)
120
120
  ret_object.is_successful = true
121
121
  else
122
+ if ret_object.status_code == '401'
123
+ raise "Invalid api key specified."
124
+ end
122
125
  out_data_json = JSON.parse(out_data)
123
126
  ret_object.error_json = out_data
124
127
  ret_object.error_message = if !out_data_json['message'].nil?
@@ -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 = false
27
+ @process_tilde = nil
28
28
  @symbol_size = nil
29
29
  @aztec_error_correction = 0
30
- @reader_initialization_symbol = false
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
- # if(@processTilde != nil)
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
- # if(@reader_initialization_symbol != nil)
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
- # if(@even_pages != nil)
105
- json_array["evenPages"] = @even_pages
102
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
106
103
 
107
- # if(@odd_pages != nil)
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 if @show_text != "nil"
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
- # if(@evenPages != nil)
69
- json_array["evenPages"] = @even_pages
68
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
70
69
 
71
- # if(@oddPages != nil)
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 = false
28
- @process_tilde = false
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
- # if(@ucc_ean128 != nil)
66
- json_array["uccEan128"] = @ucc_ean128
65
+ json_array["uccEan128"] = @ucc_ean128 unless @ucc_ean128.nil?
67
66
 
68
- # if(@process_tilde != nil)
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 if @show_text != "nil"
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
- # if(@even_pages != nil)
97
- json_array["evenPages"] = @even_pages
94
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
98
95
 
99
- # if(@odd_pages != nil)
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 if @show_text != "nil"
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
- # if(@even_pages != nil)
67
- json_array["evenPages"] = @even_pages
66
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
68
67
 
69
- # if(@odd_pages != nil)
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 if @show_text != "nil"
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
- # if(@even_pages != nil)
67
- json_array["evenPages"] = @even_pages
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 if @show_text != "nil"
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
- # if(@even_pages != nil)
67
- json_array["evenPages"] = @even_pages
66
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
68
67
 
69
- # if(@odd_pages != nil)
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 = false
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
- # if(@process_tilde != nil)
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
- # if(@even_pages != nil)
87
- json_array["evenPages"] = @even_pages
85
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
88
86
 
89
- # if(@odd_pages != nil)
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
@@ -6,8 +6,8 @@ module DynamicPDFApi
6
6
  #
7
7
  class Element
8
8
  def initialize(value = nil, placement = nil, x_offset = 0, y_offset = 0)
9
- @even_pages = false
10
- @odd_pages = false
9
+ @even_pages = nil
10
+ @odd_pages = nil
11
11
  @_text_font = nil
12
12
  @_resource = nil
13
13
  @_type = nil
@@ -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 if @show_text != "nil"
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
- # if(@even_pages != nil)
68
- json_array["evenPages"] = @even_pages
67
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
69
68
 
70
- # if(@odd_pages != nil)
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 = false
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
- # if(@IncludeCheckDigit != nil)
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 if @show_text != 'nil'
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
- # if(@even_pages != nil)
75
- json_array['evenPages'] = @even_pages
73
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
76
74
 
77
- # if(@odd_pages != nil)
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 if @show_text != 'nil'
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
- # if(@even_pages != nil)
71
- json_array['evenPages'] = @even_pages
70
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
72
71
 
73
- # if(@odd_pages != nil)
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 = false
26
- @compact_pdf417 = false
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
- # if(@process_tilde != nil)
74
- json_array['processTilde'] = @process_tilde
73
+ json_array["processTilde"] = @process_tilde unless @process_tilde.nil?
75
74
 
76
- # if(@CompactPdf417 != nil)
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
- # if(@even_pages != nil)
104
- json_array['evenPages'] = @even_pages
101
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
105
102
 
106
- # if(@odd_pages != nil)
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
- # if(@even_pages != nil)
69
- json_array['evenPages'] = @even_pages
68
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
70
69
 
71
- # if(@odd_pages != nil)
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['showText'] = @show_text if @show_text != 'nil'
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
- # if(@even_pages != nil)
82
- json_array['evenPages'] = @even_pages
81
+ json_array["evenPages"] = @even_pages unless @even_pages.nil?
83
82
 
84
- # if(@odd_pages != nil)
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
@@ -8,7 +8,7 @@ module DynamicPDFApi
8
8
  def initialize(value, placement, x_offset, y_offset)
9
9
  @text_color = nil
10
10
  @font_size = nil
11
- @show_text = 'nil'
11
+ @show_text = nil
12
12
  @_resource = nil
13
13
  @_text_font = nil
14
14
  @_font_name = nil
@@ -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'] = if !@flatten.nil?
48
- @flatten
49
- else
50
- false
51
- end
47
+ json_array['flatten'] = @flatten unless @flatten.nil?
52
48
 
53
- json_array['remove'] = if !@remove.nil?
54
- @remove
55
- else
56
- false
57
- end
49
+ json_array['remove'] = @remove unless @remove.nil?
58
50
 
59
- JSON.pretty_generate(json_array)
51
+ JSON.pretty_generate(json_array)
60
52
  end
61
53
  end
62
54
  end
@@ -53,6 +53,9 @@ module DynamicPDFApi
53
53
  if ret_object.status_code == '200'
54
54
  ret_object.is_successful = true
55
55
  else
56
+ if ret_object.status_code == '401'
57
+ raise "Invalid api key specified."
58
+ end
56
59
  out_data_json = JSON.parse(out_data)
57
60
  ret_object.error_json = out_data
58
61
  ret_object.error_message = if !out_data_json['message'].nil?
@@ -184,6 +184,10 @@ module DynamicPDFApi
184
184
  rasterizer_response.status_code = response.code
185
185
  rasterizer_response.is_successful = true
186
186
  else
187
+ if rasterizer_response.status_code == '401'
188
+ raise "Invalid api key specified."
189
+ end
190
+ out_data_json = JSON.parse(out_data)
187
191
  rasterizer_response.error_json = out_data
188
192
  rasterizer_response.error_message = if !out_data_json["message"].nil?
189
193
  out_data_json["message"]
@@ -4,21 +4,21 @@ module DynamicPDFApi
4
4
  #
5
5
  class MergeOptions
6
6
  def initialize
7
- @document_info = 'nil'
8
- @document_java_script = 'nil'
9
- @document_properties = 'nil'
10
- @embedded_files = 'nil'
11
- @form_fields = 'nil'
12
- @forms_xfa_data = 'nil'
13
- @logical_structure = 'nil'
14
- @open_action = 'nil'
15
- @optional_content_info = 'nil'
16
- @out_lines = 'nil'
17
- @output_intent = 'nil'
18
- @page_annotations = 'nil'
19
- @page_labels_and_sections = 'nil'
20
- @root_form_field = 'nil'
21
- @xmp_metadata = 'nil'
7
+ @document_info = nil
8
+ @document_java_script = nil
9
+ @document_properties = nil
10
+ @embedded_files = nil
11
+ @form_fields = nil
12
+ @forms_xfa_data = nil
13
+ @logical_structure = nil
14
+ @open_action = nil
15
+ @optional_content_info = nil
16
+ @out_lines = nil
17
+ @output_intent = nil
18
+ @page_annotations = nil
19
+ @page_labels_and_sections = nil
20
+ @root_form_field = nil
21
+ @xmp_metadata = nil
22
22
  end
23
23
 
24
24
  #
@@ -99,35 +99,35 @@ module DynamicPDFApi
99
99
  def to_json(_options = {})
100
100
  json_array = {}
101
101
 
102
- json_array['documentInfo'] = @document_info if @document_info != 'nil'
102
+ json_array['documentInfo'] = @document_info unless @document_info.nil?
103
103
 
104
- json_array['documentJavaScript'] = @document_java_script if @document_java_script != 'nil'
104
+ json_array['documentJavaScript'] = @document_java_script unless @document_java_script.nil?
105
105
 
106
- json_array['documentProperties'] = @document_properties if @document_properties != 'nil'
106
+ json_array['documentProperties'] = @document_properties unless @document_properties.nil?
107
107
 
108
- json_array['embeddedFiles'] = @embedded_files if @embedded_files != 'nil'
108
+ json_array['embeddedFiles'] = @embedded_files unless @embedded_files.nil?
109
109
 
110
- json_array['formFields'] = @form_fields if @form_fields != 'nil'
110
+ json_array['formFields'] = @form_fields unless @form_fields.nil?
111
111
 
112
- json_array['formsXfaData'] = @forms_xfa_data if @forms_xfa_data != 'nil'
112
+ json_array['formsXfaData'] = @forms_xfa_data unless @forms_xfa_data.nil?
113
113
 
114
- json_array['logicalStructure'] = @logical_structure if @logical_structure != 'nil'
114
+ json_array['logicalStructure'] = @logical_structure unless @logical_structure.nil?
115
115
 
116
- json_array['openAction'] = @open_action if @open_action != 'nil'
116
+ json_array['openAction'] = @open_action unless @open_action.nil?
117
117
 
118
- json_array['optionalContentInfo'] = @optional_content_info if @optional_content_info != 'nil'
118
+ json_array['optionalContentInfo'] = @optional_content_info unless @optional_content_info.nil?
119
119
 
120
- json_array['outlines'] = @out_lines if @out_lines != 'nil'
120
+ json_array['outlines'] = @out_lines unless @out_lines.nil?
121
121
 
122
- json_array['outputIntent'] = @output_intent if @output_intent != 'nil'
122
+ json_array['outputIntent'] = @output_intent unless @output_intent.nil?
123
123
 
124
- json_array['pageAnnotations'] = @page_annotations if @page_annotations != 'nil'
124
+ json_array['pageAnnotations'] = @page_annotations unless @page_annotations.nil?
125
125
 
126
- json_array['pageLabelsAndSections'] = @page_labels_and_sections if @page_labels_and_sections != 'nil'
126
+ json_array['pageLabelsAndSections'] = @page_labels_and_sections unless @page_labels_and_sections.nil?
127
127
 
128
- json_array['rootFormField'] = @root_form_field if @root_form_field != 'nil'
128
+ json_array['rootFormField'] = @root_form_field unless @root_form_field.nil?
129
129
 
130
- json_array['xmpMetadata'] = @xmp_metadata if @xmp_metadata != 'nil'
130
+ json_array['xmpMetadata'] = @xmp_metadata unless @xmp_metadata.nil?
131
131
 
132
132
  JSON.pretty_generate(json_array)
133
133
  end
@@ -366,6 +366,9 @@ module DynamicPDFApi
366
366
  ret_object = PdfResponse.new(out_data)
367
367
  ret_object.is_successful = true
368
368
  else
369
+ if ret_object.status_code == '401'
370
+ raise "Invalid api key specified."
371
+ end
369
372
  out_data_json = JSON.parse(out_data)
370
373
  ret_object.error_json = out_data
371
374
  ret_object.error_message = if !out_data_json["message"].nil?
@@ -52,6 +52,9 @@ module DynamicPDFApi
52
52
  if ret_object.status_code == '200'
53
53
  ret_object.is_successful = true
54
54
  else
55
+ if ret_object.status_code == '401'
56
+ raise "Invalid api key specified."
57
+ end
55
58
  out_data_json = JSON.parse(out_data)
56
59
  ret_object.error_json = out_data
57
60
  ret_object.error_message = if !out_data_json['message'].nil?
@@ -54,7 +54,7 @@ module DynamicPDFApi
54
54
 
55
55
  #---------------------------------------------------
56
56
 
57
- json_array['templateId'] = @_template_id
57
+ json_array['templateId'] = @_template_id unless @_template_id.nil?
58
58
 
59
59
  json_array['resourceName'] = @resource_name
60
60
 
@@ -69,6 +69,9 @@ module DynamicPDFApi
69
69
  if ret_object.status_code == '200'
70
70
  ret_object.is_successful = true
71
71
  else
72
+ if ret_object.status_code == '401'
73
+ raise "Invalid api key specified."
74
+ end
72
75
  out_data_json = JSON.parse(out_data)
73
76
  ret_object.error_json = out_data
74
77
  ret_object.error_message = if !out_data_json['message'].nil?
@@ -51,6 +51,9 @@ module DynamicPDFApi
51
51
  if ret_object.status_code == '200'
52
52
  ret_object.is_successful = true
53
53
  else
54
+ if ret_object.status_code == '401'
55
+ raise "Invalid api key specified."
56
+ end
54
57
  out_data_json = JSON.parse(out_data)
55
58
  ret_object.error_json = out_data
56
59
  ret_object.error_message = if !out_data_json['message'].nil?
@@ -3,13 +3,6 @@ module DynamicPDFApi
3
3
  # Represents the base class for response.
4
4
  #
5
5
  class Response
6
- def initialize
7
- @_is_successful = false
8
- @_error_message = nil
9
- @_error_id = nil
10
- @_status_code = nil
11
- @_error_json = nil
12
- end
13
6
 
14
7
  #
15
8
  # Gets the boolean, indicating the response's status.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyClient
4
- VERSION = "1.1.0"
4
+ VERSION = "1.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamicpdf_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dynamicpdf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-09 00:00:00.000000000 Z
11
+ date: 2024-12-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Ruby Client API that uses the DynamicPDF API to create, merge, split,
14
14
  form fill, stamp, secure/encrypt PDF documents and convert word/Excel files to PDF.