Module: Prawn::Images
- Included in:
- Document
- Defined in:
- lib/prawn/images.rb,
lib/prawn/images/jpg.rb,
lib/prawn/images/png.rb,
lib/prawn/images/image.rb
Overview
rubocop: disable Style/Documentation
Defined Under Namespace
Stable API collapse
-
#image(file, options = {}) ⇒ Prawn::Images::Image
Add the image at ‘file` to the current page.
Instance Method Details
#image(file, options = {}) ⇒ Prawn::Images::Image
Add the image at ‘file` to the current page. Currently only JPG and PNG files are supported. (Note that processing PNG images with alpha channels can be processor and memory intensive.)
If only one of ‘:width` or `:height` are provided, the image will be scaled proportionally. When both are provided, the image will be stretched to fit the dimensions without maintaining the aspect ratio.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/prawn/images.rb', line 56 def image(file, = {}) Prawn.( %i[at position vposition height width scale fit], , ) pdf_obj, info = build_image_object(file) (pdf_obj, info, ) info end |