pdfcrowd 5.4.0 → 5.6.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 +93 -40
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d5e4aae437d0c4993770eb539bcd6ec2ead0c8e825e3c3722be116d3b8547aa
4
- data.tar.gz: 0dfb6bd06a801af12961879abf6f7fb2b0abe641612c53c064479fd7bd484b03
3
+ metadata.gz: b696ba0a509cbffc0339d32959c96451b72b9d46bb86d25a51a4a460c67007f5
4
+ data.tar.gz: 9bf05c8b6d24a00691f0dbdeba3dcbbb1e808ce7c7b9fca291cbe87406d3a082
5
5
  SHA512:
6
- metadata.gz: c7fbfa74285c6e038ec517bbd084b2d0022939233be6b639d9c412a4c9a40018029c7a82b86c34f2a957b5c44914ecd54b3326d5381f101764b9055088fdc86d
7
- data.tar.gz: b076d3ea8b2766b5668f36fcafc895e597e47beb0a64c0237ace8ff25e121f934a0ec54c53456578f60b39611a2c2d29617fc805ab5a397b87d8f0fd8f7b7161
6
+ metadata.gz: 06e73ac3188ef5872cc338988b5fd1e1f20272713dd91a2cbea02c1ecaee328727bffebca505589ebc00c9813b9b01f467997689aa6b8faebc57a099cec50601
7
+ data.tar.gz: 06bb9f3f2b43b342a5f3e7d9fdc7011923e37408be20ba299bd47f91c8c65bf5f597339153014e381ffd69ff8660e301409408748435c09c8d90abfd0688649a
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.4.0'
533
+ CLIENT_VERSION = '5.6.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.4.0 (https://pdfcrowd.com)')
544
+ setUserAgent('pdfcrowd_ruby_client/5.6.1 (https://pdfcrowd.com)')
545
545
 
546
546
  @retry_count = 1
547
547
  @converter_version = '20.10'
@@ -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+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_page_width"), 470);
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+ - Can be -1 or specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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", "Can be -1 or specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_page_height"), 470);
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. Can 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. Can be -1 or specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_margin_top"), 470);
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+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_margin_right"), 470);
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+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_margin_bottom"), 470);
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+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_margin_left"), 470);
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. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
1072
- # * +right+ - Set the output page right margin. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
1073
- # * +bottom+ - Set the output page bottom margin. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
1074
- # * +left+ - Set the output page left margin. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt). It may contain a negative value.
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", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt). It may contain a negative value.", "set_content_area_x"), 470);
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+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt). It may contain a negative value.
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", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt). It may contain a negative value.", "set_content_area_y"), 470);
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+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_content_area_width"), 470);
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+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_content_area_height"), 470);
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. Can 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. Can 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. Can 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. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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)
@@ -1183,7 +1183,7 @@ module Pdfcrowd
1183
1183
  self
1184
1184
  end
1185
1185
 
1186
- # Load an HTML code from the specified URL and use it as the page header. The following classes can be used in the HTML. The content of the respective elements will be expanded as follows: pdfcrowd-page-count - the total page count of printed pages pdfcrowd-page-number - the current page number pdfcrowd-source-url - the source URL of a converted document The following attributes can be used: data-pdfcrowd-number-format - specifies the type of the used numerals. Allowed values: arabic - Arabic numerals, they are used by default roman - Roman numerals eastern-arabic - Eastern Arabic numerals bengali - Bengali numerals devanagari - Devanagari numerals thai - Thai numerals east-asia - Chinese, Vietnamese, Japanese and Korean numerals chinese-formal - Chinese formal numerals Please contact us if you need another type of numerals. Example: <span class='pdfcrowd-page-number' data-pdfcrowd-number-format='roman'></span> data-pdfcrowd-placement - specifies where to place the source URL. Allowed values: The URL is inserted to the content Example: <span class='pdfcrowd-source-url'></span> will produce <span>http://example.com</span> href - the URL is set to the href attribute Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href'>Link to source</a> will produce <a href='http://example.com'>Link to source</a> href-and-content - the URL is set to the href attribute and to the content Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href-and-content'></a> will produce <a href='http://example.com'>http://example.com</a>
1186
+ # Load an HTML code from the specified URL and use it as the page header. The following classes can be used in the HTML. The content of the respective elements will be expanded as follows: pdfcrowd-page-count - the total page count of printed pages pdfcrowd-page-number - the current page number pdfcrowd-source-url - the source URL of the converted document pdfcrowd-source-title - the title of the converted document The following attributes can be used: data-pdfcrowd-number-format - specifies the type of the used numerals. Allowed values: arabic - Arabic numerals, they are used by default roman - Roman numerals eastern-arabic - Eastern Arabic numerals bengali - Bengali numerals devanagari - Devanagari numerals thai - Thai numerals east-asia - Chinese, Vietnamese, Japanese and Korean numerals chinese-formal - Chinese formal numerals Please contact us if you need another type of numerals. Example: <span class='pdfcrowd-page-number' data-pdfcrowd-number-format='roman'></span> data-pdfcrowd-placement - specifies where to place the source URL. Allowed values: The URL is inserted to the content Example: <span class='pdfcrowd-source-url'></span> will produce <span>http://example.com</span> href - the URL is set to the href attribute Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href'>Link to source</a> will produce <a href='http://example.com'>Link to source</a> href-and-content - the URL is set to the href attribute and to the content Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href-and-content'></a> will produce <a href='http://example.com'>http://example.com</a>
1187
1187
  #
1188
1188
  # * +url+ - The supported protocols are http:// and https://.
1189
1189
  # * *Returns* - The converter object.
@@ -1196,7 +1196,7 @@ module Pdfcrowd
1196
1196
  self
1197
1197
  end
1198
1198
 
1199
- # Use the specified HTML code as the page header. The following classes can be used in the HTML. The content of the respective elements will be expanded as follows: pdfcrowd-page-count - the total page count of printed pages pdfcrowd-page-number - the current page number pdfcrowd-source-url - the source URL of a converted document The following attributes can be used: data-pdfcrowd-number-format - specifies the type of the used numerals. Allowed values: arabic - Arabic numerals, they are used by default roman - Roman numerals eastern-arabic - Eastern Arabic numerals bengali - Bengali numerals devanagari - Devanagari numerals thai - Thai numerals east-asia - Chinese, Vietnamese, Japanese and Korean numerals chinese-formal - Chinese formal numerals Please contact us if you need another type of numerals. Example: <span class='pdfcrowd-page-number' data-pdfcrowd-number-format='roman'></span> data-pdfcrowd-placement - specifies where to place the source URL. Allowed values: The URL is inserted to the content Example: <span class='pdfcrowd-source-url'></span> will produce <span>http://example.com</span> href - the URL is set to the href attribute Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href'>Link to source</a> will produce <a href='http://example.com'>Link to source</a> href-and-content - the URL is set to the href attribute and to the content Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href-and-content'></a> will produce <a href='http://example.com'>http://example.com</a>
1199
+ # Use the specified HTML code as the page header. The following classes can be used in the HTML. The content of the respective elements will be expanded as follows: pdfcrowd-page-count - the total page count of printed pages pdfcrowd-page-number - the current page number pdfcrowd-source-url - the source URL of the converted document pdfcrowd-source-title - the title of the converted document The following attributes can be used: data-pdfcrowd-number-format - specifies the type of the used numerals. Allowed values: arabic - Arabic numerals, they are used by default roman - Roman numerals eastern-arabic - Eastern Arabic numerals bengali - Bengali numerals devanagari - Devanagari numerals thai - Thai numerals east-asia - Chinese, Vietnamese, Japanese and Korean numerals chinese-formal - Chinese formal numerals Please contact us if you need another type of numerals. Example: <span class='pdfcrowd-page-number' data-pdfcrowd-number-format='roman'></span> data-pdfcrowd-placement - specifies where to place the source URL. Allowed values: The URL is inserted to the content Example: <span class='pdfcrowd-source-url'></span> will produce <span>http://example.com</span> href - the URL is set to the href attribute Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href'>Link to source</a> will produce <a href='http://example.com'>Link to source</a> href-and-content - the URL is set to the href attribute and to the content Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href-and-content'></a> will produce <a href='http://example.com'>http://example.com</a>
1200
1200
  #
1201
1201
  # * +html+ - The string must not be empty.
1202
1202
  # * *Returns* - The converter object.
@@ -1211,11 +1211,11 @@ module Pdfcrowd
1211
1211
 
1212
1212
  # Set the header height.
1213
1213
  #
1214
- # * +height+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_header_height"), 470);
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
@@ -1231,7 +1231,7 @@ module Pdfcrowd
1231
1231
  self
1232
1232
  end
1233
1233
 
1234
- # Load an HTML code from the specified URL and use it as the page footer. The following classes can be used in the HTML. The content of the respective elements will be expanded as follows: pdfcrowd-page-count - the total page count of printed pages pdfcrowd-page-number - the current page number pdfcrowd-source-url - the source URL of a converted document The following attributes can be used: data-pdfcrowd-number-format - specifies the type of the used numerals. Allowed values: arabic - Arabic numerals, they are used by default roman - Roman numerals eastern-arabic - Eastern Arabic numerals bengali - Bengali numerals devanagari - Devanagari numerals thai - Thai numerals east-asia - Chinese, Vietnamese, Japanese and Korean numerals chinese-formal - Chinese formal numerals Please contact us if you need another type of numerals. Example: <span class='pdfcrowd-page-number' data-pdfcrowd-number-format='roman'></span> data-pdfcrowd-placement - specifies where to place the source URL. Allowed values: The URL is inserted to the content Example: <span class='pdfcrowd-source-url'></span> will produce <span>http://example.com</span> href - the URL is set to the href attribute Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href'>Link to source</a> will produce <a href='http://example.com'>Link to source</a> href-and-content - the URL is set to the href attribute and to the content Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href-and-content'></a> will produce <a href='http://example.com'>http://example.com</a>
1234
+ # Load an HTML code from the specified URL and use it as the page footer. The following classes can be used in the HTML. The content of the respective elements will be expanded as follows: pdfcrowd-page-count - the total page count of printed pages pdfcrowd-page-number - the current page number pdfcrowd-source-url - the source URL of the converted document pdfcrowd-source-title - the title of the converted document The following attributes can be used: data-pdfcrowd-number-format - specifies the type of the used numerals. Allowed values: arabic - Arabic numerals, they are used by default roman - Roman numerals eastern-arabic - Eastern Arabic numerals bengali - Bengali numerals devanagari - Devanagari numerals thai - Thai numerals east-asia - Chinese, Vietnamese, Japanese and Korean numerals chinese-formal - Chinese formal numerals Please contact us if you need another type of numerals. Example: <span class='pdfcrowd-page-number' data-pdfcrowd-number-format='roman'></span> data-pdfcrowd-placement - specifies where to place the source URL. Allowed values: The URL is inserted to the content Example: <span class='pdfcrowd-source-url'></span> will produce <span>http://example.com</span> href - the URL is set to the href attribute Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href'>Link to source</a> will produce <a href='http://example.com'>Link to source</a> href-and-content - the URL is set to the href attribute and to the content Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href-and-content'></a> will produce <a href='http://example.com'>http://example.com</a>
1235
1235
  #
1236
1236
  # * +url+ - The supported protocols are http:// and https://.
1237
1237
  # * *Returns* - The converter object.
@@ -1244,7 +1244,7 @@ module Pdfcrowd
1244
1244
  self
1245
1245
  end
1246
1246
 
1247
- # Use the specified HTML as the page footer. The following classes can be used in the HTML. The content of the respective elements will be expanded as follows: pdfcrowd-page-count - the total page count of printed pages pdfcrowd-page-number - the current page number pdfcrowd-source-url - the source URL of a converted document The following attributes can be used: data-pdfcrowd-number-format - specifies the type of the used numerals. Allowed values: arabic - Arabic numerals, they are used by default roman - Roman numerals eastern-arabic - Eastern Arabic numerals bengali - Bengali numerals devanagari - Devanagari numerals thai - Thai numerals east-asia - Chinese, Vietnamese, Japanese and Korean numerals chinese-formal - Chinese formal numerals Please contact us if you need another type of numerals. Example: <span class='pdfcrowd-page-number' data-pdfcrowd-number-format='roman'></span> data-pdfcrowd-placement - specifies where to place the source URL. Allowed values: The URL is inserted to the content Example: <span class='pdfcrowd-source-url'></span> will produce <span>http://example.com</span> href - the URL is set to the href attribute Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href'>Link to source</a> will produce <a href='http://example.com'>Link to source</a> href-and-content - the URL is set to the href attribute and to the content Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href-and-content'></a> will produce <a href='http://example.com'>http://example.com</a>
1247
+ # Use the specified HTML as the page footer. The following classes can be used in the HTML. The content of the respective elements will be expanded as follows: pdfcrowd-page-count - the total page count of printed pages pdfcrowd-page-number - the current page number pdfcrowd-source-url - the source URL of the converted document pdfcrowd-source-title - the title of the converted document The following attributes can be used: data-pdfcrowd-number-format - specifies the type of the used numerals. Allowed values: arabic - Arabic numerals, they are used by default roman - Roman numerals eastern-arabic - Eastern Arabic numerals bengali - Bengali numerals devanagari - Devanagari numerals thai - Thai numerals east-asia - Chinese, Vietnamese, Japanese and Korean numerals chinese-formal - Chinese formal numerals Please contact us if you need another type of numerals. Example: <span class='pdfcrowd-page-number' data-pdfcrowd-number-format='roman'></span> data-pdfcrowd-placement - specifies where to place the source URL. Allowed values: The URL is inserted to the content Example: <span class='pdfcrowd-source-url'></span> will produce <span>http://example.com</span> href - the URL is set to the href attribute Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href'>Link to source</a> will produce <a href='http://example.com'>Link to source</a> href-and-content - the URL is set to the href attribute and to the content Example: <a class='pdfcrowd-source-url' data-pdfcrowd-placement='href-and-content'></a> will produce <a href='http://example.com'>http://example.com</a>
1248
1248
  #
1249
1249
  # * +html+ - The string must not be empty.
1250
1250
  # * *Returns* - The converter object.
@@ -1259,11 +1259,11 @@ module Pdfcrowd
1259
1259
 
1260
1260
  # Set the footer height.
1261
1261
  #
1262
- # * +height+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
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", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_footer_height"), 470);
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
@@ -1703,6 +1703,28 @@ module Pdfcrowd
1703
1703
  self
1704
1704
  end
1705
1705
 
1706
+ # The main HTML element for conversion is detected automatically.
1707
+ #
1708
+ # * +value+ - Set to true to detect the main element.
1709
+ # * *Returns* - The converter object.
1710
+ def setAutoDetectElementToConvert(value)
1711
+ @fields['auto_detect_element_to_convert'] = value
1712
+ self
1713
+ end
1714
+
1715
+ # The input HTML is automatically enhanced to improve the readability.
1716
+ #
1717
+ # * +enhancements+ - Allowed values are none, readability-v1.
1718
+ # * *Returns* - The converter object.
1719
+ def setReadabilityEnhancements(enhancements)
1720
+ unless /(?i)^(none|readability-v1)$/.match(enhancements)
1721
+ raise Error.new(Pdfcrowd.create_invalid_value_message(enhancements, "setReadabilityEnhancements", "html-to-pdf", "Allowed values are none, readability-v1.", "set_readability_enhancements"), 470);
1722
+ end
1723
+
1724
+ @fields['readability_enhancements'] = enhancements
1725
+ self
1726
+ end
1727
+
1706
1728
  # Set the viewport width in pixels. The viewport is the user's visible area of the page.
1707
1729
  #
1708
1730
  # * +width+ - The value must be in the range 96-65000.
@@ -1818,6 +1840,15 @@ module Pdfcrowd
1818
1840
  self
1819
1841
  end
1820
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
+
1821
1852
  # Create linearized PDF. This is also known as Fast Web View.
1822
1853
  #
1823
1854
  # * +value+ - Set to true to create linearized PDF.
@@ -2838,6 +2869,28 @@ module Pdfcrowd
2838
2869
  self
2839
2870
  end
2840
2871
 
2872
+ # The main HTML element for conversion is detected automatically.
2873
+ #
2874
+ # * +value+ - Set to true to detect the main element.
2875
+ # * *Returns* - The converter object.
2876
+ def setAutoDetectElementToConvert(value)
2877
+ @fields['auto_detect_element_to_convert'] = value
2878
+ self
2879
+ end
2880
+
2881
+ # The input HTML is automatically enhanced to improve the readability.
2882
+ #
2883
+ # * +enhancements+ - Allowed values are none, readability-v1.
2884
+ # * *Returns* - The converter object.
2885
+ def setReadabilityEnhancements(enhancements)
2886
+ unless /(?i)^(none|readability-v1)$/.match(enhancements)
2887
+ raise Error.new(Pdfcrowd.create_invalid_value_message(enhancements, "setReadabilityEnhancements", "html-to-image", "Allowed values are none, readability-v1.", "set_readability_enhancements"), 470);
2888
+ end
2889
+
2890
+ @fields['readability_enhancements'] = enhancements
2891
+ self
2892
+ end
2893
+
2841
2894
  # Set the output image width in pixels.
2842
2895
  #
2843
2896
  # * +width+ - The value must be in the range 96-65000.
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.0
4
+ version: 5.6.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: 2022-02-08 00:00:00.000000000 Z
11
+ date: 2022-07-11 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.