pdfcrowd 5.7.0 → 5.9.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.
- checksums.yaml +4 -4
- data/lib/pdfcrowd.rb +47 -35
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a5acbb283c6b75918ea9f34e667cbf48c1a6fb04527ddfb7635094306c40645
|
4
|
+
data.tar.gz: f4932f2c8cbe494a14c42dee45212d0eae455f1aadd560765e0aca046f8dfe8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bc88c22538231821ac6ad2e99b8acdb3df27f5c0da3ff7339aa6e8bdde66cb970bbb4c4884b2abf90ba655a97dc1b656e502fad4637278a432cec390f96a252
|
7
|
+
data.tar.gz: 81937c8b7d2d32683b2f807d0da6f1b592d96607587fcbfd0c64f79a649fda1436462d2c7a2c58d2539a3fc2125a248908842ab853e4bdfd8503ff3dd0ee76ad
|
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 = '5.
|
533
|
+
CLIENT_VERSION = '5.9.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.
|
544
|
+
setUserAgent('pdfcrowd_ruby_client/5.9.0 (https://pdfcrowd.com)')
|
545
545
|
|
546
546
|
@retry_count = 1
|
547
547
|
@converter_version = '20.10'
|
@@ -597,6 +597,10 @@ module Pdfcrowd
|
|
597
597
|
@page_count
|
598
598
|
end
|
599
599
|
|
600
|
+
def getTotalPageCount()
|
601
|
+
@total_page_count
|
602
|
+
end
|
603
|
+
|
600
604
|
def getOutputSize()
|
601
605
|
@output_size
|
602
606
|
end
|
@@ -613,6 +617,7 @@ module Pdfcrowd
|
|
613
617
|
@consumed_credits = 0
|
614
618
|
@job_id = ''
|
615
619
|
@page_count = 0
|
620
|
+
@total_page_count = 0
|
616
621
|
@output_size = 0
|
617
622
|
@retry = 0
|
618
623
|
end
|
@@ -699,6 +704,7 @@ module Pdfcrowd
|
|
699
704
|
@consumed_credits = (response["X-Pdfcrowd-Consumed-Credits"] || 0).to_i
|
700
705
|
@job_id = response["X-Pdfcrowd-Job-Id"] || ''
|
701
706
|
@page_count = (response["X-Pdfcrowd-Pages"] || 0).to_i
|
707
|
+
@total_page_count = (response["X-Pdfcrowd-Total-Pages"] || 0).to_i
|
702
708
|
@output_size = (response["X-Pdfcrowd-Output-Size"] || 0).to_i
|
703
709
|
|
704
710
|
raise Error.new('test 502', '502') \
|
@@ -1327,9 +1333,9 @@ module Pdfcrowd
|
|
1327
1333
|
self
|
1328
1334
|
end
|
1329
1335
|
|
1330
|
-
# Apply
|
1336
|
+
# 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.
|
1331
1337
|
#
|
1332
|
-
# * +watermark+ - The file path to a local
|
1338
|
+
# * +watermark+ - The file path to a local file. The file must exist and not be empty.
|
1333
1339
|
# * *Returns* - The converter object.
|
1334
1340
|
def setPageWatermark(watermark)
|
1335
1341
|
if (!(File.file?(watermark) && !File.zero?(watermark)))
|
@@ -1340,7 +1346,7 @@ module Pdfcrowd
|
|
1340
1346
|
self
|
1341
1347
|
end
|
1342
1348
|
|
1343
|
-
# Load a
|
1349
|
+
# Load a file from the specified URL and apply the file as a watermark to each page of the output PDF. 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.
|
1344
1350
|
#
|
1345
1351
|
# * +url+ - The supported protocols are http:// and https://.
|
1346
1352
|
# * *Returns* - The converter object.
|
@@ -1353,9 +1359,9 @@ module Pdfcrowd
|
|
1353
1359
|
self
|
1354
1360
|
end
|
1355
1361
|
|
1356
|
-
# Apply each page of
|
1362
|
+
# Apply each page of a watermark to the corresponding page of the output PDF. A watermark can be either a PDF or an image.
|
1357
1363
|
#
|
1358
|
-
# * +watermark+ - The file path to a local
|
1364
|
+
# * +watermark+ - The file path to a local file. The file must exist and not be empty.
|
1359
1365
|
# * *Returns* - The converter object.
|
1360
1366
|
def setMultipageWatermark(watermark)
|
1361
1367
|
if (!(File.file?(watermark) && !File.zero?(watermark)))
|
@@ -1366,7 +1372,7 @@ module Pdfcrowd
|
|
1366
1372
|
self
|
1367
1373
|
end
|
1368
1374
|
|
1369
|
-
# Load a
|
1375
|
+
# Load a file from the specified URL and apply each page of the file as a watermark to the corresponding page of the output PDF. A watermark can be either a PDF or an image.
|
1370
1376
|
#
|
1371
1377
|
# * +url+ - The supported protocols are http:// and https://.
|
1372
1378
|
# * *Returns* - The converter object.
|
@@ -1379,9 +1385,9 @@ module Pdfcrowd
|
|
1379
1385
|
self
|
1380
1386
|
end
|
1381
1387
|
|
1382
|
-
# Apply
|
1388
|
+
# Apply a background to each page of the output PDF file. A background 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 background.
|
1383
1389
|
#
|
1384
|
-
# * +background+ - The file path to a local
|
1390
|
+
# * +background+ - The file path to a local file. The file must exist and not be empty.
|
1385
1391
|
# * *Returns* - The converter object.
|
1386
1392
|
def setPageBackground(background)
|
1387
1393
|
if (!(File.file?(background) && !File.zero?(background)))
|
@@ -1392,7 +1398,7 @@ module Pdfcrowd
|
|
1392
1398
|
self
|
1393
1399
|
end
|
1394
1400
|
|
1395
|
-
# Load a
|
1401
|
+
# Load a file from the specified URL and apply the file as a background to each page of the output PDF. A background 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 background.
|
1396
1402
|
#
|
1397
1403
|
# * +url+ - The supported protocols are http:// and https://.
|
1398
1404
|
# * *Returns* - The converter object.
|
@@ -1405,9 +1411,9 @@ module Pdfcrowd
|
|
1405
1411
|
self
|
1406
1412
|
end
|
1407
1413
|
|
1408
|
-
# Apply each page of
|
1414
|
+
# Apply each page of a background to the corresponding page of the output PDF. A background can be either a PDF or an image.
|
1409
1415
|
#
|
1410
|
-
# * +background+ - The file path to a local
|
1416
|
+
# * +background+ - The file path to a local file. The file must exist and not be empty.
|
1411
1417
|
# * *Returns* - The converter object.
|
1412
1418
|
def setMultipageBackground(background)
|
1413
1419
|
if (!(File.file?(background) && !File.zero?(background)))
|
@@ -1418,7 +1424,7 @@ module Pdfcrowd
|
|
1418
1424
|
self
|
1419
1425
|
end
|
1420
1426
|
|
1421
|
-
# Load a
|
1427
|
+
# Load a file from the specified URL and apply each page of the file as a background to the corresponding page of the output PDF. A background can be either a PDF or an image.
|
1422
1428
|
#
|
1423
1429
|
# * +url+ - The supported protocols are http:// and https://.
|
1424
1430
|
# * *Returns* - The converter object.
|
@@ -1714,11 +1720,11 @@ module Pdfcrowd
|
|
1714
1720
|
|
1715
1721
|
# The input HTML is automatically enhanced to improve the readability.
|
1716
1722
|
#
|
1717
|
-
# * +enhancements+ - Allowed values are none, readability-v1, readability-v2, readability-v3.
|
1723
|
+
# * +enhancements+ - Allowed values are none, readability-v1, readability-v2, readability-v3, readability-v4.
|
1718
1724
|
# * *Returns* - The converter object.
|
1719
1725
|
def setReadabilityEnhancements(enhancements)
|
1720
|
-
unless /(?i)^(none|readability-v1|readability-v2|readability-v3)$/.match(enhancements)
|
1721
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(enhancements, "setReadabilityEnhancements", "html-to-pdf", "Allowed values are none, readability-v1, readability-v2, readability-v3.", "set_readability_enhancements"), 470);
|
1726
|
+
unless /(?i)^(none|readability-v1|readability-v2|readability-v3|readability-v4)$/.match(enhancements)
|
1727
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(enhancements, "setReadabilityEnhancements", "html-to-pdf", "Allowed values are none, readability-v1, readability-v2, readability-v3, readability-v4.", "set_readability_enhancements"), 470);
|
1722
1728
|
end
|
1723
1729
|
|
1724
1730
|
@fields['readability_enhancements'] = enhancements
|
@@ -2197,12 +2203,18 @@ module Pdfcrowd
|
|
2197
2203
|
return @helper.getJobId()
|
2198
2204
|
end
|
2199
2205
|
|
2200
|
-
# Get the
|
2206
|
+
# Get the number of pages in the output document.
|
2201
2207
|
# * *Returns* - The page count.
|
2202
2208
|
def getPageCount()
|
2203
2209
|
return @helper.getPageCount()
|
2204
2210
|
end
|
2205
2211
|
|
2212
|
+
# Get the total number of pages in the original output document, including the pages excluded by setPrintPageRange().
|
2213
|
+
# * *Returns* - The total page count.
|
2214
|
+
def getTotalPageCount()
|
2215
|
+
return @helper.getTotalPageCount()
|
2216
|
+
end
|
2217
|
+
|
2206
2218
|
# Get the size of the output in bytes.
|
2207
2219
|
# * *Returns* - The count of bytes.
|
2208
2220
|
def getOutputSize()
|
@@ -2880,11 +2892,11 @@ module Pdfcrowd
|
|
2880
2892
|
|
2881
2893
|
# The input HTML is automatically enhanced to improve the readability.
|
2882
2894
|
#
|
2883
|
-
# * +enhancements+ - Allowed values are none, readability-v1, readability-v2, readability-v3.
|
2895
|
+
# * +enhancements+ - Allowed values are none, readability-v1, readability-v2, readability-v3, readability-v4.
|
2884
2896
|
# * *Returns* - The converter object.
|
2885
2897
|
def setReadabilityEnhancements(enhancements)
|
2886
|
-
unless /(?i)^(none|readability-v1|readability-v2|readability-v3)$/.match(enhancements)
|
2887
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(enhancements, "setReadabilityEnhancements", "html-to-image", "Allowed values are none, readability-v1, readability-v2, readability-v3.", "set_readability_enhancements"), 470);
|
2898
|
+
unless /(?i)^(none|readability-v1|readability-v2|readability-v3|readability-v4)$/.match(enhancements)
|
2899
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(enhancements, "setReadabilityEnhancements", "html-to-image", "Allowed values are none, readability-v1, readability-v2, readability-v3, readability-v4.", "set_readability_enhancements"), 470);
|
2888
2900
|
end
|
2889
2901
|
|
2890
2902
|
@fields['readability_enhancements'] = enhancements
|
@@ -3626,9 +3638,9 @@ module Pdfcrowd
|
|
3626
3638
|
self
|
3627
3639
|
end
|
3628
3640
|
|
3629
|
-
# Apply
|
3641
|
+
# 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.
|
3630
3642
|
#
|
3631
|
-
# * +watermark+ - The file path to a local
|
3643
|
+
# * +watermark+ - The file path to a local file. The file must exist and not be empty.
|
3632
3644
|
# * *Returns* - The converter object.
|
3633
3645
|
def setPageWatermark(watermark)
|
3634
3646
|
if (!(File.file?(watermark) && !File.zero?(watermark)))
|
@@ -3639,7 +3651,7 @@ module Pdfcrowd
|
|
3639
3651
|
self
|
3640
3652
|
end
|
3641
3653
|
|
3642
|
-
# Load a
|
3654
|
+
# Load a file from the specified URL and apply the file as a watermark to each page of the output PDF. 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.
|
3643
3655
|
#
|
3644
3656
|
# * +url+ - The supported protocols are http:// and https://.
|
3645
3657
|
# * *Returns* - The converter object.
|
@@ -3652,9 +3664,9 @@ module Pdfcrowd
|
|
3652
3664
|
self
|
3653
3665
|
end
|
3654
3666
|
|
3655
|
-
# Apply each page of
|
3667
|
+
# Apply each page of a watermark to the corresponding page of the output PDF. A watermark can be either a PDF or an image.
|
3656
3668
|
#
|
3657
|
-
# * +watermark+ - The file path to a local
|
3669
|
+
# * +watermark+ - The file path to a local file. The file must exist and not be empty.
|
3658
3670
|
# * *Returns* - The converter object.
|
3659
3671
|
def setMultipageWatermark(watermark)
|
3660
3672
|
if (!(File.file?(watermark) && !File.zero?(watermark)))
|
@@ -3665,7 +3677,7 @@ module Pdfcrowd
|
|
3665
3677
|
self
|
3666
3678
|
end
|
3667
3679
|
|
3668
|
-
# Load a
|
3680
|
+
# Load a file from the specified URL and apply each page of the file as a watermark to the corresponding page of the output PDF. A watermark can be either a PDF or an image.
|
3669
3681
|
#
|
3670
3682
|
# * +url+ - The supported protocols are http:// and https://.
|
3671
3683
|
# * *Returns* - The converter object.
|
@@ -3678,9 +3690,9 @@ module Pdfcrowd
|
|
3678
3690
|
self
|
3679
3691
|
end
|
3680
3692
|
|
3681
|
-
# Apply
|
3693
|
+
# Apply a background to each page of the output PDF file. A background 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 background.
|
3682
3694
|
#
|
3683
|
-
# * +background+ - The file path to a local
|
3695
|
+
# * +background+ - The file path to a local file. The file must exist and not be empty.
|
3684
3696
|
# * *Returns* - The converter object.
|
3685
3697
|
def setPageBackground(background)
|
3686
3698
|
if (!(File.file?(background) && !File.zero?(background)))
|
@@ -3691,7 +3703,7 @@ module Pdfcrowd
|
|
3691
3703
|
self
|
3692
3704
|
end
|
3693
3705
|
|
3694
|
-
# Load a
|
3706
|
+
# Load a file from the specified URL and apply the file as a background to each page of the output PDF. A background 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 background.
|
3695
3707
|
#
|
3696
3708
|
# * +url+ - The supported protocols are http:// and https://.
|
3697
3709
|
# * *Returns* - The converter object.
|
@@ -3704,9 +3716,9 @@ module Pdfcrowd
|
|
3704
3716
|
self
|
3705
3717
|
end
|
3706
3718
|
|
3707
|
-
# Apply each page of
|
3719
|
+
# Apply each page of a background to the corresponding page of the output PDF. A background can be either a PDF or an image.
|
3708
3720
|
#
|
3709
|
-
# * +background+ - The file path to a local
|
3721
|
+
# * +background+ - The file path to a local file. The file must exist and not be empty.
|
3710
3722
|
# * *Returns* - The converter object.
|
3711
3723
|
def setMultipageBackground(background)
|
3712
3724
|
if (!(File.file?(background) && !File.zero?(background)))
|
@@ -3717,7 +3729,7 @@ module Pdfcrowd
|
|
3717
3729
|
self
|
3718
3730
|
end
|
3719
3731
|
|
3720
|
-
# Load a
|
3732
|
+
# Load a file from the specified URL and apply each page of the file as a background to the corresponding page of the output PDF. A background can be either a PDF or an image.
|
3721
3733
|
#
|
3722
3734
|
# * +url+ - The supported protocols are http:// and https://.
|
3723
3735
|
# * *Returns* - The converter object.
|
@@ -4006,7 +4018,7 @@ module Pdfcrowd
|
|
4006
4018
|
return @helper.getJobId()
|
4007
4019
|
end
|
4008
4020
|
|
4009
|
-
# Get the
|
4021
|
+
# Get the number of pages in the output document.
|
4010
4022
|
# * *Returns* - The page count.
|
4011
4023
|
def getPageCount()
|
4012
4024
|
return @helper.getPageCount()
|
@@ -4791,7 +4803,7 @@ module Pdfcrowd
|
|
4791
4803
|
return @helper.getJobId()
|
4792
4804
|
end
|
4793
4805
|
|
4794
|
-
# Get the
|
4806
|
+
# Get the number of pages in the output document.
|
4795
4807
|
# * *Returns* - The page count.
|
4796
4808
|
def getPageCount()
|
4797
4809
|
return @helper.getPageCount()
|
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.
|
4
|
+
version: 5.9.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: 2022-
|
11
|
+
date: 2022-10-03 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.
|