Class: Consolidate::Docx::Image
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Consolidate::Docx::Image
- Defined in:
- lib/consolidate/docx/image.rb
Constant Summary collapse
- DEFAULT_PAGE_WIDTH =
Constants
12_240- TWENTIETHS_OF_A_POINT_TO_EMU =
635- DEFAULT_PAGE_WIDTH_IN_EMU =
DEFAULT_PAGE_WIDTH * TWENTIETHS_OF_A_POINT_TO_EMU
- EMU_PER_PIXEL =
9525- DEFAULT_PAGE_HEIGHT =
Assuming US Letter size
DEFAULT_PAGE_WIDTH * 11 / 8.5
- DEFAULT_PAGE_HEIGHT_IN_EMU =
DEFAULT_PAGE_HEIGHT * TWENTIETHS_OF_A_POINT_TO_EMU
- DEFAULT_MARGIN_IN_EMU =
Common page margins in EMU (0.75 inches)
685800
Instance Method Summary collapse
- #emu_per_height_pixel ⇒ Object
- #emu_per_width_pixel ⇒ Object
-
#height_in_emu ⇒ Object
Convert height from pixels to EMU with proper DPI scaling.
-
#media_path ⇒ Object
Path to use when referencing this image from other documents.
-
#storage_path ⇒ Object
Path to use when storing this image within the docx.
-
#width_in_emu ⇒ Object
Convert width from pixels to EMU with proper DPI scaling.
Instance Method Details
#emu_per_height_pixel ⇒ Object
22 |
# File 'lib/consolidate/docx/image.rb', line 22 def emu_per_height_pixel = EMU_PER_PIXEL * 72 / dpi[:y] |
#emu_per_width_pixel ⇒ Object
20 |
# File 'lib/consolidate/docx/image.rb', line 20 def emu_per_width_pixel = EMU_PER_PIXEL * 72 / dpi[:x] |
#height_in_emu ⇒ Object
Convert height from pixels to EMU with proper DPI scaling
18 |
# File 'lib/consolidate/docx/image.rb', line 18 def height_in_emu = height * emu_per_height_pixel |
#media_path ⇒ Object
Path to use when referencing this image from other documents
9 |
# File 'lib/consolidate/docx/image.rb', line 9 def media_path = "media/#{name}" |
#storage_path ⇒ Object
Path to use when storing this image within the docx
12 |
# File 'lib/consolidate/docx/image.rb', line 12 def storage_path = "word/#{media_path}" |
#width_in_emu ⇒ Object
Convert width from pixels to EMU with proper DPI scaling
15 |
# File 'lib/consolidate/docx/image.rb', line 15 def width_in_emu = width * emu_per_width_pixel |