Next: , Previous: , Up: Top   [Contents][Index]

10 Images in ODT export

10.1 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:


10.2 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 website, do the following


10.3 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.12 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
Scale the image

To embed ‘img.png’ at half its size, do the following:

#+ATTR_ODT: :scale 0.5
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
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

10.4 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 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"



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.

Previous: , Up: Images in ODT export   [Contents][Index]