XML2PDF Formatting Engine has a comprehensive support for various graphics types that can be used within it. All formats specified below will be rendered properly by XML2PDF Formatting Engine as both external and internal graphical resource. The way they can be included depends on the format specific information.

List of Formats Supported

Most of the known raster image formats. At the moment these include:

  • bitmap image (BMP);
  • enhanced windows metafile image (EMF);
  • exchangeable image file (Exif);
  • graphics interchange format image (GIF);
  • the windows icon image (ICO);
  • the joint photographic experts group image format (JPEG);
  • the W3C Portable Network Graphics (PNG);
  • the tag image file format (TIFF);
  • the windows metafile image format (WMF);

Specific formats:

  • Encapsulated PostScript (EPS). Only binary preview is added. PostScript contents is ignored.
  • Portable Document Format (PDF). The first page of the referenced PDF is embedded as PDF contents without any loss of quality.
  • Scalable Vector Graphics (SVG). This format is natively supported by XML2PDF Formatting Engine and can be rendered as an integral part of any supported input XML format. See SVG implementation details for additional information.
  • Various Audio and Video Formats: Audio Interchange File Format (AIFF), NeXT/SunT Audio Format (AU), Audio/Video Interleaved (AVI), Musical Instrument Digital Interface (MIDI), QuickTime movie (MOV), MPEG Audio Layer-3 (MP3), MPEG-4 Video (MP4), MPEG-2 Video (MPEG), Synchronized Multimedia Integration Language (SMIL).

Format Specific Syntax

In general, there are two main strategies for embedding graphics into an XML file. These are an internal (stored in the body of the XML file) and external graphics (stored outside the file and referenced by URL or relative path). In all formats Base64 encoded binary streams can be used as a replacement to the URI/URL as described in “RFC2397: URL scheme”. This allows to embed any graphics inside an XML file.


External graphics image can be referenced either by using the <fo:external-graphic> tag or by the background-image attribute. According to the W3C XSL-FO specification internal graphics might be embedded into an XML file using <fo:instream-foreign-object>. The current implementation supports either raw SVG stream or Base64 encoded binary stream of any file format mentioned above.


This format has native support for both internal and external graphics. We support all its features including “RFC2397: URL scheme” and allow using any format described above even including SVG, SWF or PDF.


There are several ways to include external graphics into HTML, such as <img> and <object> tags. We support both these tags. Flash movies (SWF) in the <object> tag are treated in the same way as handled by the Microsoft Internet Explorer. In addition, we extend usage of the <object> tag by allowing to include raw SVG stream inside it.