pdfcrowd 4.4.1 → 4.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pdfcrowd.rb +56 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df0f634e6fd4179d59c27374bca727145e33d834
|
4
|
+
data.tar.gz: 7835a6b9caa209ee4d2c9d29e2ed498dbb592906
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 106fcf8b64482a784f7655ece03bb3f8ffbb2b986e34491620b2ac188b7d8e8a66ebf5dc3e632cbbc623981a809f5d50704a1a009f7b3d581e147651cec60a42
|
7
|
+
data.tar.gz: 5ddf56c46fc7258e5283e9d24444b0b0d723e588b972cb4f0f4a3fbc78710e7f18081161ecb0d63f81a35f21f80b9af78dc4334802498529ca689eb9bf3d7748
|
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 = '4.4.
|
533
|
+
CLIENT_VERSION = '4.4.2'
|
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/4.4.
|
544
|
+
setUserAgent('pdfcrowd_ruby_client/4.4.2 (http://pdfcrowd.com)')
|
545
545
|
|
546
546
|
@retry_count = 1
|
547
547
|
end
|
@@ -1440,11 +1440,11 @@ module Pdfcrowd
|
|
1440
1440
|
|
1441
1441
|
# Set the viewport width in pixels. The viewport is the user's visible area of the page.
|
1442
1442
|
#
|
1443
|
-
# * +viewport_width+ - The value must be in
|
1443
|
+
# * +viewport_width+ - The value must be in the range 96-7680.
|
1444
1444
|
# * *Returns* - The converter object.
|
1445
1445
|
def setViewportWidth(viewport_width)
|
1446
1446
|
if (!(Integer(viewport_width) >= 96 && Integer(viewport_width) <= 7680))
|
1447
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(viewport_width, "viewport_width", "html-to-pdf", "The value must be in
|
1447
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(viewport_width, "viewport_width", "html-to-pdf", "The value must be in the range 96-7680.", "set_viewport_width"), 470);
|
1448
1448
|
end
|
1449
1449
|
|
1450
1450
|
@fields['viewport_width'] = viewport_width
|
@@ -1466,7 +1466,7 @@ module Pdfcrowd
|
|
1466
1466
|
|
1467
1467
|
# Set the viewport size. The viewport is the user's visible area of the page.
|
1468
1468
|
#
|
1469
|
-
# * +width+ - Set the viewport width in pixels. The viewport is the user's visible area of the page. The value must be in
|
1469
|
+
# * +width+ - Set the viewport width in pixels. The viewport is the user's visible area of the page. The value must be in the range 96-7680.
|
1470
1470
|
# * +height+ - Set the viewport height in pixels. The viewport is the user's visible area of the page. Must be a positive integer number.
|
1471
1471
|
# * *Returns* - The converter object.
|
1472
1472
|
def setViewport(width, height)
|
@@ -1475,7 +1475,7 @@ module Pdfcrowd
|
|
1475
1475
|
self
|
1476
1476
|
end
|
1477
1477
|
|
1478
|
-
#
|
1478
|
+
# Set the rendering mode.
|
1479
1479
|
#
|
1480
1480
|
# * +rendering_mode+ - The rendering mode. Allowed values are default, viewport.
|
1481
1481
|
# * *Returns* - The converter object.
|
@@ -1490,11 +1490,11 @@ module Pdfcrowd
|
|
1490
1490
|
|
1491
1491
|
# Set the scaling factor (zoom) for the main page area.
|
1492
1492
|
#
|
1493
|
-
# * +scale_factor+ - The
|
1493
|
+
# * +scale_factor+ - The percentage value. The value must be in the range 10-500.
|
1494
1494
|
# * *Returns* - The converter object.
|
1495
1495
|
def setScaleFactor(scale_factor)
|
1496
1496
|
if (!(Integer(scale_factor) >= 10 && Integer(scale_factor) <= 500))
|
1497
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(scale_factor, "scale_factor", "html-to-pdf", "The value must be in
|
1497
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(scale_factor, "scale_factor", "html-to-pdf", "The value must be in the range 10-500.", "set_scale_factor"), 470);
|
1498
1498
|
end
|
1499
1499
|
|
1500
1500
|
@fields['scale_factor'] = scale_factor
|
@@ -1503,11 +1503,11 @@ module Pdfcrowd
|
|
1503
1503
|
|
1504
1504
|
# Set the scaling factor (zoom) for the header and footer.
|
1505
1505
|
#
|
1506
|
-
# * +header_footer_scale_factor+ - The
|
1506
|
+
# * +header_footer_scale_factor+ - The percentage value. The value must be in the range 10-500.
|
1507
1507
|
# * *Returns* - The converter object.
|
1508
1508
|
def setHeaderFooterScaleFactor(header_footer_scale_factor)
|
1509
1509
|
if (!(Integer(header_footer_scale_factor) >= 10 && Integer(header_footer_scale_factor) <= 500))
|
1510
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(header_footer_scale_factor, "header_footer_scale_factor", "html-to-pdf", "The value must be in
|
1510
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(header_footer_scale_factor, "header_footer_scale_factor", "html-to-pdf", "The value must be in the range 10-500.", "set_header_footer_scale_factor"), 470);
|
1511
1511
|
end
|
1512
1512
|
|
1513
1513
|
@fields['header_footer_scale_factor'] = header_footer_scale_factor
|
@@ -1523,6 +1523,45 @@ module Pdfcrowd
|
|
1523
1523
|
self
|
1524
1524
|
end
|
1525
1525
|
|
1526
|
+
# Set the quality of embedded JPEG images. Lower quality results in smaller PDF file. Lower quality affects printing or zooming in a PDF viewer.
|
1527
|
+
#
|
1528
|
+
# * +jpeg_quality+ - The percentage value. The value must be in the range 1-100.
|
1529
|
+
# * *Returns* - The converter object.
|
1530
|
+
def setJpegQuality(jpeg_quality)
|
1531
|
+
if (!(Integer(jpeg_quality) >= 1 && Integer(jpeg_quality) <= 100))
|
1532
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(jpeg_quality, "jpeg_quality", "html-to-pdf", "The value must be in the range 1-100.", "set_jpeg_quality"), 470);
|
1533
|
+
end
|
1534
|
+
|
1535
|
+
@fields['jpeg_quality'] = jpeg_quality
|
1536
|
+
self
|
1537
|
+
end
|
1538
|
+
|
1539
|
+
# Set image categories to be converted into embedded JPEG images. The conversion into JPEG may result in smaller PDF file.
|
1540
|
+
#
|
1541
|
+
# * +convert_images_to_jpeg+ - The image category. Allowed values are none, opaque, all.
|
1542
|
+
# * *Returns* - The converter object.
|
1543
|
+
def setConvertImagesToJpeg(convert_images_to_jpeg)
|
1544
|
+
unless /(?i)^(none|opaque|all)$/.match(convert_images_to_jpeg)
|
1545
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(convert_images_to_jpeg, "convert_images_to_jpeg", "html-to-pdf", "Allowed values are none, opaque, all.", "set_convert_images_to_jpeg"), 470);
|
1546
|
+
end
|
1547
|
+
|
1548
|
+
@fields['convert_images_to_jpeg'] = convert_images_to_jpeg
|
1549
|
+
self
|
1550
|
+
end
|
1551
|
+
|
1552
|
+
# Set the DPI when embedded image is scaled down. Lower DPI may result in smaller PDF file. Lower DPI affects printing or zooming in a PDF viewer. Use 0 for no scaling down.
|
1553
|
+
#
|
1554
|
+
# * +image_dpi+ - The DPI value. Must be a positive integer number or 0.
|
1555
|
+
# * *Returns* - The converter object.
|
1556
|
+
def setImageDpi(image_dpi)
|
1557
|
+
if (!(Integer(image_dpi) >= 0))
|
1558
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(image_dpi, "image_dpi", "html-to-pdf", "Must be a positive integer number or 0.", "set_image_dpi"), 470);
|
1559
|
+
end
|
1560
|
+
|
1561
|
+
@fields['image_dpi'] = image_dpi
|
1562
|
+
self
|
1563
|
+
end
|
1564
|
+
|
1526
1565
|
# Create linearized PDF. This is also known as Fast Web View.
|
1527
1566
|
#
|
1528
1567
|
# * +linearize+ - Set to true to create linearized PDF.
|
@@ -1766,6 +1805,7 @@ module Pdfcrowd
|
|
1766
1805
|
end
|
1767
1806
|
|
1768
1807
|
# Get the number of conversion credits available in your account.
|
1808
|
+
# The number is available after calling the conversion. So use the method after convertXYZ method.
|
1769
1809
|
# The returned value can differ from the actual count if you run parallel conversions.
|
1770
1810
|
# The special value 999999 is returned if the information is not available.
|
1771
1811
|
# * *Returns* - The number of credits.
|
@@ -2288,11 +2328,11 @@ module Pdfcrowd
|
|
2288
2328
|
|
2289
2329
|
# Set the output image width in pixels.
|
2290
2330
|
#
|
2291
|
-
# * +screenshot_width+ - The value must be in
|
2331
|
+
# * +screenshot_width+ - The value must be in the range 96-7680.
|
2292
2332
|
# * *Returns* - The converter object.
|
2293
2333
|
def setScreenshotWidth(screenshot_width)
|
2294
2334
|
if (!(Integer(screenshot_width) >= 96 && Integer(screenshot_width) <= 7680))
|
2295
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(screenshot_width, "screenshot_width", "html-to-image", "The value must be in
|
2335
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(screenshot_width, "screenshot_width", "html-to-image", "The value must be in the range 96-7680.", "set_screenshot_width"), 470);
|
2296
2336
|
end
|
2297
2337
|
|
2298
2338
|
@fields['screenshot_width'] = screenshot_width
|
@@ -2328,6 +2368,7 @@ module Pdfcrowd
|
|
2328
2368
|
end
|
2329
2369
|
|
2330
2370
|
# Get the number of conversion credits available in your account.
|
2371
|
+
# The number is available after calling the conversion. So use the method after convertXYZ method.
|
2331
2372
|
# The returned value can differ from the actual count if you run parallel conversions.
|
2332
2373
|
# The special value 999999 is returned if the information is not available.
|
2333
2374
|
# * *Returns* - The number of credits.
|
@@ -2645,6 +2686,7 @@ module Pdfcrowd
|
|
2645
2686
|
end
|
2646
2687
|
|
2647
2688
|
# Get the number of conversion credits available in your account.
|
2689
|
+
# The number is available after calling the conversion. So use the method after convertXYZ method.
|
2648
2690
|
# The returned value can differ from the actual count if you run parallel conversions.
|
2649
2691
|
# The special value 999999 is returned if the information is not available.
|
2650
2692
|
# * *Returns* - The number of credits.
|
@@ -2846,6 +2888,7 @@ module Pdfcrowd
|
|
2846
2888
|
end
|
2847
2889
|
|
2848
2890
|
# Get the number of conversion credits available in your account.
|
2891
|
+
# The number is available after calling the conversion. So use the method after convertXYZ method.
|
2849
2892
|
# The returned value can differ from the actual count if you run parallel conversions.
|
2850
2893
|
# The special value 999999 is returned if the information is not available.
|
2851
2894
|
# * *Returns* - The number of credits.
|
@@ -3108,6 +3151,7 @@ module Pdfcrowd
|
|
3108
3151
|
end
|
3109
3152
|
|
3110
3153
|
# Get the number of conversion credits available in your account.
|
3154
|
+
# The number is available after calling the conversion. So use the method after convertXYZ method.
|
3111
3155
|
# The returned value can differ from the actual count if you run parallel conversions.
|
3112
3156
|
# The special value 999999 is returned if the information is not available.
|
3113
3157
|
# * *Returns* - The number of credits.
|
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.4.
|
4
|
+
version: 4.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:
|
11
|
+
date: 2019-01-30 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.
|