ChartDirector 7.0 (Java Edition)

Notes On Output Formats


This section contains notes on using certain output formats in ChartDirector.

Raster Only Graphics Primitives

For historical reasons, ChartDirector includes certain low level raster only graphics primitives. Examples are DrawArea.pixel and DrawArea.getPixel which sets and gets a pixel from the frame buffer of the image, DrawArea.fill2 and DrawArea.fill2 which perform flood filling, and various non-affine transform functions. These functions have no effect in vector graphics formats such as SVG and PDF, and should not be used with these formats.

ChartDirector does not use any raster only graphics primitive, so they will not affect charts created by ChartDirector. The above would only be a concern if your code is using the DrawArea object for custom drawing and the output is in a vector graphics format such as SVG or PDF.

Fonts in PDF

When creating PDF, it is common to embed the fonts into the PDF output. In this way, the viewing computer can display the contents even if the computer does not have the necessary fonts installed.

To embed a font in PDF, ChartDirector needs to know the path of the font file. However, in Java, a font is often specified using the font family name and style, not the filename. For example, "Verdana Bold Italic" can be used to specify a font instead of "verdanaz.ttf". There is no Java API that can determine the filename from the "family name". To locate the font file, on Windows and Mac OS X, ChartDirector will try to guess the font filename from the family name. If this is not successful, ChartDirector will scan the operating system font directories to create a map of font family names to filenames, then use the map to resolve the font filename.

On Linux or many other operating systems, there is no standard font directory. In this case, ChartDirector will scan the directories specified in the "cd.fontpath" property if available. This property can be set using the "-D" flag in the Java command line or the Java System.setProperty API. In the latter case, the property must be specified before outputting any PDF, as ChartDirector will only attempt to scan the directory once when it is first needed.

The following points can ensure ChartDirector can find the font files:

Drop Shadows in PDF

ChartDirector currently does not support drop shadows in PDF. If a drop shadow is added, extra margins may be included in the output to accommodate the drop shadow, but the shadow will not appear.