Images

Prince supports JPEG, PNG, TIFF and GIF images.

Images can be included in XHTML and DocBook documents using the appropriate image elements, which are pre-defined in the default style sheets.

Images can also be included in arbitrary XML documents using the CSS content property, which can be used to specify the image filename.

Images in XHTML

The img element is used to include images in XHTML documents.

XML

<img src="picture.jpg" alt="A Nice Picture"/>

Images in DocBook

The imagedata element is used to include images in DocBook documents.

XML

<mediaobject>
    <imageobject>
      <imagedata fileref="picture.jpg"/>
    </imageobject>
</mediaobject>

Images in arbitrary XML

Images can be included in arbitrary XML documents by using the CSS content property to specify the image filename.

The content property can specify the image filename directly, or it can take the filename from an attribute of the element to which it has been applied.

CSS

picture { content: url("picture.png") }

XML

<para> A nice <picture /> here. </para>.

The content property directly specifies the filename of the image that will be used as the content of the picture element.

CSS

picture { content: attr("src", url) }

XML

<para> A nice <picture src="picture.tiff" /> here. </para>.

The content property specifies that the content of the picture element will be an image loaded from the filename specified by the src attribute of the element.