pdfcrowd 5.13.0 → 5.14.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: f960da37e7c3184d59d432b8b3c023c7eb187f658e7f124d20b4b3d92ce6bf17
4
- data.tar.gz: a5b87ba982098b105599746db23251f9050d12f159940233ade39b0447cae929
3
+ metadata.gz: 3d76493fa31359ab0580af96a63f6b642ec81e02b658799439c3f53ca1aa0fdb
4
+ data.tar.gz: 1584157bc827d766cb898dc596ddd6ea1e192709a55bab018fd7f6da88d5b40a
5
5
  SHA512:
6
- metadata.gz: a79f3bfc9990447d45d6e388da9ff072fd30cb6bada3549e61439662d8041dc8fd2e5eb1c5ba496adf7539cfa6d49e17f327d99dd9e099e5779f55f7d1e24042
7
- data.tar.gz: db213d0e3d657ed2e5d66498470c810a3703fd6cb6a8631ce15eec33442d5b398ab655423dfc18d4ee13a012bc7e19c135e5be93ade21a808a9858d58cf8cdc5
6
+ metadata.gz: df9f44f79936df358b4c4ce3a3fa2c2a8d664a0359d04b162cdf92ffcf2ad44aa4aa2c23d49a08c3df6abbfa23a0f751fa79f4f986f01e2a4b18c1bddf21af4f
7
+ data.tar.gz: 3a5a1fad1b7a3b03c503ed6358812d3ae05fac2299b5902953c0e4002c0df10f9a253a5dd1b5d4576c11142846d1e1378534cb0b6c7c92517013d006e4a08efd
data/lib/pdfcrowd.rb CHANGED
@@ -191,12 +191,12 @@ module Pdfcrowd
191
191
  end
192
192
 
193
193
  def setPageLayout(value)
194
- assert { value > 0 and value <= 3 }
194
+ assert_pdfcrowd { value > 0 and value <= 3 }
195
195
  @fields['page_layout'] = value
196
196
  end
197
197
 
198
198
  def setPageMode(value)
199
- assert { value > 0 and value <= 3 }
199
+ assert_pdfcrowd { value > 0 and value <= 3 }
200
200
  @fields['page_mode'] = value
201
201
  end
202
202
 
@@ -242,7 +242,7 @@ module Pdfcrowd
242
242
  end
243
243
 
244
244
  def setInitialPdfZoomType(value)
245
- assert { value>0 and value<=3 }
245
+ assert_pdfcrowd { value>0 and value<=3 }
246
246
  @fields['initial_pdf_zoom_type'] = value
247
247
  end
248
248
 
@@ -400,7 +400,7 @@ end
400
400
  end
401
401
 
402
402
 
403
- def assert
403
+ def assert_pdfcrowd
404
404
  raise "Assertion failed !" unless yield
405
405
  end
406
406
 
@@ -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.13.0'
533
+ CLIENT_VERSION = '5.14.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/5.13.0 (https://pdfcrowd.com)')
544
+ setUserAgent('pdfcrowd_ruby_client/5.14.0 (https://pdfcrowd.com)')
545
545
 
546
546
  @retry_count = 1
547
547
  @converter_version = '20.10'
@@ -1627,6 +1627,19 @@ module Pdfcrowd
1627
1627
  self
1628
1628
  end
1629
1629
 
1630
+ # Apply custom CSS to the input HTML document. It allows you to modify the visual appearance and layout of your HTML content dynamically. Tip: Using !important in custom CSS provides a way to prioritize and override conflicting styles.
1631
+ #
1632
+ # * +css+ - A string containing valid CSS. The string must not be empty.
1633
+ # * *Returns* - The converter object.
1634
+ def setCustomCss(css)
1635
+ if (!(!css.nil? && !css.empty?))
1636
+ raise Error.new(Pdfcrowd.create_invalid_value_message(css, "setCustomCss", "html-to-pdf", "The string must not be empty.", "set_custom_css"), 470);
1637
+ end
1638
+
1639
+ @fields['custom_css'] = css
1640
+ self
1641
+ end
1642
+
1630
1643
  # Run a custom JavaScript after the document is loaded and ready to print. The script is intended for post-load DOM manipulation (add/remove elements, update CSS, ...). In addition to the standard browser APIs, the custom JavaScript code can use helper functions from our JavaScript library.
1631
1644
  #
1632
1645
  # * +javascript+ - A string containing a JavaScript code. The string must not be empty.
@@ -2799,6 +2812,19 @@ module Pdfcrowd
2799
2812
  self
2800
2813
  end
2801
2814
 
2815
+ # Apply custom CSS to the input HTML document. It allows you to modify the visual appearance and layout of your HTML content dynamically. Tip: Using !important in custom CSS provides a way to prioritize and override conflicting styles.
2816
+ #
2817
+ # * +css+ - A string containing valid CSS. The string must not be empty.
2818
+ # * *Returns* - The converter object.
2819
+ def setCustomCss(css)
2820
+ if (!(!css.nil? && !css.empty?))
2821
+ raise Error.new(Pdfcrowd.create_invalid_value_message(css, "setCustomCss", "html-to-image", "The string must not be empty.", "set_custom_css"), 470);
2822
+ end
2823
+
2824
+ @fields['custom_css'] = css
2825
+ self
2826
+ end
2827
+
2802
2828
  # Run a custom JavaScript after the document is loaded and ready to print. The script is intended for post-load DOM manipulation (add/remove elements, update CSS, ...). In addition to the standard browser APIs, the custom JavaScript code can use helper functions from our JavaScript library.
2803
2829
  #
2804
2830
  # * +javascript+ - A string containing a JavaScript code. The string must not be empty.
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.13.0
4
+ version: 5.14.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: 2023-03-30 00:00:00.000000000 Z
11
+ date: 2023-07-21 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.