Product SiteDocumentation Site

3.2. Adding images

Store images in the images subdirectory in the directory that holds your XML files. Use ./images/image-name to insert images into a book. The following is an example that inserts the testimage.png image:
	<imagedata fileref="./images/testimage.png" />
<textobject><phrase>alternate text goes here</phrase></textobject>
Ensure that you supply a <textobject> so that your content remains accessible to people with visual impairments. In certain jurisdictions, you might have a legal responsibility to provide this accessibility — for example, if you or your organization must comply with Section 508 of the United States Rehabilitation Act of 1973.[1]
If your book contains images that need to be localized — for example, screenshots of a user interface in a language other than the original language of your book — place these images in the images subdirectories for each language directory. Make sure that the image file in the translated language has the same name as the image file in the original language. When you build the book in the translated language, Publican uses the file from the images subdirectory of the translated language instead of the file from the images subdirectory of the original language.

Image file locations

Publican only uses images in the images subdirectory of your XML directory and corresponding images in the images subdirectories of your translated languages. Images stored in other directories directories do not work.

PNG files in PDF documents

Publican depends on an external application, FOP, to render documents as PDF files. At present, some versions of FOP contain a bug that alters the colors in certain images in PNG format. Specifically, 32-bit PNG images are rendered correctly, while 24-bit PNG images are not.
If you notice that Publican produces a PDF file that contains images with incorrect colors, convert the original PNG files to 32-bit PNG format by adding an alpha channel to the image and rebuild the book. If your chosen image manipulation software does not include an option specifically labeled Add alpha channel, the option might be labeled Add transparency instead.