pdfcrowd 6.2.0 → 6.3.0

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 +32 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ced48bdced7379753e37229aab427f954e8f072a8cbc1d7f9dd5fcec926db33
4
- data.tar.gz: a00e3aec16dd5fcdc70534b28955ca2240095090c0b34235c90afdc75583082b
3
+ metadata.gz: cb78c2198c168547bbcf1e7cdecbca1083555ba1212ff0f82eeb6a28b37654b0
4
+ data.tar.gz: a1581f3fed1e17910a184815fb614c0280a77ba4ecaca0b3d8370a3104675ecf
5
5
  SHA512:
6
- metadata.gz: 6f256d7dd7f6ca51472abe629e158238eaad99e2033f9ea8b05c21f9ab547de857f8d2463b573edaa071ed9bf47296f9afb6192452b78eec0b69b1020b8053ba
7
- data.tar.gz: 7c31d569baf3b0a1dc81eb9966d10d517befdee64ed75021202e999a2155d60d57c7e6504178b508ec0eaf954cce9d44d6bef57bcf4075c296cd17a30d842f03
6
+ metadata.gz: 9741cb9286efa9fadec0134f16b4bae4107e783772c54dd8641c0a56964fb744ae8bb243b75eaaace888e3abe4bc2de21203db6cf867458b61147517b9f1b730
7
+ data.tar.gz: 699a3cc4694d244c1b9f1ebc949a9047eef7e7c1fac6a7e797eb489951f0c98c672c7a3a0adf5e5b01916075b17753a430d95eeefd72c41189ec38d24b6e06e3
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.2.0'
533
+ CLIENT_VERSION = '6.3.0'
534
534
 
535
535
  class ConnectionHelper
536
536
  def initialize(user_name, api_key)
@@ -541,7 +541,7 @@ module Pdfcrowd
541
541
 
542
542
  setProxy(nil, nil, nil, nil)
543
543
  setUseHttp(false)
544
- setUserAgent('pdfcrowd_ruby_client/6.2.0 (https://pdfcrowd.com)')
544
+ setUserAgent('pdfcrowd_ruby_client/6.3.0 (https://pdfcrowd.com)')
545
545
 
546
546
  @retry_count = 1
547
547
  @converter_version = '24.04'
@@ -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-65000.
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-65000.", "set_content_viewport_width"), 470);
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
 
@@ -5738,6 +5738,19 @@ module Pdfcrowd
5738
5738
  self
5739
5739
  end
5740
5740
 
5741
+ # Add a specified prefix to all id and class attributes in the HTML content, creating a namespace for safe integration into another HTML document. This process ensures unique identifiers, preventing conflicts when merging with other HTML.
5742
+ #
5743
+ # * +prefix+ - The prefix to add before each id and class attribute name. Start with a letter or underscore, and use only letters, numbers, hyphens, underscores, or colons.
5744
+ # * *Returns* - The converter object.
5745
+ def setHtmlNamespace(prefix)
5746
+ unless /(?i)^[a-z_][a-z0-9_:-]*$/.match(prefix)
5747
+ raise Error.new(Pdfcrowd.create_invalid_value_message(prefix, "setHtmlNamespace", "pdf-to-html", "Start with a letter or underscore, and use only letters, numbers, hyphens, underscores, or colons.", "set_html_namespace"), 470);
5748
+ end
5749
+
5750
+ @fields['html_namespace'] = prefix
5751
+ self
5752
+ end
5753
+
5741
5754
  # 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.
5742
5755
  # * *Returns* - True if the conversion output is a zip file, otherwise False.
5743
5756
  def isZippedOutput()
@@ -5878,6 +5891,19 @@ module Pdfcrowd
5878
5891
  self
5879
5892
  end
5880
5893
 
5894
+ # Set the converter version. Different versions may produce different output. Choose which one provides the best output for your case.
5895
+ #
5896
+ # * +version+ - The version identifier. Allowed values are 24.04, 20.10, 18.10, latest.
5897
+ # * *Returns* - The converter object.
5898
+ def setConverterVersion(version)
5899
+ unless /(?i)^(24.04|20.10|18.10|latest)$/.match(version)
5900
+ raise Error.new(Pdfcrowd.create_invalid_value_message(version, "setConverterVersion", "pdf-to-html", "Allowed values are 24.04, 20.10, 18.10, latest.", "set_converter_version"), 470);
5901
+ end
5902
+
5903
+ @helper.setConverterVersion(version)
5904
+ self
5905
+ end
5906
+
5881
5907
  # Specifies if the client communicates over HTTP or HTTPS with Pdfcrowd API.
5882
5908
  # Warning: Using HTTP is insecure as data sent over HTTP is not encrypted. Enable this option only if you know what you are doing.
5883
5909
  #
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.2.0
4
+ version: 6.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pdfcrowd Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-01 00:00:00.000000000 Z
11
+ date: 2024-11-06 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.