pdfcrowd 5.11.0 → 5.12.1

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 +234 -86
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47cc638ecfdc79b979a59ff392d8a0d26e3c24d46aa83c06068a774628a94a60
4
- data.tar.gz: 4a6c2c0fbf53647504afe8cda893dd117366ddcc68a15357052c33b46b11369b
3
+ metadata.gz: 54cd69d25cfda77bbca04f440303be338382e9392091e9b1a9dd3f34f882cb1e
4
+ data.tar.gz: d0c5e879c75a8f62a191ecb12dc1cab7d0301e75380337223729aa715ae7b59a
5
5
  SHA512:
6
- metadata.gz: d1cfa2137a0777c82f2d8cae3c7a39ec4683f9ebb83c3f1fe6f3f0b051dc3b96f061ed41a78d753c71b6e3b471fd27c8a85e3e2b3827421d237bfb7a24c5dddd
7
- data.tar.gz: 3d71f0f4d050a4c19cfd5a69ca85524ca95db37e2852893684c3b72bc5a42ecb8126e4c40b615a8166b30b0a728e0c7e1624f11270b4d6e4c64fd5eea79b29a2
6
+ metadata.gz: 2ef4b55ad852187274578c9c91a1fbb309c34706a1bf7fd8b85b9f1c84ab757e256228fa84b1dd6a26893cd02b77af391b598c05a979fcd296f8b99e6b541038
7
+ data.tar.gz: b79f66e6e0224b611b7d6941d438ad156809eb79ed0957a61844e0bbe0752262941cdfe37d65f3afe281fc87dc171ad2dce234e351ba2c6b2e4df8990f4dd1a5
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.11.0'
533
+ CLIENT_VERSION = '5.12.1'
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.11.0 (https://pdfcrowd.com)')
544
+ setUserAgent('pdfcrowd_ruby_client/5.12.1 (https://pdfcrowd.com)')
545
545
 
546
546
  @retry_count = 1
547
547
  @converter_version = '20.10'
@@ -681,7 +681,7 @@ module Pdfcrowd
681
681
  begin
682
682
  return exec_request(request, out_stream)
683
683
  rescue Error => err
684
- if err.getCode() == '502' and @retry_count > @retry
684
+ if (err.getCode() == '502' or err.getCode() == '503') and @retry_count > @retry
685
685
  @retry += 1
686
686
  sleep(@retry * 0.1)
687
687
  else
@@ -707,10 +707,6 @@ module Pdfcrowd
707
707
  @total_page_count = (response["X-Pdfcrowd-Total-Pages"] || 0).to_i
708
708
  @output_size = (response["X-Pdfcrowd-Output-Size"] || 0).to_i
709
709
 
710
- raise Error.new('test 502', '502') \
711
- if ENV["PDFCROWD_UNIT_TEST_MODE"] and
712
- @retry_count > @retry
713
-
714
710
  case response
715
711
  when Net::HTTPSuccess
716
712
  if out_stream
@@ -963,11 +959,11 @@ module Pdfcrowd
963
959
 
964
960
  # Set the output page width. The safe maximum is 200in otherwise some PDF viewers may be unable to open the PDF.
965
961
  #
966
- # * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
962
+ # * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
967
963
  # * *Returns* - The converter object.
968
964
  def setPageWidth(width)
969
965
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(width)
970
- 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);
966
+ 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\", pixels \"px\", or points \"pt\".", "set_page_width"), 470);
971
967
  end
972
968
 
973
969
  @fields['page_width'] = width
@@ -976,11 +972,11 @@ module Pdfcrowd
976
972
 
977
973
  # 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.
978
974
  #
979
- # * +height+ - The value must be -1 or specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
975
+ # * +height+ - The value must be -1 or specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
980
976
  # * *Returns* - The converter object.
981
977
  def setPageHeight(height)
982
978
  unless /(?i)^0$|^\-1$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
983
- 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);
979
+ 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\", pixels \"px\", or points \"pt\".", "set_page_height"), 470);
984
980
  end
985
981
 
986
982
  @fields['page_height'] = height
@@ -989,8 +985,8 @@ module Pdfcrowd
989
985
 
990
986
  # Set the output page dimensions.
991
987
  #
992
- # * +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".
993
- # * +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
+ # * +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", pixels "px", or points "pt".
989
+ # * +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", pixels "px", or points "pt".
994
990
  # * *Returns* - The converter object.
995
991
  def setPageDimensions(width, height)
996
992
  setPageWidth(width)
@@ -1013,11 +1009,11 @@ module Pdfcrowd
1013
1009
 
1014
1010
  # Set the output page top margin.
1015
1011
  #
1016
- # * +top+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1012
+ # * +top+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1017
1013
  # * *Returns* - The converter object.
1018
1014
  def setMarginTop(top)
1019
1015
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(top)
1020
- 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);
1016
+ 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\", pixels \"px\", or points \"pt\".", "set_margin_top"), 470);
1021
1017
  end
1022
1018
 
1023
1019
  @fields['margin_top'] = top
@@ -1026,11 +1022,11 @@ module Pdfcrowd
1026
1022
 
1027
1023
  # Set the output page right margin.
1028
1024
  #
1029
- # * +right+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1025
+ # * +right+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1030
1026
  # * *Returns* - The converter object.
1031
1027
  def setMarginRight(right)
1032
1028
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(right)
1033
- 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);
1029
+ 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\", pixels \"px\", or points \"pt\".", "set_margin_right"), 470);
1034
1030
  end
1035
1031
 
1036
1032
  @fields['margin_right'] = right
@@ -1039,11 +1035,11 @@ module Pdfcrowd
1039
1035
 
1040
1036
  # Set the output page bottom margin.
1041
1037
  #
1042
- # * +bottom+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1038
+ # * +bottom+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1043
1039
  # * *Returns* - The converter object.
1044
1040
  def setMarginBottom(bottom)
1045
1041
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(bottom)
1046
- 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);
1042
+ 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\", pixels \"px\", or points \"pt\".", "set_margin_bottom"), 470);
1047
1043
  end
1048
1044
 
1049
1045
  @fields['margin_bottom'] = bottom
@@ -1052,11 +1048,11 @@ module Pdfcrowd
1052
1048
 
1053
1049
  # Set the output page left margin.
1054
1050
  #
1055
- # * +left+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1051
+ # * +left+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1056
1052
  # * *Returns* - The converter object.
1057
1053
  def setMarginLeft(left)
1058
1054
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(left)
1059
- 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);
1055
+ 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\", pixels \"px\", or points \"pt\".", "set_margin_left"), 470);
1060
1056
  end
1061
1057
 
1062
1058
  @fields['margin_left'] = left
@@ -1074,10 +1070,10 @@ module Pdfcrowd
1074
1070
 
1075
1071
  # Set the output page margins.
1076
1072
  #
1077
- # * +top+ - Set the output page top margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1078
- # * +right+ - Set the output page right margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1079
- # * +bottom+ - Set the output page bottom margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1080
- # * +left+ - Set the output page left margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1073
+ # * +top+ - Set the output page top margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1074
+ # * +right+ - Set the output page right margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1075
+ # * +bottom+ - Set the output page bottom margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1076
+ # * +left+ - Set the output page left margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1081
1077
  # * *Returns* - The converter object.
1082
1078
  def setPageMargins(top, right, bottom, left)
1083
1079
  setMarginTop(top)
@@ -1111,11 +1107,11 @@ module Pdfcrowd
1111
1107
 
1112
1108
  # Set the top left X coordinate of the content area. It is relative to the top left X coordinate of the print area.
1113
1109
  #
1114
- # * +x+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt". It may contain a negative value.
1110
+ # * +x+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt". It may contain a negative value.
1115
1111
  # * *Returns* - The converter object.
1116
1112
  def setContentAreaX(x)
1117
1113
  unless /(?i)^0$|^\-?[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(x)
1118
- 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);
1114
+ 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\", pixels \"px\", or points \"pt\". It may contain a negative value.", "set_content_area_x"), 470);
1119
1115
  end
1120
1116
 
1121
1117
  @fields['content_area_x'] = x
@@ -1124,11 +1120,11 @@ module Pdfcrowd
1124
1120
 
1125
1121
  # Set the top left Y coordinate of the content area. It is relative to the top left Y coordinate of the print area.
1126
1122
  #
1127
- # * +y+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt". It may contain a negative value.
1123
+ # * +y+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt". It may contain a negative value.
1128
1124
  # * *Returns* - The converter object.
1129
1125
  def setContentAreaY(y)
1130
1126
  unless /(?i)^0$|^\-?[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(y)
1131
- 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);
1127
+ 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\", pixels \"px\", or points \"pt\". It may contain a negative value.", "set_content_area_y"), 470);
1132
1128
  end
1133
1129
 
1134
1130
  @fields['content_area_y'] = y
@@ -1137,11 +1133,11 @@ module Pdfcrowd
1137
1133
 
1138
1134
  # Set the width of the content area. It should be at least 1 inch.
1139
1135
  #
1140
- # * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1136
+ # * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1141
1137
  # * *Returns* - The converter object.
1142
1138
  def setContentAreaWidth(width)
1143
1139
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(width)
1144
- 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);
1140
+ 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\", pixels \"px\", or points \"pt\".", "set_content_area_width"), 470);
1145
1141
  end
1146
1142
 
1147
1143
  @fields['content_area_width'] = width
@@ -1150,11 +1146,11 @@ module Pdfcrowd
1150
1146
 
1151
1147
  # Set the height of the content area. It should be at least 1 inch.
1152
1148
  #
1153
- # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1149
+ # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1154
1150
  # * *Returns* - The converter object.
1155
1151
  def setContentAreaHeight(height)
1156
1152
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
1157
- 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);
1153
+ 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\", pixels \"px\", or points \"pt\".", "set_content_area_height"), 470);
1158
1154
  end
1159
1155
 
1160
1156
  @fields['content_area_height'] = height
@@ -1163,10 +1159,10 @@ module Pdfcrowd
1163
1159
 
1164
1160
  # Set the content area position and size. The content area enables to specify a web page area to be converted.
1165
1161
  #
1166
- # * +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.
1167
- # * +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.
1168
- # * +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".
1169
- # * +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".
1162
+ # * +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", pixels "px", or points "pt". It may contain a negative value.
1163
+ # * +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", pixels "px", or points "pt". It may contain a negative value.
1164
+ # * +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", pixels "px", or points "pt".
1165
+ # * +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", pixels "px", or points "pt".
1170
1166
  # * *Returns* - The converter object.
1171
1167
  def setContentArea(x, y, width, height)
1172
1168
  setContentAreaX(x)
@@ -1217,11 +1213,11 @@ module Pdfcrowd
1217
1213
 
1218
1214
  # Set the header height.
1219
1215
  #
1220
- # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1216
+ # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1221
1217
  # * *Returns* - The converter object.
1222
1218
  def setHeaderHeight(height)
1223
1219
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
1224
- 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);
1220
+ 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\", pixels \"px\", or points \"pt\".", "set_header_height"), 470);
1225
1221
  end
1226
1222
 
1227
1223
  @fields['header_height'] = height
@@ -1265,11 +1261,11 @@ module Pdfcrowd
1265
1261
 
1266
1262
  # Set the footer height.
1267
1263
  #
1268
- # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
1264
+ # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
1269
1265
  # * *Returns* - The converter object.
1270
1266
  def setFooterHeight(height)
1271
1267
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
1272
- 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);
1268
+ 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\", pixels \"px\", or points \"pt\".", "set_footer_height"), 470);
1273
1269
  end
1274
1270
 
1275
1271
  @fields['footer_height'] = height
@@ -2396,7 +2392,7 @@ module Pdfcrowd
2396
2392
  self
2397
2393
  end
2398
2394
 
2399
- # Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
2395
+ # Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
2400
2396
  #
2401
2397
  # * +count+ - Number of retries.
2402
2398
  # * *Returns* - The converter object.
@@ -3180,7 +3176,7 @@ module Pdfcrowd
3180
3176
  self
3181
3177
  end
3182
3178
 
3183
- # Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
3179
+ # Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
3184
3180
  #
3185
3181
  # * +count+ - Number of retries.
3186
3182
  # * *Returns* - The converter object.
@@ -3407,6 +3403,82 @@ module Pdfcrowd
3407
3403
  self
3408
3404
  end
3409
3405
 
3406
+ # Set the top left X coordinate of the content area. It is relative to the top left X coordinate of the print area.
3407
+ #
3408
+ # * +x+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3409
+ # * *Returns* - The converter object.
3410
+ def setCropAreaX(x)
3411
+ unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(x)
3412
+ raise Error.new(Pdfcrowd.create_invalid_value_message(x, "setCropAreaX", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_crop_area_x"), 470);
3413
+ end
3414
+
3415
+ @fields['crop_area_x'] = x
3416
+ self
3417
+ end
3418
+
3419
+ # Set the top left Y coordinate of the content area. It is relative to the top left Y coordinate of the print area.
3420
+ #
3421
+ # * +y+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3422
+ # * *Returns* - The converter object.
3423
+ def setCropAreaY(y)
3424
+ unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(y)
3425
+ raise Error.new(Pdfcrowd.create_invalid_value_message(y, "setCropAreaY", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_crop_area_y"), 470);
3426
+ end
3427
+
3428
+ @fields['crop_area_y'] = y
3429
+ self
3430
+ end
3431
+
3432
+ # Set the width of the content area. It should be at least 1 inch.
3433
+ #
3434
+ # * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3435
+ # * *Returns* - The converter object.
3436
+ def setCropAreaWidth(width)
3437
+ unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(width)
3438
+ raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setCropAreaWidth", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_crop_area_width"), 470);
3439
+ end
3440
+
3441
+ @fields['crop_area_width'] = width
3442
+ self
3443
+ end
3444
+
3445
+ # Set the height of the content area. It should be at least 1 inch.
3446
+ #
3447
+ # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3448
+ # * *Returns* - The converter object.
3449
+ def setCropAreaHeight(height)
3450
+ unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
3451
+ raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setCropAreaHeight", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_crop_area_height"), 470);
3452
+ end
3453
+
3454
+ @fields['crop_area_height'] = height
3455
+ self
3456
+ end
3457
+
3458
+ # Set the content area position and size. The content area enables to specify the part to be converted.
3459
+ #
3460
+ # * +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", pixels "px", or points "pt".
3461
+ # * +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", pixels "px", or points "pt".
3462
+ # * +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", pixels "px", or points "pt".
3463
+ # * +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", pixels "px", or points "pt".
3464
+ # * *Returns* - The converter object.
3465
+ def setCropArea(x, y, width, height)
3466
+ setCropAreaX(x)
3467
+ setCropAreaY(y)
3468
+ setCropAreaWidth(width)
3469
+ setCropAreaHeight(height)
3470
+ self
3471
+ end
3472
+
3473
+ # Remove borders of an image which does not change in color.
3474
+ #
3475
+ # * +value+ - Set to true to remove borders.
3476
+ # * *Returns* - The converter object.
3477
+ def setRemoveBorders(value)
3478
+ @fields['remove_borders'] = value
3479
+ self
3480
+ end
3481
+
3410
3482
  # Set the output canvas size.
3411
3483
  #
3412
3484
  # * +size+ - Allowed values are A0, A1, A2, A3, A4, A5, A6, Letter.
@@ -3422,11 +3494,11 @@ module Pdfcrowd
3422
3494
 
3423
3495
  # Set the output canvas width.
3424
3496
  #
3425
- # * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3497
+ # * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3426
3498
  # * *Returns* - The converter object.
3427
3499
  def setCanvasWidth(width)
3428
3500
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(width)
3429
- raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setCanvasWidth", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_canvas_width"), 470);
3501
+ raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setCanvasWidth", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_canvas_width"), 470);
3430
3502
  end
3431
3503
 
3432
3504
  @fields['canvas_width'] = width
@@ -3435,11 +3507,11 @@ module Pdfcrowd
3435
3507
 
3436
3508
  # Set the output canvas height.
3437
3509
  #
3438
- # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3510
+ # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3439
3511
  # * *Returns* - The converter object.
3440
3512
  def setCanvasHeight(height)
3441
3513
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
3442
- raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setCanvasHeight", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_canvas_height"), 470);
3514
+ raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setCanvasHeight", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_canvas_height"), 470);
3443
3515
  end
3444
3516
 
3445
3517
  @fields['canvas_height'] = height
@@ -3448,8 +3520,8 @@ module Pdfcrowd
3448
3520
 
3449
3521
  # Set the output canvas dimensions. If no canvas size is specified, margins are applied as a border around the image.
3450
3522
  #
3451
- # * +width+ - Set the output canvas width. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3452
- # * +height+ - Set the output canvas height. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3523
+ # * +width+ - Set the output canvas width. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3524
+ # * +height+ - Set the output canvas height. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3453
3525
  # * *Returns* - The converter object.
3454
3526
  def setCanvasDimensions(width, height)
3455
3527
  setCanvasWidth(width)
@@ -3470,7 +3542,7 @@ module Pdfcrowd
3470
3542
  self
3471
3543
  end
3472
3544
 
3473
- # Set the image position on the page.
3545
+ # Set the image position on the canvas.
3474
3546
  #
3475
3547
  # * +position+ - Allowed values are center, top, bottom, left, right, top-left, top-right, bottom-left, bottom-right.
3476
3548
  # * *Returns* - The converter object.
@@ -3483,7 +3555,7 @@ module Pdfcrowd
3483
3555
  self
3484
3556
  end
3485
3557
 
3486
- # Set the mode to print the image on the content area of the page.
3558
+ # Set the mode to print the image on the canvas.
3487
3559
  #
3488
3560
  # * +mode+ - Allowed values are default, fit, stretch.
3489
3561
  # * *Returns* - The converter object.
@@ -3498,11 +3570,11 @@ module Pdfcrowd
3498
3570
 
3499
3571
  # Set the output canvas top margin.
3500
3572
  #
3501
- # * +top+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3573
+ # * +top+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3502
3574
  # * *Returns* - The converter object.
3503
3575
  def setMarginTop(top)
3504
3576
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(top)
3505
- raise Error.new(Pdfcrowd.create_invalid_value_message(top, "setMarginTop", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_top"), 470);
3577
+ raise Error.new(Pdfcrowd.create_invalid_value_message(top, "setMarginTop", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_margin_top"), 470);
3506
3578
  end
3507
3579
 
3508
3580
  @fields['margin_top'] = top
@@ -3511,11 +3583,11 @@ module Pdfcrowd
3511
3583
 
3512
3584
  # Set the output canvas right margin.
3513
3585
  #
3514
- # * +right+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3586
+ # * +right+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3515
3587
  # * *Returns* - The converter object.
3516
3588
  def setMarginRight(right)
3517
3589
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(right)
3518
- raise Error.new(Pdfcrowd.create_invalid_value_message(right, "setMarginRight", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_right"), 470);
3590
+ raise Error.new(Pdfcrowd.create_invalid_value_message(right, "setMarginRight", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_margin_right"), 470);
3519
3591
  end
3520
3592
 
3521
3593
  @fields['margin_right'] = right
@@ -3524,11 +3596,11 @@ module Pdfcrowd
3524
3596
 
3525
3597
  # Set the output canvas bottom margin.
3526
3598
  #
3527
- # * +bottom+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3599
+ # * +bottom+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3528
3600
  # * *Returns* - The converter object.
3529
3601
  def setMarginBottom(bottom)
3530
3602
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(bottom)
3531
- raise Error.new(Pdfcrowd.create_invalid_value_message(bottom, "setMarginBottom", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_bottom"), 470);
3603
+ raise Error.new(Pdfcrowd.create_invalid_value_message(bottom, "setMarginBottom", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_margin_bottom"), 470);
3532
3604
  end
3533
3605
 
3534
3606
  @fields['margin_bottom'] = bottom
@@ -3537,11 +3609,11 @@ module Pdfcrowd
3537
3609
 
3538
3610
  # Set the output canvas left margin.
3539
3611
  #
3540
- # * +left+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3612
+ # * +left+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3541
3613
  # * *Returns* - The converter object.
3542
3614
  def setMarginLeft(left)
3543
3615
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(left)
3544
- raise Error.new(Pdfcrowd.create_invalid_value_message(left, "setMarginLeft", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_left"), 470);
3616
+ raise Error.new(Pdfcrowd.create_invalid_value_message(left, "setMarginLeft", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_margin_left"), 470);
3545
3617
  end
3546
3618
 
3547
3619
  @fields['margin_left'] = left
@@ -3550,10 +3622,10 @@ module Pdfcrowd
3550
3622
 
3551
3623
  # Set the output canvas margins.
3552
3624
  #
3553
- # * +top+ - Set the output canvas top margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3554
- # * +right+ - Set the output canvas right margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3555
- # * +bottom+ - Set the output canvas bottom margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3556
- # * +left+ - Set the output canvas left margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
3625
+ # * +top+ - Set the output canvas top margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3626
+ # * +right+ - Set the output canvas right margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3627
+ # * +bottom+ - Set the output canvas bottom margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3628
+ # * +left+ - Set the output canvas left margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
3557
3629
  # * *Returns* - The converter object.
3558
3630
  def setMargins(top, right, bottom, left)
3559
3631
  setMarginTop(top)
@@ -3712,7 +3784,7 @@ module Pdfcrowd
3712
3784
  self
3713
3785
  end
3714
3786
 
3715
- # Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
3787
+ # Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
3716
3788
  #
3717
3789
  # * +count+ - Number of retries.
3718
3790
  # * *Returns* - The converter object.
@@ -4280,7 +4352,7 @@ module Pdfcrowd
4280
4352
  self
4281
4353
  end
4282
4354
 
4283
- # Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
4355
+ # Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
4284
4356
  #
4285
4357
  # * +count+ - Number of retries.
4286
4358
  # * *Returns* - The converter object.
@@ -4494,6 +4566,82 @@ module Pdfcrowd
4494
4566
  self
4495
4567
  end
4496
4568
 
4569
+ # Set the top left X coordinate of the content area. It is relative to the top left X coordinate of the print area.
4570
+ #
4571
+ # * +x+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4572
+ # * *Returns* - The converter object.
4573
+ def setCropAreaX(x)
4574
+ unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(x)
4575
+ raise Error.new(Pdfcrowd.create_invalid_value_message(x, "setCropAreaX", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_crop_area_x"), 470);
4576
+ end
4577
+
4578
+ @fields['crop_area_x'] = x
4579
+ self
4580
+ end
4581
+
4582
+ # Set the top left Y coordinate of the content area. It is relative to the top left Y coordinate of the print area.
4583
+ #
4584
+ # * +y+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4585
+ # * *Returns* - The converter object.
4586
+ def setCropAreaY(y)
4587
+ unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(y)
4588
+ raise Error.new(Pdfcrowd.create_invalid_value_message(y, "setCropAreaY", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_crop_area_y"), 470);
4589
+ end
4590
+
4591
+ @fields['crop_area_y'] = y
4592
+ self
4593
+ end
4594
+
4595
+ # Set the width of the content area. It should be at least 1 inch.
4596
+ #
4597
+ # * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4598
+ # * *Returns* - The converter object.
4599
+ def setCropAreaWidth(width)
4600
+ unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(width)
4601
+ raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setCropAreaWidth", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_crop_area_width"), 470);
4602
+ end
4603
+
4604
+ @fields['crop_area_width'] = width
4605
+ self
4606
+ end
4607
+
4608
+ # Set the height of the content area. It should be at least 1 inch.
4609
+ #
4610
+ # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4611
+ # * *Returns* - The converter object.
4612
+ def setCropAreaHeight(height)
4613
+ unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
4614
+ raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setCropAreaHeight", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_crop_area_height"), 470);
4615
+ end
4616
+
4617
+ @fields['crop_area_height'] = height
4618
+ self
4619
+ end
4620
+
4621
+ # Set the content area position and size. The content area enables to specify the part to be converted.
4622
+ #
4623
+ # * +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", pixels "px", or points "pt".
4624
+ # * +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", pixels "px", or points "pt".
4625
+ # * +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", pixels "px", or points "pt".
4626
+ # * +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", pixels "px", or points "pt".
4627
+ # * *Returns* - The converter object.
4628
+ def setCropArea(x, y, width, height)
4629
+ setCropAreaX(x)
4630
+ setCropAreaY(y)
4631
+ setCropAreaWidth(width)
4632
+ setCropAreaHeight(height)
4633
+ self
4634
+ end
4635
+
4636
+ # Remove borders of an image which does not change in color.
4637
+ #
4638
+ # * +value+ - Set to true to remove borders.
4639
+ # * *Returns* - The converter object.
4640
+ def setRemoveBorders(value)
4641
+ @fields['remove_borders'] = value
4642
+ self
4643
+ end
4644
+
4497
4645
  # Set the output page size.
4498
4646
  #
4499
4647
  # * +size+ - Allowed values are A0, A1, A2, A3, A4, A5, A6, Letter.
@@ -4509,11 +4657,11 @@ module Pdfcrowd
4509
4657
 
4510
4658
  # Set the output page width.
4511
4659
  #
4512
- # * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4660
+ # * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4513
4661
  # * *Returns* - The converter object.
4514
4662
  def setPageWidth(width)
4515
4663
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(width)
4516
- raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setPageWidth", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_page_width"), 470);
4664
+ raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setPageWidth", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_page_width"), 470);
4517
4665
  end
4518
4666
 
4519
4667
  @fields['page_width'] = width
@@ -4522,11 +4670,11 @@ module Pdfcrowd
4522
4670
 
4523
4671
  # Set the output page height.
4524
4672
  #
4525
- # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4673
+ # * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4526
4674
  # * *Returns* - The converter object.
4527
4675
  def setPageHeight(height)
4528
4676
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
4529
- raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setPageHeight", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_page_height"), 470);
4677
+ raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setPageHeight", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_page_height"), 470);
4530
4678
  end
4531
4679
 
4532
4680
  @fields['page_height'] = height
@@ -4535,8 +4683,8 @@ module Pdfcrowd
4535
4683
 
4536
4684
  # Set the output page dimensions. If no page size is specified, margins are applied as a border around the image.
4537
4685
  #
4538
- # * +width+ - Set the output page width. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4539
- # * +height+ - Set the output page height. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4686
+ # * +width+ - Set the output page width. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4687
+ # * +height+ - Set the output page height. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4540
4688
  # * *Returns* - The converter object.
4541
4689
  def setPageDimensions(width, height)
4542
4690
  setPageWidth(width)
@@ -4585,11 +4733,11 @@ module Pdfcrowd
4585
4733
 
4586
4734
  # Set the output page top margin.
4587
4735
  #
4588
- # * +top+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4736
+ # * +top+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4589
4737
  # * *Returns* - The converter object.
4590
4738
  def setMarginTop(top)
4591
4739
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(top)
4592
- raise Error.new(Pdfcrowd.create_invalid_value_message(top, "setMarginTop", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_top"), 470);
4740
+ raise Error.new(Pdfcrowd.create_invalid_value_message(top, "setMarginTop", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_margin_top"), 470);
4593
4741
  end
4594
4742
 
4595
4743
  @fields['margin_top'] = top
@@ -4598,11 +4746,11 @@ module Pdfcrowd
4598
4746
 
4599
4747
  # Set the output page right margin.
4600
4748
  #
4601
- # * +right+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4749
+ # * +right+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4602
4750
  # * *Returns* - The converter object.
4603
4751
  def setMarginRight(right)
4604
4752
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(right)
4605
- raise Error.new(Pdfcrowd.create_invalid_value_message(right, "setMarginRight", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_right"), 470);
4753
+ raise Error.new(Pdfcrowd.create_invalid_value_message(right, "setMarginRight", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_margin_right"), 470);
4606
4754
  end
4607
4755
 
4608
4756
  @fields['margin_right'] = right
@@ -4611,11 +4759,11 @@ module Pdfcrowd
4611
4759
 
4612
4760
  # Set the output page bottom margin.
4613
4761
  #
4614
- # * +bottom+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4762
+ # * +bottom+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4615
4763
  # * *Returns* - The converter object.
4616
4764
  def setMarginBottom(bottom)
4617
4765
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(bottom)
4618
- raise Error.new(Pdfcrowd.create_invalid_value_message(bottom, "setMarginBottom", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_bottom"), 470);
4766
+ raise Error.new(Pdfcrowd.create_invalid_value_message(bottom, "setMarginBottom", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_margin_bottom"), 470);
4619
4767
  end
4620
4768
 
4621
4769
  @fields['margin_bottom'] = bottom
@@ -4624,11 +4772,11 @@ module Pdfcrowd
4624
4772
 
4625
4773
  # Set the output page left margin.
4626
4774
  #
4627
- # * +left+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4775
+ # * +left+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4628
4776
  # * *Returns* - The converter object.
4629
4777
  def setMarginLeft(left)
4630
4778
  unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(left)
4631
- raise Error.new(Pdfcrowd.create_invalid_value_message(left, "setMarginLeft", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_left"), 470);
4779
+ raise Error.new(Pdfcrowd.create_invalid_value_message(left, "setMarginLeft", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", pixels \"px\", or points \"pt\".", "set_margin_left"), 470);
4632
4780
  end
4633
4781
 
4634
4782
  @fields['margin_left'] = left
@@ -4637,10 +4785,10 @@ module Pdfcrowd
4637
4785
 
4638
4786
  # Set the output page margins.
4639
4787
  #
4640
- # * +top+ - Set the output page top margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4641
- # * +right+ - Set the output page right margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4642
- # * +bottom+ - Set the output page bottom margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4643
- # * +left+ - Set the output page left margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
4788
+ # * +top+ - Set the output page top margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4789
+ # * +right+ - Set the output page right margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4790
+ # * +bottom+ - Set the output page bottom margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4791
+ # * +left+ - Set the output page left margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
4644
4792
  # * *Returns* - The converter object.
4645
4793
  def setPageMargins(top, right, bottom, left)
4646
4794
  setMarginTop(top)
@@ -5121,7 +5269,7 @@ module Pdfcrowd
5121
5269
  self
5122
5270
  end
5123
5271
 
5124
- # Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
5272
+ # Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
5125
5273
  #
5126
5274
  # * +count+ - Number of retries.
5127
5275
  # * *Returns* - The converter object.
@@ -5578,7 +5726,7 @@ module Pdfcrowd
5578
5726
  self
5579
5727
  end
5580
5728
 
5581
- # Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
5729
+ # Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
5582
5730
  #
5583
5731
  # * +count+ - Number of retries.
5584
5732
  # * *Returns* - The converter object.
@@ -6077,7 +6225,7 @@ module Pdfcrowd
6077
6225
  self
6078
6226
  end
6079
6227
 
6080
- # Specifies the number of automatic retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
6228
+ # Specifies the number of automatic retries when the 502 or 503 HTTP status code is received. The status code indicates a temporary network issue. This feature can be disabled by setting to 0.
6081
6229
  #
6082
6230
  # * +count+ - Number of retries.
6083
6231
  # * *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: 5.11.0
4
+ version: 5.12.1
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-01-16 00:00:00.000000000 Z
11
+ date: 2023-02-15 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.