pdfcrowd 4.1 → 4.2

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 +19 -19
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b63aefeb456c70b1fa6af7a8677bd1a6fcda18b8
4
- data.tar.gz: df49260b940ac7d7783a07cffa279d5c5fa01edc
3
+ metadata.gz: 42b14b50a94ab797b1bb2b9af2bbdb99cfb8ce23
4
+ data.tar.gz: 2adfda4bf7c64fd699288bd6b368d2c6c945928b
5
5
  SHA512:
6
- metadata.gz: 476693c1c3ebe0dbd666868fe6afde5b8618066d9f7a2a9bfc1432a9030e6ecc58e4864636e2808386ce2c4e34264c231e516f84ce01e15d9957d46439e56184
7
- data.tar.gz: 15b43c707e9739d74ef94c85710c26ed68e16f5796598107ad0dc702759809ef2051ad068d74214700047f83f362afd66d928f50d503ac14c8faae1175acd8a3
6
+ metadata.gz: b01a6c9fde5792d101adbf607860600a3d16f352236ae8fd0a9e24b2f62bc46499fb795cb6aa2899ddce025304836b2650823574bf378a0b74e9b33c0fce7134
7
+ data.tar.gz: f9464ce75e1135fa08ff9608377730540eee23e7f753a1aa48591d2a0ebe5cd0e3a70eac4e31854b79795092e80241df012009f30057f884f1e6532ef84c3885
data/lib/pdfcrowd.rb CHANGED
@@ -295,7 +295,7 @@ module Pdfcrowd
295
295
  end
296
296
 
297
297
  def setWatermark(url, offset_x=0, offset_y=0)
298
- @fields["watermark_url"] = value
298
+ @fields["watermark_url"] = url
299
299
  @fields["watermark_offset_x"] = offset_x
300
300
  @fields["watermark_offset_y"] = offset_y
301
301
  end
@@ -529,7 +529,7 @@ end
529
529
  module Pdfcrowd
530
530
  HOST = ENV["PDFCROWD_HOST"] || 'api.pdfcrowd.com'
531
531
  MULTIPART_BOUNDARY = '----------ThIs_Is_tHe_bOUnDary_$'
532
- CLIENT_VERSION = '4.1'
532
+ CLIENT_VERSION = '4.2'
533
533
 
534
534
  def self.float_to_string(value)
535
535
  value.to_s.sub(',', '.')
@@ -544,7 +544,7 @@ module Pdfcrowd
544
544
 
545
545
  setProxy(nil, nil, nil, nil)
546
546
  setUseHttp(false)
547
- setUserAgent('pdfcrowd_ruby_client/4.1 (http://pdfcrowd.com)')
547
+ setUserAgent('pdfcrowd_ruby_client/4.2 (http://pdfcrowd.com)')
548
548
 
549
549
  @retry_count = 1
550
550
  end
@@ -912,13 +912,13 @@ module Pdfcrowd
912
912
  self
913
913
  end
914
914
 
915
- # Set the output page height.
915
+ # Set the output page height. Use -1 for a single page PDF.
916
916
  #
917
- # * +page_height+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
917
+ # * +page_height+ - Can be -1 or specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
918
918
  # * *Returns* - The converter object.
919
919
  def setPageHeight(page_height)
920
- unless /(?i)^[0-9]*(\.[0-9]+)?(pt|px|mm|cm|in)$/.match(page_height)
921
- raise Error.new(Pdfcrowd.create_invalid_value_message(page_height, "page_height", "html-to-pdf", "Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_page_height"), 470);
920
+ unless /(?i)^\-1$|^[0-9]*(\.[0-9]+)?(pt|px|mm|cm|in)$/.match(page_height)
921
+ raise Error.new(Pdfcrowd.create_invalid_value_message(page_height, "page_height", "html-to-pdf", "Can be -1 or specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).", "set_page_height"), 470);
922
922
  end
923
923
 
924
924
  @fields['page_height'] = page_height
@@ -928,7 +928,7 @@ module Pdfcrowd
928
928
  # Set the output page dimensions.
929
929
  #
930
930
  # * +width+ - Set the output page width. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
931
- # * +height+ - Set the output page height. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
931
+ # * +height+ - Set the output page height. Use -1 for a single page PDF. Can be -1 or specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
932
932
  # * *Returns* - The converter object.
933
933
  def setPageDimensions(width, height)
934
934
  setPageWidth(width)
@@ -1634,7 +1634,7 @@ module Pdfcrowd
1634
1634
  self
1635
1635
  end
1636
1636
 
1637
- # Specifies number of retries after HTTP status code 502 was received. The status 502 occurs seldom due to network problems. This feature can be disabled by setting to 0.
1637
+ # Specifies the number of retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
1638
1638
  #
1639
1639
  # * +retry_count+ - Number of retries wanted.
1640
1640
  # * *Returns* - The converter object.
@@ -2115,7 +2115,7 @@ module Pdfcrowd
2115
2115
  self
2116
2116
  end
2117
2117
 
2118
- # Specifies number of retries after HTTP status code 502 was received. The status 502 occurs seldom due to network problems. This feature can be disabled by setting to 0.
2118
+ # Specifies the number of retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
2119
2119
  #
2120
2120
  # * +retry_count+ - Number of retries wanted.
2121
2121
  # * *Returns* - The converter object.
@@ -2357,7 +2357,7 @@ module Pdfcrowd
2357
2357
  self
2358
2358
  end
2359
2359
 
2360
- # Specifies number of retries after HTTP status code 502 was received. The status 502 occurs seldom due to network problems. This feature can be disabled by setting to 0.
2360
+ # Specifies the number of retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
2361
2361
  #
2362
2362
  # * +retry_count+ - Number of retries wanted.
2363
2363
  # * *Returns* - The converter object.
@@ -2400,27 +2400,27 @@ module Pdfcrowd
2400
2400
 
2401
2401
  # Perform an action on the input files.
2402
2402
  # * *Returns* - Byte array containing the output PDF.
2403
- def convertFiles()
2403
+ def convert()
2404
2404
  @helper.post(@fields, @files, @raw_data)
2405
2405
  end
2406
2406
 
2407
2407
  # Perform an action on the input files and write the output PDF to an output stream.
2408
2408
  #
2409
2409
  # * +out_stream+ - The output stream that will contain the output PDF.
2410
- def convertFilesToStream(out_stream)
2410
+ def convertToStream(out_stream)
2411
2411
  @helper.post(@fields, @files, @raw_data, out_stream)
2412
2412
  end
2413
2413
 
2414
2414
  # Perform an action on the input files and write the output PDF to a file.
2415
2415
  #
2416
2416
  # * +file_path+ - The output file path. The string must not be empty.
2417
- def convertFilesToFile(file_path)
2417
+ def convertToFile(file_path)
2418
2418
  if (!(!file_path.nil? && !file_path.empty?))
2419
- raise Error.new(Pdfcrowd.create_invalid_value_message(file_path, "file_path", "pdf-to-pdf", "The string must not be empty.", "convert_files_to_file"), 470);
2419
+ raise Error.new(Pdfcrowd.create_invalid_value_message(file_path, "file_path", "pdf-to-pdf", "The string must not be empty.", "convert_to_file"), 470);
2420
2420
  end
2421
2421
 
2422
2422
  output_file = open(file_path, "wb")
2423
- convertFilesToStream(output_file)
2423
+ convertToStream(output_file)
2424
2424
  output_file.close()
2425
2425
  end
2426
2426
 
@@ -2438,7 +2438,7 @@ module Pdfcrowd
2438
2438
  self
2439
2439
  end
2440
2440
 
2441
- # Add in-memory raw PDF data to the list of the input PDFs.
2441
+ # Add in-memory raw PDF data to the list of the input PDFs.Typical usage is for adding PDF created by another Pdfcrowd converter. Example in PHP: $clientPdf2Pdf->addPdfRawData($clientHtml2Pdf->convertUrl('http://www.example.com'));
2442
2442
  #
2443
2443
  # * +pdf_raw_data+ - The raw PDF data. The input data must be PDF content.
2444
2444
  # * *Returns* - The converter object.
@@ -2529,7 +2529,7 @@ module Pdfcrowd
2529
2529
  self
2530
2530
  end
2531
2531
 
2532
- # Specifies number of retries after HTTP status code 502 was received. The status 502 occurs seldom due to network problems. This feature can be disabled by setting to 0.
2532
+ # Specifies the number of retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
2533
2533
  #
2534
2534
  # * +retry_count+ - Number of retries wanted.
2535
2535
  # * *Returns* - The converter object.
@@ -2758,7 +2758,7 @@ module Pdfcrowd
2758
2758
  self
2759
2759
  end
2760
2760
 
2761
- # Specifies number of retries after HTTP status code 502 was received. The status 502 occurs seldom due to network problems. This feature can be disabled by setting to 0.
2761
+ # Specifies the number of retries when the 502 HTTP status code is received. The 502 status code indicates a temporary network issue. This feature can be disabled by setting to 0.
2762
2762
  #
2763
2763
  # * +retry_count+ - Number of retries wanted.
2764
2764
  # * *Returns* - The converter object.
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: '4.1'
4
+ version: '4.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pdfcrowd Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-22 00:00:00.000000000 Z
11
+ date: 2017-12-18 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.