pdfcrowd 5.5.0 → 5.6.2
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 +46 -37
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee08b79907ebb1b808f791bd163e885bd0ca1a81fbb137bb67194e0d164b58ca
|
4
|
+
data.tar.gz: a8d44da3c7073a193c3091e230951c4eb8a85c8343a017d4b1244054c4ce8bb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25bf11b4dd6104e949a0d45f7d475b7256ca5d52f5c2819e28eb920efc4590268d5f49a9613f8b3cb66abefcb746c40ffa078d2072cf6271cc5f39b241248cb2
|
7
|
+
data.tar.gz: feb025a3543a4da019a88fef3a4aa6f4a41796be85ff08ee0c50b0bd4b092be75728d53cbfaad4fc59e052c99da719e4c4b1b49eb02a577e2f38a9ac88fefc06
|
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.6.2'
|
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.6.2 (https://pdfcrowd.com)')
|
545
545
|
|
546
546
|
@retry_count = 1
|
547
547
|
@converter_version = '20.10'
|
@@ -735,7 +735,7 @@ module Pdfcrowd
|
|
735
735
|
def self.create_invalid_value_message(value, field, converter, hint, id)
|
736
736
|
message = "Invalid value '%s' for %s." % [value, field]
|
737
737
|
message += " " + hint if hint
|
738
|
-
return message + " " + "Details: https://www.pdfcrowd.com/
|
738
|
+
return message + " " + "Details: https://www.pdfcrowd.com/api/%s-ruby/ref/#%s" % [converter, id]
|
739
739
|
end
|
740
740
|
|
741
741
|
# generated code
|
@@ -957,11 +957,11 @@ module Pdfcrowd
|
|
957
957
|
|
958
958
|
# Set the output page width. The safe maximum is 200in otherwise some PDF viewers may be unable to open the PDF.
|
959
959
|
#
|
960
|
-
# * +width+ -
|
960
|
+
# * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
961
961
|
# * *Returns* - The converter object.
|
962
962
|
def setPageWidth(width)
|
963
963
|
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(width)
|
964
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setPageWidth", "html-to-pdf", "
|
964
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setPageWidth", "html-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_page_width"), 470);
|
965
965
|
end
|
966
966
|
|
967
967
|
@fields['page_width'] = width
|
@@ -970,11 +970,11 @@ module Pdfcrowd
|
|
970
970
|
|
971
971
|
# Set the output page height. Use -1 for a single page PDF. The safe maximum is 200in otherwise some PDF viewers may be unable to open the PDF.
|
972
972
|
#
|
973
|
-
# * +height+ -
|
973
|
+
# * +height+ - The value must be -1 or specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
974
974
|
# * *Returns* - The converter object.
|
975
975
|
def setPageHeight(height)
|
976
976
|
unless /(?i)^0$|^\-1$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
|
977
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setPageHeight", "html-to-pdf", "
|
977
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setPageHeight", "html-to-pdf", "The value must be -1 or specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_page_height"), 470);
|
978
978
|
end
|
979
979
|
|
980
980
|
@fields['page_height'] = height
|
@@ -983,8 +983,8 @@ module Pdfcrowd
|
|
983
983
|
|
984
984
|
# Set the output page dimensions.
|
985
985
|
#
|
986
|
-
# * +width+ - Set the output page width. The safe maximum is 200in otherwise some PDF viewers may be unable to open the PDF.
|
987
|
-
# * +height+ - Set the output page height. Use -1 for a single page PDF. The safe maximum is 200in otherwise some PDF viewers may be unable to open the PDF.
|
986
|
+
# * +width+ - Set the output page width. The safe maximum is 200in otherwise some PDF viewers may be unable to open the PDF. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
987
|
+
# * +height+ - Set the output page height. Use -1 for a single page PDF. The safe maximum is 200in otherwise some PDF viewers may be unable to open the PDF. The value must be -1 or specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
988
988
|
# * *Returns* - The converter object.
|
989
989
|
def setPageDimensions(width, height)
|
990
990
|
setPageWidth(width)
|
@@ -1007,11 +1007,11 @@ module Pdfcrowd
|
|
1007
1007
|
|
1008
1008
|
# Set the output page top margin.
|
1009
1009
|
#
|
1010
|
-
# * +top+ -
|
1010
|
+
# * +top+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1011
1011
|
# * *Returns* - The converter object.
|
1012
1012
|
def setMarginTop(top)
|
1013
1013
|
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(top)
|
1014
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(top, "setMarginTop", "html-to-pdf", "
|
1014
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(top, "setMarginTop", "html-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_top"), 470);
|
1015
1015
|
end
|
1016
1016
|
|
1017
1017
|
@fields['margin_top'] = top
|
@@ -1020,11 +1020,11 @@ module Pdfcrowd
|
|
1020
1020
|
|
1021
1021
|
# Set the output page right margin.
|
1022
1022
|
#
|
1023
|
-
# * +right+ -
|
1023
|
+
# * +right+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1024
1024
|
# * *Returns* - The converter object.
|
1025
1025
|
def setMarginRight(right)
|
1026
1026
|
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(right)
|
1027
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(right, "setMarginRight", "html-to-pdf", "
|
1027
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(right, "setMarginRight", "html-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_right"), 470);
|
1028
1028
|
end
|
1029
1029
|
|
1030
1030
|
@fields['margin_right'] = right
|
@@ -1033,11 +1033,11 @@ module Pdfcrowd
|
|
1033
1033
|
|
1034
1034
|
# Set the output page bottom margin.
|
1035
1035
|
#
|
1036
|
-
# * +bottom+ -
|
1036
|
+
# * +bottom+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1037
1037
|
# * *Returns* - The converter object.
|
1038
1038
|
def setMarginBottom(bottom)
|
1039
1039
|
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(bottom)
|
1040
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(bottom, "setMarginBottom", "html-to-pdf", "
|
1040
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(bottom, "setMarginBottom", "html-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_bottom"), 470);
|
1041
1041
|
end
|
1042
1042
|
|
1043
1043
|
@fields['margin_bottom'] = bottom
|
@@ -1046,11 +1046,11 @@ module Pdfcrowd
|
|
1046
1046
|
|
1047
1047
|
# Set the output page left margin.
|
1048
1048
|
#
|
1049
|
-
# * +left+ -
|
1049
|
+
# * +left+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1050
1050
|
# * *Returns* - The converter object.
|
1051
1051
|
def setMarginLeft(left)
|
1052
1052
|
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(left)
|
1053
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(left, "setMarginLeft", "html-to-pdf", "
|
1053
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(left, "setMarginLeft", "html-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_left"), 470);
|
1054
1054
|
end
|
1055
1055
|
|
1056
1056
|
@fields['margin_left'] = left
|
@@ -1068,10 +1068,10 @@ module Pdfcrowd
|
|
1068
1068
|
|
1069
1069
|
# Set the output page margins.
|
1070
1070
|
#
|
1071
|
-
# * +top+ - Set the output page top margin.
|
1072
|
-
# * +right+ - Set the output page right margin.
|
1073
|
-
# * +bottom+ - Set the output page bottom margin.
|
1074
|
-
# * +left+ - Set the output page left margin.
|
1071
|
+
# * +top+ - Set the output page top margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1072
|
+
# * +right+ - Set the output page right margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1073
|
+
# * +bottom+ - Set the output page bottom margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1074
|
+
# * +left+ - Set the output page left margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1075
1075
|
# * *Returns* - The converter object.
|
1076
1076
|
def setPageMargins(top, right, bottom, left)
|
1077
1077
|
setMarginTop(top)
|
@@ -1105,11 +1105,11 @@ module Pdfcrowd
|
|
1105
1105
|
|
1106
1106
|
# Set the top left X coordinate of the content area. It is relative to the top left X coordinate of the print area.
|
1107
1107
|
#
|
1108
|
-
# * +x+ -
|
1108
|
+
# * +x+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt". It may contain a negative value.
|
1109
1109
|
# * *Returns* - The converter object.
|
1110
1110
|
def setContentAreaX(x)
|
1111
1111
|
unless /(?i)^0$|^\-?[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(x)
|
1112
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(x, "setContentAreaX", "html-to-pdf", "
|
1112
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(x, "setContentAreaX", "html-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\". It may contain a negative value.", "set_content_area_x"), 470);
|
1113
1113
|
end
|
1114
1114
|
|
1115
1115
|
@fields['content_area_x'] = x
|
@@ -1118,11 +1118,11 @@ module Pdfcrowd
|
|
1118
1118
|
|
1119
1119
|
# Set the top left Y coordinate of the content area. It is relative to the top left Y coordinate of the print area.
|
1120
1120
|
#
|
1121
|
-
# * +y+ -
|
1121
|
+
# * +y+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt". It may contain a negative value.
|
1122
1122
|
# * *Returns* - The converter object.
|
1123
1123
|
def setContentAreaY(y)
|
1124
1124
|
unless /(?i)^0$|^\-?[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(y)
|
1125
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(y, "setContentAreaY", "html-to-pdf", "
|
1125
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(y, "setContentAreaY", "html-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\". It may contain a negative value.", "set_content_area_y"), 470);
|
1126
1126
|
end
|
1127
1127
|
|
1128
1128
|
@fields['content_area_y'] = y
|
@@ -1131,11 +1131,11 @@ module Pdfcrowd
|
|
1131
1131
|
|
1132
1132
|
# Set the width of the content area. It should be at least 1 inch.
|
1133
1133
|
#
|
1134
|
-
# * +width+ -
|
1134
|
+
# * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1135
1135
|
# * *Returns* - The converter object.
|
1136
1136
|
def setContentAreaWidth(width)
|
1137
1137
|
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(width)
|
1138
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setContentAreaWidth", "html-to-pdf", "
|
1138
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setContentAreaWidth", "html-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_content_area_width"), 470);
|
1139
1139
|
end
|
1140
1140
|
|
1141
1141
|
@fields['content_area_width'] = width
|
@@ -1144,11 +1144,11 @@ module Pdfcrowd
|
|
1144
1144
|
|
1145
1145
|
# Set the height of the content area. It should be at least 1 inch.
|
1146
1146
|
#
|
1147
|
-
# * +height+ -
|
1147
|
+
# * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1148
1148
|
# * *Returns* - The converter object.
|
1149
1149
|
def setContentAreaHeight(height)
|
1150
1150
|
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
|
1151
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setContentAreaHeight", "html-to-pdf", "
|
1151
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setContentAreaHeight", "html-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_content_area_height"), 470);
|
1152
1152
|
end
|
1153
1153
|
|
1154
1154
|
@fields['content_area_height'] = height
|
@@ -1157,10 +1157,10 @@ module Pdfcrowd
|
|
1157
1157
|
|
1158
1158
|
# Set the content area position and size. The content area enables to specify a web page area to be converted.
|
1159
1159
|
#
|
1160
|
-
# * +x+ - Set the top left X coordinate of the content area. It is relative to the top left X coordinate of the print area.
|
1161
|
-
# * +y+ - Set the top left Y coordinate of the content area. It is relative to the top left Y coordinate of the print area.
|
1162
|
-
# * +width+ - Set the width of the content area. It should be at least 1 inch.
|
1163
|
-
# * +height+ - Set the height of the content area. It should be at least 1 inch.
|
1160
|
+
# * +x+ - Set the top left X coordinate of the content area. It is relative to the top left X coordinate of the print area. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt". It may contain a negative value.
|
1161
|
+
# * +y+ - Set the top left Y coordinate of the content area. It is relative to the top left Y coordinate of the print area. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt". It may contain a negative value.
|
1162
|
+
# * +width+ - Set the width of the content area. It should be at least 1 inch. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1163
|
+
# * +height+ - Set the height of the content area. It should be at least 1 inch. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1164
1164
|
# * *Returns* - The converter object.
|
1165
1165
|
def setContentArea(x, y, width, height)
|
1166
1166
|
setContentAreaX(x)
|
@@ -1211,11 +1211,11 @@ module Pdfcrowd
|
|
1211
1211
|
|
1212
1212
|
# Set the header height.
|
1213
1213
|
#
|
1214
|
-
# * +height+ -
|
1214
|
+
# * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1215
1215
|
# * *Returns* - The converter object.
|
1216
1216
|
def setHeaderHeight(height)
|
1217
1217
|
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
|
1218
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setHeaderHeight", "html-to-pdf", "
|
1218
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setHeaderHeight", "html-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_header_height"), 470);
|
1219
1219
|
end
|
1220
1220
|
|
1221
1221
|
@fields['header_height'] = height
|
@@ -1259,11 +1259,11 @@ module Pdfcrowd
|
|
1259
1259
|
|
1260
1260
|
# Set the footer height.
|
1261
1261
|
#
|
1262
|
-
# * +height+ -
|
1262
|
+
# * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
1263
1263
|
# * *Returns* - The converter object.
|
1264
1264
|
def setFooterHeight(height)
|
1265
1265
|
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
|
1266
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setFooterHeight", "html-to-pdf", "
|
1266
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setFooterHeight", "html-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_footer_height"), 470);
|
1267
1267
|
end
|
1268
1268
|
|
1269
1269
|
@fields['footer_height'] = height
|
@@ -1840,6 +1840,15 @@ module Pdfcrowd
|
|
1840
1840
|
self
|
1841
1841
|
end
|
1842
1842
|
|
1843
|
+
# Convert HTML forms to fillable PDF forms. Details can be found in the blog post.
|
1844
|
+
#
|
1845
|
+
# * +value+ - Set to true to make fillable PDF forms.
|
1846
|
+
# * *Returns* - The converter object.
|
1847
|
+
def setEnablePdfForms(value)
|
1848
|
+
@fields['enable_pdf_forms'] = value
|
1849
|
+
self
|
1850
|
+
end
|
1851
|
+
|
1843
1852
|
# Create linearized PDF. This is also known as Fast Web View.
|
1844
1853
|
#
|
1845
1854
|
# * +value+ - Set to true to create linearized PDF.
|
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.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pdfcrowd Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-18 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.
|
@@ -18,7 +18,7 @@ extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
20
|
- lib/pdfcrowd.rb
|
21
|
-
homepage: https://pdfcrowd.com/
|
21
|
+
homepage: https://pdfcrowd.com/api/
|
22
22
|
licenses:
|
23
23
|
- MIT
|
24
24
|
metadata: {}
|