pdfcrowd 4.9.0 → 4.10.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 +18 -33
- 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: 73bc7e703513651b2b2c314dccb8789d12ecd7a5
         | 
| 4 | 
            +
              data.tar.gz: c24923fce2dc420d331939ca1bc399b48e345fc8
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 62cb40465cbf4696711f51a1ae8e8075e4301ca389acef6a8b23a8ab7567b6c3d5ac62becfb58947b955269c00f47b13875eae6dcbf32e1f31fe393173496f4d
         | 
| 7 | 
            +
              data.tar.gz: 67b8144a6827003b289aae2fb920261eb6261d17b77e5dd655058c207d8f6d7f4a79f9658ec4e96cf2a36ae24394e6257b41953d8402a26ddb6cfcfab283e95e
         | 
    
        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. | 
| 533 | 
            +
                CLIENT_VERSION = '4.10.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/4. | 
| 544 | 
            +
                        setUserAgent('pdfcrowd_ruby_client/4.10.0 (http://pdfcrowd.com)')
         | 
| 545 545 |  | 
| 546 546 | 
             
                        @retry_count = 1
         | 
| 547 547 | 
             
                    end
         | 
| @@ -683,6 +683,7 @@ module Pdfcrowd | |
| 683 683 |  | 
| 684 684 | 
             
                            begin
         | 
| 685 685 | 
             
                                http.start {|conn|
         | 
| 686 | 
            +
                                    conn.read_timeout = 300
         | 
| 686 687 | 
             
                                    conn.request(request) {|response|
         | 
| 687 688 | 
             
                                        @debug_log_url = response["X-Pdfcrowd-Debug-Log"] || ''
         | 
| 688 689 | 
             
                                        @credits = (response["X-Pdfcrowd-Remaining-Credits"] || 999999).to_i
         | 
| @@ -802,10 +803,6 @@ module Pdfcrowd | |
| 802 803 | 
             
                            raise Error.new(Pdfcrowd.create_invalid_value_message(file, "file", "html-to-pdf", "The file must exist and not be empty.", "convert_file"), 470);
         | 
| 803 804 | 
             
                        end
         | 
| 804 805 |  | 
| 805 | 
            -
                        if (!(File.file?(file) && !File.zero?(file)))
         | 
| 806 | 
            -
                            raise Error.new(Pdfcrowd.create_invalid_value_message(file, "file", "html-to-pdf", "The file name must have a valid extension.", "convert_file"), 470);
         | 
| 807 | 
            -
                        end
         | 
| 808 | 
            -
                        
         | 
| 809 806 | 
             
                        @files['file'] = file
         | 
| 810 807 | 
             
                        @helper.post(@fields, @files, @raw_data)
         | 
| 811 808 | 
             
                    end
         | 
| @@ -819,10 +816,6 @@ module Pdfcrowd | |
| 819 816 | 
             
                            raise Error.new(Pdfcrowd.create_invalid_value_message(file, "file", "html-to-pdf", "The file must exist and not be empty.", "convert_file_to_stream"), 470);
         | 
| 820 817 | 
             
                        end
         | 
| 821 818 |  | 
| 822 | 
            -
                        if (!(File.file?(file) && !File.zero?(file)))
         | 
| 823 | 
            -
                            raise Error.new(Pdfcrowd.create_invalid_value_message(file, "file", "html-to-pdf", "The file name must have a valid extension.", "convert_file_to_stream"), 470);
         | 
| 824 | 
            -
                        end
         | 
| 825 | 
            -
                        
         | 
| 826 819 | 
             
                        @files['file'] = file
         | 
| 827 820 | 
             
                        @helper.post(@fields, @files, @raw_data, out_stream)
         | 
| 828 821 | 
             
                    end
         | 
| @@ -1008,7 +1001,7 @@ module Pdfcrowd | |
| 1008 1001 | 
             
                        self
         | 
| 1009 1002 | 
             
                    end
         | 
| 1010 1003 |  | 
| 1011 | 
            -
                    # Disable margins.
         | 
| 1004 | 
            +
                    # Disable page margins.
         | 
| 1012 1005 | 
             
                    #
         | 
| 1013 1006 | 
             
                    # * +no_margins+ - Set to true to disable margins.
         | 
| 1014 1007 | 
             
                    # * *Returns* - The converter object.
         | 
| @@ -1158,7 +1151,7 @@ module Pdfcrowd | |
| 1158 1151 | 
             
                        self
         | 
| 1159 1152 | 
             
                    end
         | 
| 1160 1153 |  | 
| 1161 | 
            -
                    # Set the top left X coordinate of the content area. It | 
| 1154 | 
            +
                    # Set the top left X coordinate of the content area. It is relative to the top left X coordinate of the print area.
         | 
| 1162 1155 | 
             
                    #
         | 
| 1163 1156 | 
             
                    # * +content_area_x+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt). It may contain a negative value.
         | 
| 1164 1157 | 
             
                    # * *Returns* - The converter object.
         | 
| @@ -1171,7 +1164,7 @@ module Pdfcrowd | |
| 1171 1164 | 
             
                        self
         | 
| 1172 1165 | 
             
                    end
         | 
| 1173 1166 |  | 
| 1174 | 
            -
                    # Set the top left Y coordinate of the content area. It | 
| 1167 | 
            +
                    # Set the top left Y coordinate of the content area. It is relative to the top left Y coordinate of the print area.
         | 
| 1175 1168 | 
             
                    #
         | 
| 1176 1169 | 
             
                    # * +content_area_y+ - Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt). It may contain a negative value.
         | 
| 1177 1170 | 
             
                    # * *Returns* - The converter object.
         | 
| @@ -1212,8 +1205,8 @@ module Pdfcrowd | |
| 1212 1205 |  | 
| 1213 1206 | 
             
                    # Set the content area position and size. The content area enables to specify a web page area to be converted.
         | 
| 1214 1207 | 
             
                    #
         | 
| 1215 | 
            -
                    # * +x+ - Set the top left X coordinate of the content area. It | 
| 1216 | 
            -
                    # * +y+ - Set the top left Y coordinate of the content area. It | 
| 1208 | 
            +
                    # * +x+ - Set the top left X coordinate of the content area. It is relative to the top left X coordinate of the print area. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt). It may contain a negative value.
         | 
| 1209 | 
            +
                    # * +y+ - Set the top left Y coordinate of the content area. It is relative to the top left Y coordinate of the print area. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt). It may contain a negative value.
         | 
| 1217 1210 | 
             
                    # * +width+ - Set the width of the content area. It should be at least 1 inch. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
         | 
| 1218 1211 | 
             
                    # * +height+ - Set the height of the content area. It should be at least 1 inch. Can be specified in inches (in), millimeters (mm), centimeters (cm), or points (pt).
         | 
| 1219 1212 | 
             
                    # * *Returns* - The converter object.
         | 
| @@ -1520,11 +1513,11 @@ module Pdfcrowd | |
| 1520 1513 |  | 
| 1521 1514 | 
             
                    # Set the viewport width in pixels. The viewport is the user's visible area of the page.
         | 
| 1522 1515 | 
             
                    #
         | 
| 1523 | 
            -
                    # * +viewport_width+ - The value must be in the range 96- | 
| 1516 | 
            +
                    # * +viewport_width+ - The value must be in the range 96-65000.
         | 
| 1524 1517 | 
             
                    # * *Returns* - The converter object.
         | 
| 1525 1518 | 
             
                    def setViewportWidth(viewport_width)
         | 
| 1526 | 
            -
                        if (!(Integer(viewport_width) >= 96 && Integer(viewport_width) <=  | 
| 1527 | 
            -
                            raise Error.new(Pdfcrowd.create_invalid_value_message(viewport_width, "viewport_width", "html-to-pdf", "The value must be in the range 96- | 
| 1519 | 
            +
                        if (!(Integer(viewport_width) >= 96 && Integer(viewport_width) <= 65000))
         | 
| 1520 | 
            +
                            raise Error.new(Pdfcrowd.create_invalid_value_message(viewport_width, "viewport_width", "html-to-pdf", "The value must be in the range 96-65000.", "set_viewport_width"), 470);
         | 
| 1528 1521 | 
             
                        end
         | 
| 1529 1522 |  | 
| 1530 1523 | 
             
                        @fields['viewport_width'] = viewport_width
         | 
| @@ -1546,7 +1539,7 @@ module Pdfcrowd | |
| 1546 1539 |  | 
| 1547 1540 | 
             
                    # Set the viewport size. The viewport is the user's visible area of the page.
         | 
| 1548 1541 | 
             
                    #
         | 
| 1549 | 
            -
                    # * +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- | 
| 1542 | 
            +
                    # * +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-65000.
         | 
| 1550 1543 | 
             
                    # * +height+ - Set the viewport height in pixels. The viewport is the user's visible area of the page. Must be a positive integer number.
         | 
| 1551 1544 | 
             
                    # * *Returns* - The converter object.
         | 
| 1552 1545 | 
             
                    def setViewport(width, height)
         | 
| @@ -1978,7 +1971,7 @@ module Pdfcrowd | |
| 1978 1971 | 
             
                        self
         | 
| 1979 1972 | 
             
                    end
         | 
| 1980 1973 |  | 
| 1981 | 
            -
                    # A password for PKCS12 file with a client certificate if it | 
| 1974 | 
            +
                    # A password for PKCS12 file with a client certificate if it is needed.
         | 
| 1982 1975 | 
             
                    #
         | 
| 1983 1976 | 
             
                    # * +client_certificate_password+ -
         | 
| 1984 1977 | 
             
                    # * *Returns* - The converter object.
         | 
| @@ -2113,10 +2106,6 @@ module Pdfcrowd | |
| 2113 2106 | 
             
                            raise Error.new(Pdfcrowd.create_invalid_value_message(file, "file", "html-to-image", "The file must exist and not be empty.", "convert_file"), 470);
         | 
| 2114 2107 | 
             
                        end
         | 
| 2115 2108 |  | 
| 2116 | 
            -
                        if (!(File.file?(file) && !File.zero?(file)))
         | 
| 2117 | 
            -
                            raise Error.new(Pdfcrowd.create_invalid_value_message(file, "file", "html-to-image", "The file name must have a valid extension.", "convert_file"), 470);
         | 
| 2118 | 
            -
                        end
         | 
| 2119 | 
            -
                        
         | 
| 2120 2109 | 
             
                        @files['file'] = file
         | 
| 2121 2110 | 
             
                        @helper.post(@fields, @files, @raw_data)
         | 
| 2122 2111 | 
             
                    end
         | 
| @@ -2130,10 +2119,6 @@ module Pdfcrowd | |
| 2130 2119 | 
             
                            raise Error.new(Pdfcrowd.create_invalid_value_message(file, "file", "html-to-image", "The file must exist and not be empty.", "convert_file_to_stream"), 470);
         | 
| 2131 2120 | 
             
                        end
         | 
| 2132 2121 |  | 
| 2133 | 
            -
                        if (!(File.file?(file) && !File.zero?(file)))
         | 
| 2134 | 
            -
                            raise Error.new(Pdfcrowd.create_invalid_value_message(file, "file", "html-to-image", "The file name must have a valid extension.", "convert_file_to_stream"), 470);
         | 
| 2135 | 
            -
                        end
         | 
| 2136 | 
            -
                        
         | 
| 2137 2122 | 
             
                        @files['file'] = file
         | 
| 2138 2123 | 
             
                        @helper.post(@fields, @files, @raw_data, out_stream)
         | 
| 2139 2124 | 
             
                    end
         | 
| @@ -2434,18 +2419,18 @@ module Pdfcrowd | |
| 2434 2419 |  | 
| 2435 2420 | 
             
                    # Set the output image width in pixels.
         | 
| 2436 2421 | 
             
                    #
         | 
| 2437 | 
            -
                    # * +screenshot_width+ - The value must be in the range 96- | 
| 2422 | 
            +
                    # * +screenshot_width+ - The value must be in the range 96-65000.
         | 
| 2438 2423 | 
             
                    # * *Returns* - The converter object.
         | 
| 2439 2424 | 
             
                    def setScreenshotWidth(screenshot_width)
         | 
| 2440 | 
            -
                        if (!(Integer(screenshot_width) >= 96 && Integer(screenshot_width) <=  | 
| 2441 | 
            -
                            raise Error.new(Pdfcrowd.create_invalid_value_message(screenshot_width, "screenshot_width", "html-to-image", "The value must be in the range 96- | 
| 2425 | 
            +
                        if (!(Integer(screenshot_width) >= 96 && Integer(screenshot_width) <= 65000))
         | 
| 2426 | 
            +
                            raise Error.new(Pdfcrowd.create_invalid_value_message(screenshot_width, "screenshot_width", "html-to-image", "The value must be in the range 96-65000.", "set_screenshot_width"), 470);
         | 
| 2442 2427 | 
             
                        end
         | 
| 2443 2428 |  | 
| 2444 2429 | 
             
                        @fields['screenshot_width'] = screenshot_width
         | 
| 2445 2430 | 
             
                        self
         | 
| 2446 2431 | 
             
                    end
         | 
| 2447 2432 |  | 
| 2448 | 
            -
                    # Set the output image height in pixels. If it | 
| 2433 | 
            +
                    # Set the output image height in pixels. If it is not specified, actual document height is used.
         | 
| 2449 2434 | 
             
                    #
         | 
| 2450 2435 | 
             
                    # * +screenshot_height+ - Must be a positive integer number.
         | 
| 2451 2436 | 
             
                    # * *Returns* - The converter object.
         | 
| @@ -2561,7 +2546,7 @@ module Pdfcrowd | |
| 2561 2546 | 
             
                        self
         | 
| 2562 2547 | 
             
                    end
         | 
| 2563 2548 |  | 
| 2564 | 
            -
                    # A password for PKCS12 file with a client certificate if it | 
| 2549 | 
            +
                    # A password for PKCS12 file with a client certificate if it is needed.
         | 
| 2565 2550 | 
             
                    #
         | 
| 2566 2551 | 
             
                    # * +client_certificate_password+ -
         | 
| 2567 2552 | 
             
                    # * *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. | 
| 4 | 
            +
              version: 4.10.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: 2019- | 
| 11 | 
            +
            date: 2019-09-02 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.
         |