1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "Users_Guide.ent">
%BOOK_ENTITIES;
]>
<section id="sect-Users_Guide-Adding_images">
<title>Adding images</title>
<para>
Store images in the <filename>images</filename> subdirectory in the directory that holds your XML files. Use <computeroutput>./images/<replaceable>image-name</replaceable></computeroutput> to insert images into a book. The following is an example that inserts the <filename>testimage.png</filename> image:
</para>
<programlisting language="XML"><mediaobject>
<imageobject>
<imagedata fileref="./images/testimage.png" />
</imageobject>
<textobject><phrase>alternate text goes here</phrase></textobject>
</mediaobject>
</programlisting>
<para>
Ensure that you supply a <sgmltag><textobject></sgmltag> 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 <citetitle>Rehabilitation Act of 1973</citetitle>.<footnote> <para>
Refer to <ulink url="http://www.section508.gov/">http://www.section508.gov/</ulink>
</para>
</footnote>
</para>
<para>
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 <filename>images</filename> 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, <application>Publican</application> uses the file from the <filename>images/</filename> subdirectory of the translated language instead of the file from the <filename>images/</filename> subdirectory of the original language.
</para>
<para>
Large images present poorly in HTML because they often go beyond the right margin of the text. Similarly, images wider than 444 pixels often go beyond the right margin of PDF pages and are cropped so that only the left side of the image is visible. Therefore, by default, <application>Publican</application> creates HTML and PDF output that instructs web browsers and PDF viewers to scale down any images larger than 444 pixels wide. Note, however, that images lose quality significantly when scaled in this way. For best results, scale or crop your images in image editing software so that they are no more than 444 pixels wide before you place them in a document.
</para>
<para>
To override <application>Publican</application> limiting the image width to 444 px, specify an image width in the <sgmltag><imagedata></sgmltag> tag. For example, to set an image width to 670 pixels:
</para>
<programlisting language="XML"><imagedata fileref=".images/image.png" width="670px"></programlisting>
<para>
If you override the default maximum image width, take care to review your output to ensure that quality standards are met.
</para>
<important>
<title>Image file locations</title>
<para>
<application>Publican</application> only uses images in the <filename>images</filename> subdirectory of your XML directory and corresponding images in the <filename>images</filename> subdirectories of your translated languages. Images stored in other directories directories do not work.
</para>
</important>
<important>
<title>PNG files in PDF documents</title>
<para>
<application>Publican</application> depends on an external application, <application>FOP</application>, to render documents as PDF files. At present, some versions of <application>FOP</application> 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.
</para>
<para>
If you notice that <application>Publican</application> produces a PDF file that contains images with incorrect colors, convert the original PNG files to 32-bit PNG format by adding an <firstterm>alpha channel</firstterm> to the image and rebuild the book. If your chosen image manipulation software does not include an option specifically labeled <literal>Add alpha channel</literal>, the option might be labeled <literal>Add transparency</literal> instead.
</para>
</important>
</section>
|