Font Handling in PDF (Base-14 Fonts)
PDF viewer software guarantees that the following fonts (the “base14 fonts”) will be available for display purposes:
courier
courier-bold
courier-boldoblique
courier-oblique
helvetica
helvetica-bold
helvetica-boldoblique
helvetica-oblique
symbol
times-bold
times-bolditalic
times-italic
times-roman
zapfdingbats
To ensure maximum portability, Java font objects are mapped into the base14 fonts when generating PDF files.
Table 1. Default mapping between Java Fonts and Base-14 Fonts
Java Font Name |
Base14 Font Name |
Dialog |
Helvetica |
Dialoginput |
Courier |
Serif |
Times |
SansSerif |
Helvetica |
Monospaced |
Courier |
You can change this mapping as follows:
pdf.putFontName("dialog", "Times");
By default the PDFPrinter assumes the output page is letter size (8.5 x 11). To change this, set the page size property:
// switch width and height to print in landscape
pdf.setPageSize(11, 8.5);
// or print on A4 paper
pdf.setPageSize(StyleConstants.PAPER_A4);
| << Compression Options | © 1996-2013 InetSoft Technology Corporation (v11.5) | Embedded Fonts >> |