pdfcrowd 5.10.0 → 5.11.0
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 +374 -5
- 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: 47cc638ecfdc79b979a59ff392d8a0d26e3c24d46aa83c06068a774628a94a60
|
4
|
+
data.tar.gz: 4a6c2c0fbf53647504afe8cda893dd117366ddcc68a15357052c33b46b11369b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1cfa2137a0777c82f2d8cae3c7a39ec4683f9ebb83c3f1fe6f3f0b051dc3b96f061ed41a78d753c71b6e3b471fd27c8a85e3e2b3827421d237bfb7a24c5dddd
|
7
|
+
data.tar.gz: 3d71f0f4d050a4c19cfd5a69ca85524ca95db37e2852893684c3b72bc5a42ecb8126e4c40b615a8166b30b0a728e0c7e1624f11270b4d6e4c64fd5eea79b29a2
|
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.11.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.11.0 (https://pdfcrowd.com)')
|
545
545
|
|
546
546
|
@retry_count = 1
|
547
547
|
@converter_version = '20.10'
|
@@ -3407,6 +3407,184 @@ module Pdfcrowd
|
|
3407
3407
|
self
|
3408
3408
|
end
|
3409
3409
|
|
3410
|
+
# Set the output canvas size.
|
3411
|
+
#
|
3412
|
+
# * +size+ - Allowed values are A0, A1, A2, A3, A4, A5, A6, Letter.
|
3413
|
+
# * *Returns* - The converter object.
|
3414
|
+
def setCanvasSize(size)
|
3415
|
+
unless /(?i)^(A0|A1|A2|A3|A4|A5|A6|Letter)$/.match(size)
|
3416
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(size, "setCanvasSize", "image-to-image", "Allowed values are A0, A1, A2, A3, A4, A5, A6, Letter.", "set_canvas_size"), 470);
|
3417
|
+
end
|
3418
|
+
|
3419
|
+
@fields['canvas_size'] = size
|
3420
|
+
self
|
3421
|
+
end
|
3422
|
+
|
3423
|
+
# Set the output canvas width.
|
3424
|
+
#
|
3425
|
+
# * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3426
|
+
# * *Returns* - The converter object.
|
3427
|
+
def setCanvasWidth(width)
|
3428
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(width)
|
3429
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setCanvasWidth", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_canvas_width"), 470);
|
3430
|
+
end
|
3431
|
+
|
3432
|
+
@fields['canvas_width'] = width
|
3433
|
+
self
|
3434
|
+
end
|
3435
|
+
|
3436
|
+
# Set the output canvas height.
|
3437
|
+
#
|
3438
|
+
# * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3439
|
+
# * *Returns* - The converter object.
|
3440
|
+
def setCanvasHeight(height)
|
3441
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
|
3442
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setCanvasHeight", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_canvas_height"), 470);
|
3443
|
+
end
|
3444
|
+
|
3445
|
+
@fields['canvas_height'] = height
|
3446
|
+
self
|
3447
|
+
end
|
3448
|
+
|
3449
|
+
# Set the output canvas dimensions. If no canvas size is specified, margins are applied as a border around the image.
|
3450
|
+
#
|
3451
|
+
# * +width+ - Set the output canvas width. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3452
|
+
# * +height+ - Set the output canvas height. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3453
|
+
# * *Returns* - The converter object.
|
3454
|
+
def setCanvasDimensions(width, height)
|
3455
|
+
setCanvasWidth(width)
|
3456
|
+
setCanvasHeight(height)
|
3457
|
+
self
|
3458
|
+
end
|
3459
|
+
|
3460
|
+
# Set the output canvas orientation.
|
3461
|
+
#
|
3462
|
+
# * +orientation+ - Allowed values are landscape, portrait.
|
3463
|
+
# * *Returns* - The converter object.
|
3464
|
+
def setOrientation(orientation)
|
3465
|
+
unless /(?i)^(landscape|portrait)$/.match(orientation)
|
3466
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(orientation, "setOrientation", "image-to-image", "Allowed values are landscape, portrait.", "set_orientation"), 470);
|
3467
|
+
end
|
3468
|
+
|
3469
|
+
@fields['orientation'] = orientation
|
3470
|
+
self
|
3471
|
+
end
|
3472
|
+
|
3473
|
+
# Set the image position on the page.
|
3474
|
+
#
|
3475
|
+
# * +position+ - Allowed values are center, top, bottom, left, right, top-left, top-right, bottom-left, bottom-right.
|
3476
|
+
# * *Returns* - The converter object.
|
3477
|
+
def setPosition(position)
|
3478
|
+
unless /(?i)^(center|top|bottom|left|right|top-left|top-right|bottom-left|bottom-right)$/.match(position)
|
3479
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(position, "setPosition", "image-to-image", "Allowed values are center, top, bottom, left, right, top-left, top-right, bottom-left, bottom-right.", "set_position"), 470);
|
3480
|
+
end
|
3481
|
+
|
3482
|
+
@fields['position'] = position
|
3483
|
+
self
|
3484
|
+
end
|
3485
|
+
|
3486
|
+
# Set the mode to print the image on the content area of the page.
|
3487
|
+
#
|
3488
|
+
# * +mode+ - Allowed values are default, fit, stretch.
|
3489
|
+
# * *Returns* - The converter object.
|
3490
|
+
def setPrintCanvasMode(mode)
|
3491
|
+
unless /(?i)^(default|fit|stretch)$/.match(mode)
|
3492
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(mode, "setPrintCanvasMode", "image-to-image", "Allowed values are default, fit, stretch.", "set_print_canvas_mode"), 470);
|
3493
|
+
end
|
3494
|
+
|
3495
|
+
@fields['print_canvas_mode'] = mode
|
3496
|
+
self
|
3497
|
+
end
|
3498
|
+
|
3499
|
+
# Set the output canvas top margin.
|
3500
|
+
#
|
3501
|
+
# * +top+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3502
|
+
# * *Returns* - The converter object.
|
3503
|
+
def setMarginTop(top)
|
3504
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(top)
|
3505
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(top, "setMarginTop", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_top"), 470);
|
3506
|
+
end
|
3507
|
+
|
3508
|
+
@fields['margin_top'] = top
|
3509
|
+
self
|
3510
|
+
end
|
3511
|
+
|
3512
|
+
# Set the output canvas right margin.
|
3513
|
+
#
|
3514
|
+
# * +right+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3515
|
+
# * *Returns* - The converter object.
|
3516
|
+
def setMarginRight(right)
|
3517
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(right)
|
3518
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(right, "setMarginRight", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_right"), 470);
|
3519
|
+
end
|
3520
|
+
|
3521
|
+
@fields['margin_right'] = right
|
3522
|
+
self
|
3523
|
+
end
|
3524
|
+
|
3525
|
+
# Set the output canvas bottom margin.
|
3526
|
+
#
|
3527
|
+
# * +bottom+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3528
|
+
# * *Returns* - The converter object.
|
3529
|
+
def setMarginBottom(bottom)
|
3530
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(bottom)
|
3531
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(bottom, "setMarginBottom", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_bottom"), 470);
|
3532
|
+
end
|
3533
|
+
|
3534
|
+
@fields['margin_bottom'] = bottom
|
3535
|
+
self
|
3536
|
+
end
|
3537
|
+
|
3538
|
+
# Set the output canvas left margin.
|
3539
|
+
#
|
3540
|
+
# * +left+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3541
|
+
# * *Returns* - The converter object.
|
3542
|
+
def setMarginLeft(left)
|
3543
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(left)
|
3544
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(left, "setMarginLeft", "image-to-image", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_left"), 470);
|
3545
|
+
end
|
3546
|
+
|
3547
|
+
@fields['margin_left'] = left
|
3548
|
+
self
|
3549
|
+
end
|
3550
|
+
|
3551
|
+
# Set the output canvas margins.
|
3552
|
+
#
|
3553
|
+
# * +top+ - Set the output canvas top margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3554
|
+
# * +right+ - Set the output canvas right margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3555
|
+
# * +bottom+ - Set the output canvas bottom margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3556
|
+
# * +left+ - Set the output canvas left margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
3557
|
+
# * *Returns* - The converter object.
|
3558
|
+
def setMargins(top, right, bottom, left)
|
3559
|
+
setMarginTop(top)
|
3560
|
+
setMarginRight(right)
|
3561
|
+
setMarginBottom(bottom)
|
3562
|
+
setMarginLeft(left)
|
3563
|
+
self
|
3564
|
+
end
|
3565
|
+
|
3566
|
+
# The canvas background color in RGB or RGBA hexadecimal format. The color fills the entire canvas regardless of margins. If no canvas size is specified and the image format supports background (e.g. PDF, PNG), the background color is applied too.
|
3567
|
+
#
|
3568
|
+
# * +color+ - The value must be in RRGGBB or RRGGBBAA hexadecimal format.
|
3569
|
+
# * *Returns* - The converter object.
|
3570
|
+
def setCanvasBackgroundColor(color)
|
3571
|
+
unless /^[0-9a-fA-F]{6,8}$/.match(color)
|
3572
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(color, "setCanvasBackgroundColor", "image-to-image", "The value must be in RRGGBB or RRGGBBAA hexadecimal format.", "set_canvas_background_color"), 470);
|
3573
|
+
end
|
3574
|
+
|
3575
|
+
@fields['canvas_background_color'] = color
|
3576
|
+
self
|
3577
|
+
end
|
3578
|
+
|
3579
|
+
# Set the DPI resolution of the input image. The DPI affects margin options specified in points too (e.g. 1 point is equal to 1 pixel in 96 DPI).
|
3580
|
+
#
|
3581
|
+
# * +dpi+ - The DPI value.
|
3582
|
+
# * *Returns* - The converter object.
|
3583
|
+
def setDpi(dpi)
|
3584
|
+
@fields['dpi'] = dpi
|
3585
|
+
self
|
3586
|
+
end
|
3587
|
+
|
3410
3588
|
# Turn on the debug logging. Details about the conversion are stored in the debug log. The URL of the log can be obtained from the getDebugLogUrl method or available in conversion statistics.
|
3411
3589
|
#
|
3412
3590
|
# * +value+ - Set to true to enable the debug logging.
|
@@ -3564,11 +3742,11 @@ module Pdfcrowd
|
|
3564
3742
|
|
3565
3743
|
# Specifies the action to be performed on the input PDFs.
|
3566
3744
|
#
|
3567
|
-
# * +action+ - Allowed values are join, shuffle.
|
3745
|
+
# * +action+ - Allowed values are join, shuffle, extract, delete.
|
3568
3746
|
# * *Returns* - The converter object.
|
3569
3747
|
def setAction(action)
|
3570
|
-
unless /(?i)^(join|shuffle)$/.match(action)
|
3571
|
-
raise Error.new(Pdfcrowd.create_invalid_value_message(action, "setAction", "pdf-to-pdf", "Allowed values are join, shuffle.", "set_action"), 470);
|
3748
|
+
unless /(?i)^(join|shuffle|extract|delete)$/.match(action)
|
3749
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(action, "setAction", "pdf-to-pdf", "Allowed values are join, shuffle, extract, delete.", "set_action"), 470);
|
3572
3750
|
end
|
3573
3751
|
|
3574
3752
|
@fields['action'] = action
|
@@ -3638,6 +3816,19 @@ module Pdfcrowd
|
|
3638
3816
|
self
|
3639
3817
|
end
|
3640
3818
|
|
3819
|
+
# Set the page range for extract or delete action.
|
3820
|
+
#
|
3821
|
+
# * +pages+ - A comma separated list of page numbers or ranges.
|
3822
|
+
# * *Returns* - The converter object.
|
3823
|
+
def setPageRange(pages)
|
3824
|
+
unless /^(?:\s*(?:\d+|(?:\d*\s*\-\s*\d+)|(?:\d+\s*\-\s*\d*))\s*,\s*)*\s*(?:\d+|(?:\d*\s*\-\s*\d+)|(?:\d+\s*\-\s*\d*))\s*$/.match(pages)
|
3825
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(pages, "setPageRange", "pdf-to-pdf", "A comma separated list of page numbers or ranges.", "set_page_range"), 470);
|
3826
|
+
end
|
3827
|
+
|
3828
|
+
@fields['page_range'] = pages
|
3829
|
+
self
|
3830
|
+
end
|
3831
|
+
|
3641
3832
|
# 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.
|
3642
3833
|
#
|
3643
3834
|
# * +watermark+ - The file path to a local file. The file must exist and not be empty.
|
@@ -4303,6 +4494,184 @@ module Pdfcrowd
|
|
4303
4494
|
self
|
4304
4495
|
end
|
4305
4496
|
|
4497
|
+
# Set the output page size.
|
4498
|
+
#
|
4499
|
+
# * +size+ - Allowed values are A0, A1, A2, A3, A4, A5, A6, Letter.
|
4500
|
+
# * *Returns* - The converter object.
|
4501
|
+
def setPageSize(size)
|
4502
|
+
unless /(?i)^(A0|A1|A2|A3|A4|A5|A6|Letter)$/.match(size)
|
4503
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(size, "setPageSize", "image-to-pdf", "Allowed values are A0, A1, A2, A3, A4, A5, A6, Letter.", "set_page_size"), 470);
|
4504
|
+
end
|
4505
|
+
|
4506
|
+
@fields['page_size'] = size
|
4507
|
+
self
|
4508
|
+
end
|
4509
|
+
|
4510
|
+
# Set the output page width.
|
4511
|
+
#
|
4512
|
+
# * +width+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4513
|
+
# * *Returns* - The converter object.
|
4514
|
+
def setPageWidth(width)
|
4515
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(width)
|
4516
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(width, "setPageWidth", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_page_width"), 470);
|
4517
|
+
end
|
4518
|
+
|
4519
|
+
@fields['page_width'] = width
|
4520
|
+
self
|
4521
|
+
end
|
4522
|
+
|
4523
|
+
# Set the output page height.
|
4524
|
+
#
|
4525
|
+
# * +height+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4526
|
+
# * *Returns* - The converter object.
|
4527
|
+
def setPageHeight(height)
|
4528
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(height)
|
4529
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(height, "setPageHeight", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_page_height"), 470);
|
4530
|
+
end
|
4531
|
+
|
4532
|
+
@fields['page_height'] = height
|
4533
|
+
self
|
4534
|
+
end
|
4535
|
+
|
4536
|
+
# Set the output page dimensions. If no page size is specified, margins are applied as a border around the image.
|
4537
|
+
#
|
4538
|
+
# * +width+ - Set the output page width. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4539
|
+
# * +height+ - Set the output page height. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4540
|
+
# * *Returns* - The converter object.
|
4541
|
+
def setPageDimensions(width, height)
|
4542
|
+
setPageWidth(width)
|
4543
|
+
setPageHeight(height)
|
4544
|
+
self
|
4545
|
+
end
|
4546
|
+
|
4547
|
+
# Set the output page orientation.
|
4548
|
+
#
|
4549
|
+
# * +orientation+ - Allowed values are landscape, portrait.
|
4550
|
+
# * *Returns* - The converter object.
|
4551
|
+
def setOrientation(orientation)
|
4552
|
+
unless /(?i)^(landscape|portrait)$/.match(orientation)
|
4553
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(orientation, "setOrientation", "image-to-pdf", "Allowed values are landscape, portrait.", "set_orientation"), 470);
|
4554
|
+
end
|
4555
|
+
|
4556
|
+
@fields['orientation'] = orientation
|
4557
|
+
self
|
4558
|
+
end
|
4559
|
+
|
4560
|
+
# Set the image position on the page.
|
4561
|
+
#
|
4562
|
+
# * +position+ - Allowed values are center, top, bottom, left, right, top-left, top-right, bottom-left, bottom-right.
|
4563
|
+
# * *Returns* - The converter object.
|
4564
|
+
def setPosition(position)
|
4565
|
+
unless /(?i)^(center|top|bottom|left|right|top-left|top-right|bottom-left|bottom-right)$/.match(position)
|
4566
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(position, "setPosition", "image-to-pdf", "Allowed values are center, top, bottom, left, right, top-left, top-right, bottom-left, bottom-right.", "set_position"), 470);
|
4567
|
+
end
|
4568
|
+
|
4569
|
+
@fields['position'] = position
|
4570
|
+
self
|
4571
|
+
end
|
4572
|
+
|
4573
|
+
# Set the mode to print the image on the content area of the page.
|
4574
|
+
#
|
4575
|
+
# * +mode+ - Allowed values are default, fit, stretch.
|
4576
|
+
# * *Returns* - The converter object.
|
4577
|
+
def setPrintPageMode(mode)
|
4578
|
+
unless /(?i)^(default|fit|stretch)$/.match(mode)
|
4579
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(mode, "setPrintPageMode", "image-to-pdf", "Allowed values are default, fit, stretch.", "set_print_page_mode"), 470);
|
4580
|
+
end
|
4581
|
+
|
4582
|
+
@fields['print_page_mode'] = mode
|
4583
|
+
self
|
4584
|
+
end
|
4585
|
+
|
4586
|
+
# Set the output page top margin.
|
4587
|
+
#
|
4588
|
+
# * +top+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4589
|
+
# * *Returns* - The converter object.
|
4590
|
+
def setMarginTop(top)
|
4591
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(top)
|
4592
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(top, "setMarginTop", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_top"), 470);
|
4593
|
+
end
|
4594
|
+
|
4595
|
+
@fields['margin_top'] = top
|
4596
|
+
self
|
4597
|
+
end
|
4598
|
+
|
4599
|
+
# Set the output page right margin.
|
4600
|
+
#
|
4601
|
+
# * +right+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4602
|
+
# * *Returns* - The converter object.
|
4603
|
+
def setMarginRight(right)
|
4604
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(right)
|
4605
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(right, "setMarginRight", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_right"), 470);
|
4606
|
+
end
|
4607
|
+
|
4608
|
+
@fields['margin_right'] = right
|
4609
|
+
self
|
4610
|
+
end
|
4611
|
+
|
4612
|
+
# Set the output page bottom margin.
|
4613
|
+
#
|
4614
|
+
# * +bottom+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4615
|
+
# * *Returns* - The converter object.
|
4616
|
+
def setMarginBottom(bottom)
|
4617
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(bottom)
|
4618
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(bottom, "setMarginBottom", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_bottom"), 470);
|
4619
|
+
end
|
4620
|
+
|
4621
|
+
@fields['margin_bottom'] = bottom
|
4622
|
+
self
|
4623
|
+
end
|
4624
|
+
|
4625
|
+
# Set the output page left margin.
|
4626
|
+
#
|
4627
|
+
# * +left+ - The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4628
|
+
# * *Returns* - The converter object.
|
4629
|
+
def setMarginLeft(left)
|
4630
|
+
unless /(?i)^0$|^[0-9]*\.?[0-9]+(pt|px|mm|cm|in)$/.match(left)
|
4631
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(left, "setMarginLeft", "image-to-pdf", "The value must be specified in inches \"in\", millimeters \"mm\", centimeters \"cm\", or points \"pt\".", "set_margin_left"), 470);
|
4632
|
+
end
|
4633
|
+
|
4634
|
+
@fields['margin_left'] = left
|
4635
|
+
self
|
4636
|
+
end
|
4637
|
+
|
4638
|
+
# Set the output page margins.
|
4639
|
+
#
|
4640
|
+
# * +top+ - Set the output page top margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4641
|
+
# * +right+ - Set the output page right margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4642
|
+
# * +bottom+ - Set the output page bottom margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4643
|
+
# * +left+ - Set the output page left margin. The value must be specified in inches "in", millimeters "mm", centimeters "cm", or points "pt".
|
4644
|
+
# * *Returns* - The converter object.
|
4645
|
+
def setPageMargins(top, right, bottom, left)
|
4646
|
+
setMarginTop(top)
|
4647
|
+
setMarginRight(right)
|
4648
|
+
setMarginBottom(bottom)
|
4649
|
+
setMarginLeft(left)
|
4650
|
+
self
|
4651
|
+
end
|
4652
|
+
|
4653
|
+
# The page background color in RGB or RGBA hexadecimal format. The color fills the entire page regardless of the margins. If not page size is specified and the image format supports background (e.g. PDF, PNG), the background color is applied too.
|
4654
|
+
#
|
4655
|
+
# * +color+ - The value must be in RRGGBB or RRGGBBAA hexadecimal format.
|
4656
|
+
# * *Returns* - The converter object.
|
4657
|
+
def setPageBackgroundColor(color)
|
4658
|
+
unless /^[0-9a-fA-F]{6,8}$/.match(color)
|
4659
|
+
raise Error.new(Pdfcrowd.create_invalid_value_message(color, "setPageBackgroundColor", "image-to-pdf", "The value must be in RRGGBB or RRGGBBAA hexadecimal format.", "set_page_background_color"), 470);
|
4660
|
+
end
|
4661
|
+
|
4662
|
+
@fields['page_background_color'] = color
|
4663
|
+
self
|
4664
|
+
end
|
4665
|
+
|
4666
|
+
# Set the DPI resolution of the input image. The DPI affects margin options specified in points too (e.g. 1 point is equal to 1 pixel in 96 DPI).
|
4667
|
+
#
|
4668
|
+
# * +dpi+ - The DPI value.
|
4669
|
+
# * *Returns* - The converter object.
|
4670
|
+
def setDpi(dpi)
|
4671
|
+
@fields['dpi'] = dpi
|
4672
|
+
self
|
4673
|
+
end
|
4674
|
+
|
4306
4675
|
# 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.
|
4307
4676
|
#
|
4308
4677
|
# * +watermark+ - The file path to a local file. The file must exist and 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.
|
4
|
+
version: 5.11.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:
|
11
|
+
date: 2023-01-16 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.
|