pdfcrowd 5.14.0 → 5.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pdfcrowd.rb +89 -54
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f63c62ebe16a3603ee7d309258d23f30c774008c69442c17d380665be885043
|
4
|
+
data.tar.gz: 463a81a7dc5a9fde727ee164035c49b0c84309ab7403d93d0189248f700a0824
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 888769f2be85505eb01c309684dba3a0cf936ddd55aec23c45e815eab12bd43e25e5a84c3c0f7024e5c547e5ed72e6b808579f2856904ae6f5503fc0e8d16078
|
7
|
+
data.tar.gz: e0c112e5292e772d67dd69e9617eb591cca29382e47a41fa84b8ec4dcb781248e82311f75fee702c57d4031fc276f555301af4af44f848f6f339943dd14faa26
|
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.
|
533
|
+
CLIENT_VERSION = '5.16.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.
|
544
|
+
setUserAgent('pdfcrowd_ruby_client/5.16.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.
|
@@ -5555,6 +5581,15 @@ module Pdfcrowd
|
|
5555
5581
|
self
|
5556
5582
|
end
|
5557
5583
|
|
5584
|
+
# Set the output graphics DPI.
|
5585
|
+
#
|
5586
|
+
# * +dpi+ - The DPI value.
|
5587
|
+
# * *Returns* - The converter object.
|
5588
|
+
def setDpi(dpi)
|
5589
|
+
@fields['dpi'] = dpi
|
5590
|
+
self
|
5591
|
+
end
|
5592
|
+
|
5558
5593
|
# Specifies where the images are stored.
|
5559
5594
|
#
|
5560
5595
|
# * +mode+ - The image storage mode. Allowed values are embed, separate.
|
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.
|
4
|
+
version: 5.16.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-
|
11
|
+
date: 2023-10-26 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.
|