org: Images in ODT export
12.9.7 Images in ODT export
---------------------------
Embedding images
................
You can embed images within the exported document by providing a link to
the desired image file with no link description. For example, to embed
‘img.png’ do either of the following:
[[file:img.png]]
[[./img.png]]
Embedding clickable images
..........................
You can create clickable images by providing a link whose description is
a link to an image file. For example, to embed a image
‘org-mode-unicorn.png’ which when clicked jumps to <http://Orgmode.org>
website, do the following
[[http://orgmode.org][./org-mode-unicorn.png]]
Sizing and scaling of embedded images
.....................................
You can control the size and scale of the embedded images using the
‘#+ATTR_ODT’ attribute.
The exporter specifies the desired size of the image in the final
document in units of centimeters. In order to scale the embedded
images, the exporter queries for pixel dimensions of the images using
one of a) ImageMagick’s ‘identify’ program or b) Emacs ‘create-image’
and ‘image-size’ APIs(1). The pixel dimensions are subsequently
converted in to units of centimeters using ‘org-odt-pixels-per-inch’.
The default value of this variable is set to ‘display-pixels-per-inch’.
You can tweak this variable to achieve the best results.
The examples below illustrate the various possibilities.
Explicitly size the image
To embed ‘img.png’ as a 10 cm x 10 cm image, do the following:
#+ATTR_ODT: :width 10 :height 10
[[./img.png]]
Scale the image
To embed ‘img.png’ at half its size, do the following:
#+ATTR_ODT: :scale 0.5
[[./img.png]]
Scale the image to a specific width
To embed ‘img.png’ with a width of 10 cm while retaining the
original height:width ratio, do the following:
#+ATTR_ODT: :width 10
[[./img.png]]
Scale the image to a specific height
To embed ‘img.png’ with a height of 10 cm while retaining the
original height:width ratio, do the following
#+ATTR_ODT: :height 10
[[./img.png]]
Anchoring of images
...................
You can control the manner in which an image is anchored by setting the
‘:anchor’ property of it’s ‘#+ATTR_ODT’ line. You can specify one of
the following three values for the ‘:anchor’ property: ‘"as-char"’,
‘"paragraph"’ and ‘"page"’.
To create an image that is anchored to a page, do the following:
#+ATTR_ODT: :anchor "page"
[[./img.png]]
---------- Footnotes ----------
(1) Use of ‘ImageMagick’ is only desirable. However, if you
routinely produce documents that have large images or you export your
Org files that has images using a Emacs batch script, then the use of
‘ImageMagick’ is mandatory.