pdfcrowd 6.0.1 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pdfcrowd.rb +33 -11
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd5433b839fb55dd482f13ea76bf6e74d203c071f748fd5d6ee8e09150a25f59
4
- data.tar.gz: d55b65b1bdcd54cc604eb2176e950dad8d8ce1b876414f37da5f2819724d892b
3
+ metadata.gz: cdfb803513e340c4d125a04c7af3c2bb2aa9d7ada652a9636c965eacf964d4cc
4
+ data.tar.gz: 3f66c527fc9db82d72e2576a240b1a435ee7a72edb60d31f4fc4c012d2457617
5
5
  SHA512:
6
- metadata.gz: 042b5798eb2361402cae04bfc61b465657e608c7d5b09a576123442a77e8da70af92cd4c4c39cf1d0ab33684093f8ac5bc5a4353944e7fe1452a78be6801ae46
7
- data.tar.gz: d27d21a7ff8446ee0d3388e21feb37eaf73c647460ecb567e22c3843c41c684b90ede884a8440034c7804d11f205caf5c1745b42e9305f21261480ea7a90bc38
6
+ metadata.gz: 9fa86e54a212cfb73b338ec55b30411c054cf58827fa619dab8b7aca68e3e7e1fb6e8bb0d451919c8d6f3020223d7d2333fdba8d7442de16fd040ee3227bae25
7
+ data.tar.gz: a96652ca6a25ce06aba4fad0f9643a5ce12b5825aa7af87618d5d9e0b9436436a3d7ce012d4516671164bc4bf12dd7cebf60e28c4b33cad16a4a2ca4215872e5
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.0.1'
533
+ CLIENT_VERSION = '6.1.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.0.1 (https://pdfcrowd.com)')
544
+ setUserAgent('pdfcrowd_ruby_client/6.1.0 (https://pdfcrowd.com)')
545
545
 
546
546
  @retry_count = 1
547
547
  @converter_version = '24.04'
@@ -1096,15 +1096,6 @@ module Pdfcrowd
1096
1096
  self
1097
1097
  end
1098
1098
 
1099
- # Set an offset between physical and logical page numbers.
1100
- #
1101
- # * +offset+ - Integer specifying page offset.
1102
- # * *Returns* - The converter object.
1103
- def setPageNumberingOffset(offset)
1104
- @fields['page_numbering_offset'] = offset
1105
- self
1106
- end
1107
-
1108
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.
1109
1100
  #
1110
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.
@@ -1301,6 +1292,15 @@ module Pdfcrowd
1301
1292
  self
1302
1293
  end
1303
1294
 
1295
+ # Set an offset between physical and logical page numbers.
1296
+ #
1297
+ # * +offset+ - Integer specifying page offset.
1298
+ # * *Returns* - The converter object.
1299
+ def setPageNumberingOffset(offset)
1300
+ @fields['page_numbering_offset'] = offset
1301
+ self
1302
+ end
1303
+
1304
1304
  # Apply a watermark to each page of the output PDF file. A watermark can be either a PDF or an image. If a multi-page file (PDF or TIFF) is used, the first page is used as the watermark.
1305
1305
  #
1306
1306
  # * +watermark+ - The file path to a local file. The file must exist and not be empty.
@@ -2426,6 +2426,28 @@ 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, 4, 6: pages 2, 4, and 6 2-5: pages 2 through 5 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
+ #
2431
+ # * +json_string+ - The JSON string.
2432
+ # * *Returns* - The converter object.
2433
+ def setConversionConfig(json_string)
2434
+ @fields['conversion_config'] = json_string
2435
+ self
2436
+ end
2437
+
2438
+ # Allows to configure the conversion process via JSON file. See details of the JSON string.
2439
+ #
2440
+ # * +filepath+ - The file path to a local file. The file must exist and not be empty.
2441
+ # * *Returns* - The converter object.
2442
+ def setConversionConfigFile(filepath)
2443
+ if (!(File.file?(filepath) && !File.zero?(filepath)))
2444
+ raise Error.new(Pdfcrowd.create_invalid_value_message(filepath, "setConversionConfigFile", "html-to-pdf", "The file must exist and not be empty.", "set_conversion_config_file"), 470);
2445
+ end
2446
+
2447
+ @files['conversion_config_file'] = filepath
2448
+ self
2449
+ end
2450
+
2429
2451
  # Set the converter version. Different versions may produce different output. Choose which one provides the best output for your case.
2430
2452
  #
2431
2453
  # * +version+ - The version identifier. Allowed values are 24.04, 20.10, 18.10, latest.
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.0.1
4
+ version: 6.1.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-07-09 00:00:00.000000000 Z
11
+ date: 2024-09-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.