Method: Pdfcrowd::HtmlToPdfClient#setImageDpi

Defined in:
lib/pdfcrowd.rb

#setImageDpi(dpi) ⇒ Object

Set the DPI of images in PDF. A lower DPI may result in a smaller PDF file. If the specified DPI is higher than the actual image DPI, the original image DPI is retained (no upscaling is performed). Use 0 to leave the images unaltered.

  • dpi - The DPI value. Must be a positive integer or 0.

  • Returns - The converter object.



1856
1857
1858
1859
1860
1861
1862
1863
# File 'lib/pdfcrowd.rb', line 1856

def setImageDpi(dpi)
    if (!(Integer(dpi) >= 0))
        raise Error.new(Pdfcrowd.create_invalid_value_message(dpi, "setImageDpi", "html-to-pdf", "Must be a positive integer or 0.", "set_image_dpi"), 470);
    end
    
    @fields['image_dpi'] = dpi
    self
end