pdfcrowd 4.11.0 → 4.12.0

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pdfcrowd.rb +170 -13
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0d1b16199c6019f63d1edc09ac55dfb3abe4e8d
4
- data.tar.gz: acbcfeb78be46f671a6d59d384f476e390298559
3
+ metadata.gz: 831ab1316f51b02fcaac6c0f530631784c3ecc6c
4
+ data.tar.gz: 3f2fb384a6abc373d1a9421b461bd7b4c573a38c
5
5
  SHA512:
6
- metadata.gz: 0d30398b8bc2bc11e99a93b5a64d35b2f21d48d6712754a98efcf749c3b8cf893fb4ea97f78a5939401d4109c58fa88c5e43cef6e819fb60c3e968d890547e80
7
- data.tar.gz: 68a7c0410c0a90482bc7746ddaebc9c583b5f5eb106840d8cfefdc8fa0376221d63d2f13c9a36eeedf3f4d0c83f9bca1b9de5b5b1886345e657bdb03a5dcbd19
6
+ metadata.gz: fd7873f02b1bf65df5430b0b457f13139399a79001e34e3fbc07700e2e0b48dd6d099c46c2a1bd8c31cbd134d60193c555dfa7ba690348593d7bd3747bf6b238
7
+ data.tar.gz: 648468cfeab19ee85e491d7cd32d30f1e64c05f4bd816a3e39e38a3c2383eda0df700e53463fc36ff1df7b34e322018da605fc6168349761e1d1a3dabb768206
@@ -530,7 +530,7 @@ end
530
530
  module Pdfcrowd
531
531
  HOST = ENV["PDFCROWD_HOST"] || 'api.pdfcrowd.com'
532
532
  MULTIPART_BOUNDARY = '----------ThIs_Is_tHe_bOUnDary_$'
533
- CLIENT_VERSION = '4.11.0'
533
+ CLIENT_VERSION = '4.12.0'
534
534
 
535
535
  class ConnectionHelper
536
536
  def initialize(user_name, api_key)
@@ -541,7 +541,7 @@ module Pdfcrowd
541
541
 
542
542
  setProxy(nil, nil, nil, nil)
543
543
  setUseHttp(false)
544
- setUserAgent('pdfcrowd_ruby_client/4.11.0 (http://pdfcrowd.com)')
544
+ setUserAgent('pdfcrowd_ruby_client/4.12.0 (http://pdfcrowd.com)')
545
545
 
546
546
  @retry_count = 1
547
547
  end
@@ -724,7 +724,7 @@ module Pdfcrowd
724
724
  end
725
725
 
726
726
  def self.create_invalid_value_message(value, field, converter, hint, id)
727
- message = "Invalid value '%s' for a field '%s'." % [value, field]
727
+ message = "Invalid value '%s' for the field '%s'." % [value, field]
728
728
  message += " " + hint if hint
729
729
  return message + " " + "Details: https://www.pdfcrowd.com/doc/api/%s/ruby/#%s" % [converter, id]
730
730
  end
@@ -1105,11 +1105,11 @@ module Pdfcrowd
1105
1105
 
1106
1106
  # Set the page range to print.
1107
1107
  #
1108
- # * +pages+ - A comma seperated list of page numbers or ranges.
1108
+ # * +pages+ - A comma separated list of page numbers or ranges.
1109
1109
  # * *Returns* - The converter object.
1110
1110
  def setPrintPageRange(pages)
1111
1111
  unless /^(?:\s*(?:\d+|(?:\d*\s*\-\s*\d+)|(?:\d+\s*\-\s*\d*))\s*,\s*)*\s*(?:\d+|(?:\d*\s*\-\s*\d+)|(?:\d+\s*\-\s*\d*))\s*$/.match(pages)
1112
- raise Error.new(Pdfcrowd.create_invalid_value_message(pages, "pages", "html-to-pdf", "A comma seperated list of page numbers or ranges.", "set_print_page_range"), 470);
1112
+ raise Error.new(Pdfcrowd.create_invalid_value_message(pages, "pages", "html-to-pdf", "A comma separated list of page numbers or ranges.", "set_print_page_range"), 470);
1113
1113
  end
1114
1114
 
1115
1115
  @fields['print_page_range'] = pages
@@ -1118,11 +1118,11 @@ module Pdfcrowd
1118
1118
 
1119
1119
  # The page header is not printed on the specified pages.
1120
1120
  #
1121
- # * +pages+ - List of physical page numbers. Negative numbers count backwards from the last page: -1 is the last page, -2 is the last but one page, and so on. A comma seperated list of page numbers.
1121
+ # * +pages+ - List of physical page numbers. Negative numbers count backwards from the last page: -1 is the last page, -2 is the last but one page, and so on. A comma separated list of page numbers.
1122
1122
  # * *Returns* - The converter object.
1123
1123
  def setExcludeHeaderOnPages(pages)
1124
1124
  unless /^(?:\s*\-?\d+\s*,)*\s*\-?\d+\s*$/.match(pages)
1125
- raise Error.new(Pdfcrowd.create_invalid_value_message(pages, "pages", "html-to-pdf", "A comma seperated list of page numbers.", "set_exclude_header_on_pages"), 470);
1125
+ raise Error.new(Pdfcrowd.create_invalid_value_message(pages, "pages", "html-to-pdf", "A comma separated list of page numbers.", "set_exclude_header_on_pages"), 470);
1126
1126
  end
1127
1127
 
1128
1128
  @fields['exclude_header_on_pages'] = pages
@@ -1131,11 +1131,11 @@ module Pdfcrowd
1131
1131
 
1132
1132
  # The page footer is not printed on the specified pages.
1133
1133
  #
1134
- # * +pages+ - List of physical page numbers. Negative numbers count backwards from the last page: -1 is the last page, -2 is the last but one page, and so on. A comma seperated list of page numbers.
1134
+ # * +pages+ - List of physical page numbers. Negative numbers count backwards from the last page: -1 is the last page, -2 is the last but one page, and so on. A comma separated list of page numbers.
1135
1135
  # * *Returns* - The converter object.
1136
1136
  def setExcludeFooterOnPages(pages)
1137
1137
  unless /^(?:\s*\-?\d+\s*,)*\s*\-?\d+\s*$/.match(pages)
1138
- raise Error.new(Pdfcrowd.create_invalid_value_message(pages, "pages", "html-to-pdf", "A comma seperated list of page numbers.", "set_exclude_footer_on_pages"), 470);
1138
+ raise Error.new(Pdfcrowd.create_invalid_value_message(pages, "pages", "html-to-pdf", "A comma separated list of page numbers.", "set_exclude_footer_on_pages"), 470);
1139
1139
  end
1140
1140
 
1141
1141
  @fields['exclude_footer_on_pages'] = pages
@@ -1218,6 +1218,82 @@ module Pdfcrowd
1218
1218
  self
1219
1219
  end
1220
1220
 
1221
+ # Set the input data for template rendering. The data format can be JSON, XML, YAML or CSV.
1222
+ #
1223
+ # * +data_string+ - The input data string.
1224
+ # * *Returns* - The converter object.
1225
+ def setDataString(data_string)
1226
+ @fields['data_string'] = data_string
1227
+ self
1228
+ end
1229
+
1230
+ # Load the input data for template rendering from the specified file. The data format can be JSON, XML, YAML or CSV.
1231
+ #
1232
+ # * +data_file+ - The file path to a local file containing the input data.
1233
+ # * *Returns* - The converter object.
1234
+ def setDataFile(data_file)
1235
+ @files['data_file'] = data_file
1236
+ self
1237
+ end
1238
+
1239
+ # Specify the input data format.
1240
+ #
1241
+ # * +data_format+ - The data format. Allowed values are auto, json, xml, yaml, csv.
1242
+ # * *Returns* - The converter object.
1243
+ def setDataFormat(data_format)
1244
+ unless /(?i)^(auto|json|xml|yaml|csv)$/.match(data_format)
1245
+ raise Error.new(Pdfcrowd.create_invalid_value_message(data_format, "data_format", "html-to-pdf", "Allowed values are auto, json, xml, yaml, csv.", "set_data_format"), 470);
1246
+ end
1247
+
1248
+ @fields['data_format'] = data_format
1249
+ self
1250
+ end
1251
+
1252
+ # Set the encoding of the data file set by setDataFile.
1253
+ #
1254
+ # * +data_encoding+ - The data file encoding.
1255
+ # * *Returns* - The converter object.
1256
+ def setDataEncoding(data_encoding)
1257
+ @fields['data_encoding'] = data_encoding
1258
+ self
1259
+ end
1260
+
1261
+ # Ignore undefined variables in the HTML template. The default mode is strict so any undefined variable causes the conversion to fail. You can use {% if variable is defined %} to check if the variable is defined.
1262
+ #
1263
+ # * +data_ignore_undefined+ - Set to true to ignore undefined variables.
1264
+ # * *Returns* - The converter object.
1265
+ def setDataIgnoreUndefined(data_ignore_undefined)
1266
+ @fields['data_ignore_undefined'] = data_ignore_undefined
1267
+ self
1268
+ end
1269
+
1270
+ # Auto escape HTML symbols in the input data before placing them into the output.
1271
+ #
1272
+ # * +data_auto_escape+ - Set to true to turn auto escaping on.
1273
+ # * *Returns* - The converter object.
1274
+ def setDataAutoEscape(data_auto_escape)
1275
+ @fields['data_auto_escape'] = data_auto_escape
1276
+ self
1277
+ end
1278
+
1279
+ # Auto trim whitespace around each template command block.
1280
+ #
1281
+ # * +data_trim_blocks+ - Set to true to turn auto trimming on.
1282
+ # * *Returns* - The converter object.
1283
+ def setDataTrimBlocks(data_trim_blocks)
1284
+ @fields['data_trim_blocks'] = data_trim_blocks
1285
+ self
1286
+ end
1287
+
1288
+ # Set the advanced data options:csv_delimiter - The CSV data delimiter, the default is ,.xml_remove_root - Remove the root XML element from the input data.data_root - The name of the root element inserted into the input data without a root node (e.g. CSV), the default is data.
1289
+ #
1290
+ # * +data_options+ - Comma separated list of options.
1291
+ # * *Returns* - The converter object.
1292
+ def setDataOptions(data_options)
1293
+ @fields['data_options'] = data_options
1294
+ self
1295
+ end
1296
+
1221
1297
  # Apply the first page of the watermark PDF to every page of the output PDF.
1222
1298
  #
1223
1299
  # * +page_watermark+ - The file path to a local watermark PDF file. The file must exist and not be empty.
@@ -1511,7 +1587,7 @@ module Pdfcrowd
1511
1587
  self
1512
1588
  end
1513
1589
 
1514
- # Wait the specified number of milliseconds to finish all JavaScript after the document is loaded. The maximum value is determined by your API license.
1590
+ # Wait the specified number of milliseconds to finish all JavaScript after the document is loaded. Your API license defines the maximum wait time by "Max Delay" parameter.
1515
1591
  #
1516
1592
  # * +javascript_delay+ - The number of milliseconds to wait. Must be a positive integer number or 0.
1517
1593
  # * *Returns* - The converter object.
@@ -1745,7 +1821,7 @@ module Pdfcrowd
1745
1821
  self
1746
1822
  end
1747
1823
 
1748
- # Disallow modification of the ouput PDF.
1824
+ # Disallow modification of the output PDF.
1749
1825
  #
1750
1826
  # * +no_modify+ - Set to true to set the read-only only flag in the output PDF.
1751
1827
  # * *Returns* - The converter object.
@@ -2033,6 +2109,7 @@ module Pdfcrowd
2033
2109
  end
2034
2110
 
2035
2111
  # Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
2112
+ # Warning: Using HTTP is insecure as data sent over HTTP is not encrypted. Enable this option only if you know what you are doing.
2036
2113
  #
2037
2114
  # * +use_http+ - Set to true to use HTTP.
2038
2115
  # * *Returns* - The converter object.
@@ -2241,6 +2318,82 @@ module Pdfcrowd
2241
2318
  end
2242
2319
  end
2243
2320
 
2321
+ # Set the input data for template rendering. The data format can be JSON, XML, YAML or CSV.
2322
+ #
2323
+ # * +data_string+ - The input data string.
2324
+ # * *Returns* - The converter object.
2325
+ def setDataString(data_string)
2326
+ @fields['data_string'] = data_string
2327
+ self
2328
+ end
2329
+
2330
+ # Load the input data for template rendering from the specified file. The data format can be JSON, XML, YAML or CSV.
2331
+ #
2332
+ # * +data_file+ - The file path to a local file containing the input data.
2333
+ # * *Returns* - The converter object.
2334
+ def setDataFile(data_file)
2335
+ @files['data_file'] = data_file
2336
+ self
2337
+ end
2338
+
2339
+ # Specify the input data format.
2340
+ #
2341
+ # * +data_format+ - The data format. Allowed values are auto, json, xml, yaml, csv.
2342
+ # * *Returns* - The converter object.
2343
+ def setDataFormat(data_format)
2344
+ unless /(?i)^(auto|json|xml|yaml|csv)$/.match(data_format)
2345
+ raise Error.new(Pdfcrowd.create_invalid_value_message(data_format, "data_format", "html-to-image", "Allowed values are auto, json, xml, yaml, csv.", "set_data_format"), 470);
2346
+ end
2347
+
2348
+ @fields['data_format'] = data_format
2349
+ self
2350
+ end
2351
+
2352
+ # Set the encoding of the data file set by setDataFile.
2353
+ #
2354
+ # * +data_encoding+ - The data file encoding.
2355
+ # * *Returns* - The converter object.
2356
+ def setDataEncoding(data_encoding)
2357
+ @fields['data_encoding'] = data_encoding
2358
+ self
2359
+ end
2360
+
2361
+ # Ignore undefined variables in the HTML template. The default mode is strict so any undefined variable causes the conversion to fail. You can use {% if variable is defined %} to check if the variable is defined.
2362
+ #
2363
+ # * +data_ignore_undefined+ - Set to true to ignore undefined variables.
2364
+ # * *Returns* - The converter object.
2365
+ def setDataIgnoreUndefined(data_ignore_undefined)
2366
+ @fields['data_ignore_undefined'] = data_ignore_undefined
2367
+ self
2368
+ end
2369
+
2370
+ # Auto escape HTML symbols in the input data before placing them into the output.
2371
+ #
2372
+ # * +data_auto_escape+ - Set to true to turn auto escaping on.
2373
+ # * *Returns* - The converter object.
2374
+ def setDataAutoEscape(data_auto_escape)
2375
+ @fields['data_auto_escape'] = data_auto_escape
2376
+ self
2377
+ end
2378
+
2379
+ # Auto trim whitespace around each template command block.
2380
+ #
2381
+ # * +data_trim_blocks+ - Set to true to turn auto trimming on.
2382
+ # * *Returns* - The converter object.
2383
+ def setDataTrimBlocks(data_trim_blocks)
2384
+ @fields['data_trim_blocks'] = data_trim_blocks
2385
+ self
2386
+ end
2387
+
2388
+ # Set the advanced data options:csv_delimiter - The CSV data delimiter, the default is ,.xml_remove_root - Remove the root XML element from the input data.data_root - The name of the root element inserted into the input data without a root node (e.g. CSV), the default is data.
2389
+ #
2390
+ # * +data_options+ - Comma separated list of options.
2391
+ # * *Returns* - The converter object.
2392
+ def setDataOptions(data_options)
2393
+ @fields['data_options'] = data_options
2394
+ self
2395
+ end
2396
+
2244
2397
  # Do not print the background graphics.
2245
2398
  #
2246
2399
  # * +no_background+ - Set to true to disable the background graphics.
@@ -2417,7 +2570,7 @@ module Pdfcrowd
2417
2570
  self
2418
2571
  end
2419
2572
 
2420
- # Wait the specified number of milliseconds to finish all JavaScript after the document is loaded. The maximum value is determined by your API license.
2573
+ # Wait the specified number of milliseconds to finish all JavaScript after the document is loaded. Your API license defines the maximum wait time by "Max Delay" parameter.
2421
2574
  #
2422
2575
  # * +javascript_delay+ - The number of milliseconds to wait. Must be a positive integer number or 0.
2423
2576
  # * *Returns* - The converter object.
@@ -2608,6 +2761,7 @@ module Pdfcrowd
2608
2761
  end
2609
2762
 
2610
2763
  # Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
2764
+ # Warning: Using HTTP is insecure as data sent over HTTP is not encrypted. Enable this option only if you know what you are doing.
2611
2765
  #
2612
2766
  # * +use_http+ - Set to true to use HTTP.
2613
2767
  # * *Returns* - The converter object.
@@ -2904,6 +3058,7 @@ module Pdfcrowd
2904
3058
  end
2905
3059
 
2906
3060
  # Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
3061
+ # Warning: Using HTTP is insecure as data sent over HTTP is not encrypted. Enable this option only if you know what you are doing.
2907
3062
  #
2908
3063
  # * +use_http+ - Set to true to use HTTP.
2909
3064
  # * *Returns* - The converter object.
@@ -3177,7 +3332,7 @@ module Pdfcrowd
3177
3332
  self
3178
3333
  end
3179
3334
 
3180
- # Disallow modification of the ouput PDF.
3335
+ # Disallow modification of the output PDF.
3181
3336
  #
3182
3337
  # * +no_modify+ - Set to true to set the read-only only flag in the output PDF.
3183
3338
  # * *Returns* - The converter object.
@@ -3381,6 +3536,7 @@ module Pdfcrowd
3381
3536
  end
3382
3537
 
3383
3538
  # Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
3539
+ # Warning: Using HTTP is insecure as data sent over HTTP is not encrypted. Enable this option only if you know what you are doing.
3384
3540
  #
3385
3541
  # * +use_http+ - Set to true to use HTTP.
3386
3542
  # * *Returns* - The converter object.
@@ -3664,6 +3820,7 @@ module Pdfcrowd
3664
3820
  end
3665
3821
 
3666
3822
  # Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
3823
+ # Warning: Using HTTP is insecure as data sent over HTTP is not encrypted. Enable this option only if you know what you are doing.
3667
3824
  #
3668
3825
  # * +use_http+ - Set to true to use HTTP.
3669
3826
  # * *Returns* - The converter object.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdfcrowd
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.11.0
4
+ version: 4.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pdfcrowd Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-04 00:00:00.000000000 Z
11
+ date: 2020-04-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: The Pdfcrowd API lets you easily convert between HTML, PDF and various
14
14
  image formats.