pdfcrowd 5.14.0 → 5.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pdfcrowd.rb +80 -54
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d76493fa31359ab0580af96a63f6b642ec81e02b658799439c3f53ca1aa0fdb
4
- data.tar.gz: 1584157bc827d766cb898dc596ddd6ea1e192709a55bab018fd7f6da88d5b40a
3
+ metadata.gz: 7d96eee1f2494868b0edd320d65d8176e42291b823034832cf717edbc48bba44
4
+ data.tar.gz: 0b9def3cb91cb453bc8b7328b45c4b131971f37c0816639ced5d87a864cdd710
5
5
  SHA512:
6
- metadata.gz: df9f44f79936df358b4c4ce3a3fa2c2a8d664a0359d04b162cdf92ffcf2ad44aa4aa2c23d49a08c3df6abbfa23a0f751fa79f4f986f01e2a4b18c1bddf21af4f
7
- data.tar.gz: 3a5a1fad1b7a3b03c503ed6358812d3ae05fac2299b5902953c0e4002c0df10f9a253a5dd1b5d4576c11142846d1e1378534cb0b6c7c92517013d006e4a08efd
6
+ metadata.gz: 5f0e397040820e52b4c4a7f248ba7999685eb9b66b44e31e6aca14fd2870248237649394fc30c38d76f89f5d072ec6c777d59fd8abc5bfd7e170959d0b7ae230
7
+ data.tar.gz: 7ef83fc8034db9c2e998e714767284539eb94751ed8114dfc32b9e83150599fcf75adfbaab80e09cfe97bf8eb6ffd585a6f415d31a177115935a76cddfefd6f7
data/lib/pdfcrowd.rb CHANGED
@@ -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 = '5.14.0'
533
+ CLIENT_VERSION = '5.15.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/5.14.0 (https://pdfcrowd.com)')
544
+ setUserAgent('pdfcrowd_ruby_client/5.15.0 (https://pdfcrowd.com)')
545
545
 
546
546
  @retry_count = 1
547
547
  @converter_version = '20.10'
@@ -2374,6 +2374,19 @@ module Pdfcrowd
2374
2374
  self
2375
2375
  end
2376
2376
 
2377
+ # Set the maximum time to load the page and its resources. After this time, all requests will be considered successful. This can be useful to ensure that the conversion does not timeout. Use this method if there is no other way to fix page loading.
2378
+ #
2379
+ # * +max_time+ - The number of seconds to wait. The value must be in the range 10-30.
2380
+ # * *Returns* - The converter object.
2381
+ def setMaxLoadingTime(max_time)
2382
+ if (!(Integer(max_time) >= 10 && Integer(max_time) <= 30))
2383
+ raise Error.new(Pdfcrowd.create_invalid_value_message(max_time, "setMaxLoadingTime", "html-to-pdf", "The value must be in the range 10-30.", "set_max_loading_time"), 470);
2384
+ end
2385
+
2386
+ @fields['max_loading_time'] = max_time
2387
+ self
2388
+ end
2389
+
2377
2390
  # Set the converter version. Different versions may produce different output. Choose which one provides the best output for your case.
2378
2391
  #
2379
2392
  # * +version+ - The version identifier. Allowed values are latest, 20.10, 18.10.
@@ -2644,6 +2657,58 @@ module Pdfcrowd
2644
2657
  self
2645
2658
  end
2646
2659
 
2660
+ # Set the output image width in pixels.
2661
+ #
2662
+ # * +width+ - The value must be in the range 96-65000.
2663
+ # * *Returns* - The converter object.
2664
+ def setScreenshotWidth(width)
2665
+ if (!(Integer(width) >= 96 && Integer(width) <= 65000))
2666
+ raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setScreenshotWidth", "html-to-image", "The value must be in the range 96-65000.", "set_screenshot_width"), 470);
2667
+ end
2668
+
2669
+ @fields['screenshot_width'] = width
2670
+ self
2671
+ end
2672
+
2673
+ # Set the output image height in pixels. If it is not specified, actual document height is used.
2674
+ #
2675
+ # * +height+ - Must be a positive integer number.
2676
+ # * *Returns* - The converter object.
2677
+ def setScreenshotHeight(height)
2678
+ if (!(Integer(height) > 0))
2679
+ raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setScreenshotHeight", "html-to-image", "Must be a positive integer number.", "set_screenshot_height"), 470);
2680
+ end
2681
+
2682
+ @fields['screenshot_height'] = height
2683
+ self
2684
+ end
2685
+
2686
+ # Set the scaling factor (zoom) for the output image.
2687
+ #
2688
+ # * +factor+ - The percentage value. Must be a positive integer number.
2689
+ # * *Returns* - The converter object.
2690
+ def setScaleFactor(factor)
2691
+ if (!(Integer(factor) > 0))
2692
+ raise Error.new(Pdfcrowd.create_invalid_value_message(factor, "setScaleFactor", "html-to-image", "Must be a positive integer number.", "set_scale_factor"), 470);
2693
+ end
2694
+
2695
+ @fields['scale_factor'] = factor
2696
+ self
2697
+ end
2698
+
2699
+ # The output image background color.
2700
+ #
2701
+ # * +color+ - The value must be in RRGGBB or RRGGBBAA hexadecimal format.
2702
+ # * *Returns* - The converter object.
2703
+ def setBackgroundColor(color)
2704
+ unless /^[0-9a-fA-F]{6,8}$/.match(color)
2705
+ raise Error.new(Pdfcrowd.create_invalid_value_message(color, "setBackgroundColor", "html-to-image", "The value must be in RRGGBB or RRGGBBAA hexadecimal format.", "set_background_color"), 470);
2706
+ end
2707
+
2708
+ @fields['background_color'] = color
2709
+ self
2710
+ end
2711
+
2647
2712
  # Use the print version of the page if available (@media print).
2648
2713
  #
2649
2714
  # * +value+ - Set to true to use the print version of the page.
@@ -2938,58 +3003,6 @@ module Pdfcrowd
2938
3003
  self
2939
3004
  end
2940
3005
 
2941
- # Set the output image width in pixels.
2942
- #
2943
- # * +width+ - The value must be in the range 96-65000.
2944
- # * *Returns* - The converter object.
2945
- def setScreenshotWidth(width)
2946
- if (!(Integer(width) >= 96 && Integer(width) <= 65000))
2947
- raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setScreenshotWidth", "html-to-image", "The value must be in the range 96-65000.", "set_screenshot_width"), 470);
2948
- end
2949
-
2950
- @fields['screenshot_width'] = width
2951
- self
2952
- end
2953
-
2954
- # Set the output image height in pixels. If it is not specified, actual document height is used.
2955
- #
2956
- # * +height+ - Must be a positive integer number.
2957
- # * *Returns* - The converter object.
2958
- def setScreenshotHeight(height)
2959
- if (!(Integer(height) > 0))
2960
- raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setScreenshotHeight", "html-to-image", "Must be a positive integer number.", "set_screenshot_height"), 470);
2961
- end
2962
-
2963
- @fields['screenshot_height'] = height
2964
- self
2965
- end
2966
-
2967
- # Set the scaling factor (zoom) for the output image.
2968
- #
2969
- # * +factor+ - The percentage value. Must be a positive integer number.
2970
- # * *Returns* - The converter object.
2971
- def setScaleFactor(factor)
2972
- if (!(Integer(factor) > 0))
2973
- raise Error.new(Pdfcrowd.create_invalid_value_message(factor, "setScaleFactor", "html-to-image", "Must be a positive integer number.", "set_scale_factor"), 470);
2974
- end
2975
-
2976
- @fields['scale_factor'] = factor
2977
- self
2978
- end
2979
-
2980
- # The output image background color.
2981
- #
2982
- # * +color+ - The value must be in RRGGBB or RRGGBBAA hexadecimal format.
2983
- # * *Returns* - The converter object.
2984
- def setBackgroundColor(color)
2985
- unless /^[0-9a-fA-F]{6,8}$/.match(color)
2986
- raise Error.new(Pdfcrowd.create_invalid_value_message(color, "setBackgroundColor", "html-to-image", "The value must be in RRGGBB or RRGGBBAA hexadecimal format.", "set_background_color"), 470);
2987
- end
2988
-
2989
- @fields['background_color'] = color
2990
- self
2991
- end
2992
-
2993
3006
  # Set the input data for template rendering. The data format can be JSON, XML, YAML or CSV.
2994
3007
  #
2995
3008
  # * +data_string+ - The input data string.
@@ -3171,6 +3184,19 @@ module Pdfcrowd
3171
3184
  self
3172
3185
  end
3173
3186
 
3187
+ # Set the maximum time to load the page and its resources. After this time, all requests will be considered successful. This can be useful to ensure that the conversion does not timeout. Use this method if there is no other way to fix page loading.
3188
+ #
3189
+ # * +max_time+ - The number of seconds to wait. The value must be in the range 10-30.
3190
+ # * *Returns* - The converter object.
3191
+ def setMaxLoadingTime(max_time)
3192
+ if (!(Integer(max_time) >= 10 && Integer(max_time) <= 30))
3193
+ raise Error.new(Pdfcrowd.create_invalid_value_message(max_time, "setMaxLoadingTime", "html-to-image", "The value must be in the range 10-30.", "set_max_loading_time"), 470);
3194
+ end
3195
+
3196
+ @fields['max_loading_time'] = max_time
3197
+ self
3198
+ end
3199
+
3174
3200
  # Set the converter version. Different versions may produce different output. Choose which one provides the best output for your case.
3175
3201
  #
3176
3202
  # * +version+ - The version identifier. Allowed values are latest, 20.10, 18.10.
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: 5.14.0
4
+ version: 5.15.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: 2023-07-21 00:00:00.000000000 Z
11
+ date: 2023-10-16 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.