pdfcrowd 6.1.0 → 6.2.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.
- checksums.yaml +4 -4
- data/lib/pdfcrowd.rb +38 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f97c72508c22bb03da1413d7868420657d6e93fe0447913d93b71c1dc9bfa1fb
|
4
|
+
data.tar.gz: 3956525e9d2c6ee9c490684fcda82e933e98fca0bbc5d4176df112ef03c8cf1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f56fbea6b28e21d0f74bde3cb9e33e04cabbb20f38ee4e3a54f46c722f8dba14ed35be040f0c464b7c0649bbac33b896f7d9d4d136d8f45986c821beab727fde
|
7
|
+
data.tar.gz: 3a50f9412ad1f5236c0ab3d335c50aad84a9f41bf76aef3b9e381c35fd0fb57aac85d62dee9f1056ad2b19f30838d883029e63d69722a57919ecffde75860c22
|
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 = '6.1
|
533
|
+
CLIENT_VERSION = '6.2.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/6.1
|
544
|
+
setUserAgent('pdfcrowd_ruby_client/6.2.1 (https://pdfcrowd.com)')
|
545
545
|
|
546
546
|
@retry_count = 1
|
547
547
|
@converter_version = '24.04'
|
@@ -1085,11 +1085,11 @@ module Pdfcrowd
|
|
1085
1085
|
|
1086
1086
|
# Set the page range to print.
|
1087
1087
|
#
|
1088
|
-
# * +pages+ - A comma separated list of page numbers or ranges.
|
1088
|
+
# * +pages+ - A comma separated list of page numbers or ranges. Special strings may be used, such as `odd`, `even` and `last`.
|
1089
1089
|
# * *Returns* - The converter object.
|
1090
1090
|
def setPrintPageRange(pages)
|
1091
|
-
unless /^(?:\s*(?:\d+|(?:\d*\s*\-\s*\d+)|(?:\d+\s*\-\s*\d*))\s*,\s*)*\s*(?:\d+|(?:\d*\s*\-\s*\d+)|(?:\d+\s*\-\s*\d*))\s*$/.match(pages)
|
1092
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(pages, "setPrintPageRange", "html-to-pdf", "A comma separated list of page numbers or ranges.", "set_print_page_range"), 470);
|
1091
|
+
unless /^(?:\s*(?:\d+|(?:\d*\s*\-\s*\d+)|(?:\d+\s*\-\s*\d*)|odd|even|last)\s*,\s*)*\s*(?:\d+|(?:\d*\s*\-\s*\d+)|(?:\d+\s*\-\s*\d*)|odd|even|last)\s*$/.match(pages)
|
1092
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(pages, "setPrintPageRange", "html-to-pdf", "A comma separated list of page numbers or ranges. Special strings may be used, such as `odd`, `even` and `last`.", "set_print_page_range"), 470);
|
1093
1093
|
end
|
1094
1094
|
|
1095
1095
|
@fields['print_page_range'] = pages
|
@@ -1098,11 +1098,11 @@ module Pdfcrowd
|
|
1098
1098
|
|
1099
1099
|
# Set the viewport width for formatting the HTML content when generating a PDF. By specifying a viewport width, you can control how the content is rendered, ensuring it mimics the appearance on various devices or matches specific design requirements.
|
1100
1100
|
#
|
1101
|
-
# * +width+ - The width of the viewport. The value must be "balanced", "small", "medium", "large", "extra-large", or a number in the range 96-
|
1101
|
+
# * +width+ - The width of the viewport. The value must be "balanced", "small", "medium", "large", "extra-large", or a number in the range 96-65000px.
|
1102
1102
|
# * *Returns* - The converter object.
|
1103
1103
|
def setContentViewportWidth(width)
|
1104
|
-
unless /(?i)^(balanced|small|medium|large|extra-large|[0-9]+)$/.match(width)
|
1105
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setContentViewportWidth", "html-to-pdf", "The value must be \"balanced\", \"small\", \"medium\", \"large\", \"extra-large\", or a number in the range 96-
|
1104
|
+
unless /(?i)^(balanced|small|medium|large|extra-large|[0-9]+(px)?)$/.match(width)
|
1105
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setContentViewportWidth", "html-to-pdf", "The value must be \"balanced\", \"small\", \"medium\", \"large\", \"extra-large\", or a number in the range 96-65000px.", "set_content_viewport_width"), 470);
|
1106
1106
|
end
|
1107
1107
|
|
1108
1108
|
@fields['content_viewport_width'] = width
|
@@ -1114,7 +1114,7 @@ module Pdfcrowd
|
|
1114
1114
|
# * +height+ - The viewport height. The value must be "auto", "large", or a number.
|
1115
1115
|
# * *Returns* - The converter object.
|
1116
1116
|
def setContentViewportHeight(height)
|
1117
|
-
unless /(?i)^(auto|large|[0-9]+)$/.match(height)
|
1117
|
+
unless /(?i)^(auto|large|[0-9]+(px)?)$/.match(height)
|
1118
1118
|
raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setContentViewportHeight", "html-to-pdf", "The value must be \"auto\", \"large\", or a number.", "set_content_viewport_height"), 470);
|
1119
1119
|
end
|
1120
1120
|
|
@@ -1253,7 +1253,7 @@ module Pdfcrowd
|
|
1253
1253
|
self
|
1254
1254
|
end
|
1255
1255
|
|
1256
|
-
# The page header is not printed on the specified pages.
|
1256
|
+
# The page header content is not printed on the specified pages. To remove the entire header area, use the conversion config.
|
1257
1257
|
#
|
1258
1258
|
# * +pages+ - List of physical page numbers. Negative numbers count backwards from the last page: -1 is the last page, -2 is the last but one page, and so on. A comma separated list of page numbers.
|
1259
1259
|
# * *Returns* - The converter object.
|
@@ -1266,7 +1266,7 @@ module Pdfcrowd
|
|
1266
1266
|
self
|
1267
1267
|
end
|
1268
1268
|
|
1269
|
-
# The page footer is not printed on the specified pages.
|
1269
|
+
# The page footer content is not printed on the specified pages. To remove the entire footer area, use the conversion config.
|
1270
1270
|
#
|
1271
1271
|
# * +pages+ - List of physical page numbers. Negative numbers count backwards from the last page: -1 is the last page, -2 is the last but one page, and so on. A comma separated list of page numbers.
|
1272
1272
|
# * *Returns* - The converter object.
|
@@ -2426,7 +2426,7 @@ module Pdfcrowd
|
|
2426
2426
|
self
|
2427
2427
|
end
|
2428
2428
|
|
2429
|
-
# Allows to configure conversion via JSON. The configuration defines various page settings for individual PDF pages or ranges of pages. It provides flexibility in designing each page of the PDF, giving control over each page's size, header, footer etc. If a page or parameter is not explicitly specified, the system will use the default settings for that page or attribute. If a JSON configuration is provided, the settings in the JSON will take precedence over the global options. The structure of the JSON must be: pageSetup: An array of objects where each object defines the configuration for a specific page or range of pages. The following properties can be set for each page object: pages: A comma-separated list of page numbers or ranges. For example: 1-: from page 1 to the end of the document 2: only the 2nd page 2,
|
2429
|
+
# Allows to configure conversion via JSON. The configuration defines various page settings for individual PDF pages or ranges of pages. It provides flexibility in designing each page of the PDF, giving control over each page's size, header, footer etc. If a page or parameter is not explicitly specified, the system will use the default settings for that page or attribute. If a JSON configuration is provided, the settings in the JSON will take precedence over the global options. The structure of the JSON must be: pageSetup: An array of objects where each object defines the configuration for a specific page or range of pages. The following properties can be set for each page object: pages: A comma-separated list of page numbers or ranges. Special strings may be used, such as `odd`, `even` and `last`. For example: 1-: from page 1 to the end of the document 2: only the 2nd page 2,4,6: pages 2, 4, and 6 2-5: pages 2 through 5 odd,2: the 2nd page and all odd pages pageSize: The page size (optional). Possible values: A0, A1, A2, A3, A4, A5, A6, Letter. pageWidth: The width of the page (optional). pageHeight: The height of the page (optional). marginLeft: Left margin (optional). marginRight: Right margin (optional). marginTop: Top margin (optional). marginBottom: Bottom margin (optional). displayHeader: Header appearance (optional). Possible values: none: completely excluded space: only the content is excluded, the space is used content: the content is printed (default) displayFooter: Footer appearance (optional). Possible values: none: completely excluded space: only the content is excluded, the space is used content: the content is printed (default) headerHeight: Height of the header (optional). footerHeight: Height of the footer (optional). orientation: Page orientation, such as "portrait" or "landscape" (optional). Dimensions may be empty, 0 or specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".
|
2430
2430
|
#
|
2431
2431
|
# * +json_string+ - The JSON string.
|
2432
2432
|
# * *Returns* - The converter object.
|
@@ -5703,6 +5703,19 @@ module Pdfcrowd
|
|
5703
5703
|
self
|
5704
5704
|
end
|
5705
5705
|
|
5706
|
+
# Sets the processing mode for handling Type 3 fonts.
|
5707
|
+
#
|
5708
|
+
# * +mode+ - The type3 font mode. Allowed values are raster, convert.
|
5709
|
+
# * *Returns* - The converter object.
|
5710
|
+
def setType3Mode(mode)
|
5711
|
+
unless /(?i)^(raster|convert)$/.match(mode)
|
5712
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(mode, "setType3Mode", "pdf-to-html", "Allowed values are raster, convert.", "set_type3_mode"), 470);
|
5713
|
+
end
|
5714
|
+
|
5715
|
+
@fields['type3_mode'] = mode
|
5716
|
+
self
|
5717
|
+
end
|
5718
|
+
|
5706
5719
|
# Converts ligatures, two or more letters combined into a single glyph, back into their individual ASCII characters.
|
5707
5720
|
#
|
5708
5721
|
# * +value+ - Set to true to split ligatures.
|
@@ -5712,6 +5725,19 @@ module Pdfcrowd
|
|
5712
5725
|
self
|
5713
5726
|
end
|
5714
5727
|
|
5728
|
+
# Apply custom CSS to the output HTML document. It allows you to modify the visual appearance and layout. Tip: Using !important in custom CSS provides a way to prioritize and override conflicting styles.
|
5729
|
+
#
|
5730
|
+
# * +css+ - A string containing valid CSS. The string must not be empty.
|
5731
|
+
# * *Returns* - The converter object.
|
5732
|
+
def setCustomCss(css)
|
5733
|
+
if (!(!css.nil? && !css.empty?))
|
5734
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(css, "setCustomCss", "pdf-to-html", "The string must not be empty.", "set_custom_css"), 470);
|
5735
|
+
end
|
5736
|
+
|
5737
|
+
@fields['custom_css'] = css
|
5738
|
+
self
|
5739
|
+
end
|
5740
|
+
|
5715
5741
|
# A helper method to determine if the output file is a zip archive. The output of the conversion may be either an HTML file or a zip file containing the HTML and its external assets.
|
5716
5742
|
# * *Returns* - True if the conversion output is a zip file, otherwise False.
|
5717
5743
|
def isZippedOutput()
|
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: 6.1
|
4
|
+
version: 6.2.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: 2024-
|
11
|
+
date: 2024-10-10 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.
|