Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.font

pack-priv Class PDType1FontEmbedder

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, java.util.ArrayList, .List, org.apache.fontbox.afm.FontMetrics, org.apache.fontbox.encoding.BuiltInEncoding, org.apache.fontbox.pfb.PfbParser, org.apache.fontbox.type1.Type1Font, org.apache.fontbox.util.BoundingBox, org.apache.pdfbox.cos.COSArray, .COSDictionary, .COSName, org.apache.pdfbox.io.IOUtils, org.apache.pdfbox.pdmodel.PDDocument, org.apache.pdfbox.pdmodel.common.PDRectangle, .PDStream, org.apache.pdfbox.pdmodel.font.encoding.Encoding, .GlyphList, .Type1Encoding

Embedded PDType1Font builder. Helper class to populate a PDType1Font from a PFB and AFM.
Author
Michael Niedermair

Field Summary

Modifier and TypeField and Description
private final Encoding
private final Type1Font

Constructor Summary

AccessConstructor and Description
pack-priv
PDType1FontEmbedder(PDDocument
The PDF document that will hold the embedded font.
doc
,
COSDictionary
The Font dictionary to write to.
dict
,
InputStream
The pfb input.
pfbStream
,
Encoding encoding)

This will load a PFB to be embedded into a document.

Method Summary

Modifier and TypeMethod and Description
pack-priv static PDFontDescriptor
buildFontDescriptor(Type1Font type1)

Returns a PDFontDescriptor for the given PFB.

pack-priv static PDFontDescriptor
buildFontDescriptor(FontMetrics
AFM
metrics
)

Returns a PDFontDescriptor for the given AFM.

public Encoding
getFontEncoding()

Returns the font's encoding.

public GlyphList
getGlyphList()

Returns the font's glyph list.

public Type1Font
getType1Font()

Returns the Type 1 font.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fontEncodingback to summary
private final Encoding fontEncoding
type1back to summary
private final Type1Font type1

Constructor Detail

PDType1FontEmbedderback to summary
pack-priv PDType1FontEmbedder(PDDocument doc, COSDictionary dict, InputStream pfbStream, Encoding encoding) throws IOException

This will load a PFB to be embedded into a document.

Parameters
doc:PDDocument

The PDF document that will hold the embedded font.

dict:COSDictionary

The Font dictionary to write to.

pfbStream:InputStream

The pfb input.

Exceptions
IOException:
If there is an error loading the data.

Method Detail

buildFontDescriptorback to summary
pack-priv static PDFontDescriptor buildFontDescriptor(Type1Font type1) throws IOException

Returns a PDFontDescriptor for the given PFB.

Exceptions
IOException:
if the font bounding box isn't available
buildFontDescriptorback to summary
pack-priv static PDFontDescriptor buildFontDescriptor(FontMetrics metrics)

Returns a PDFontDescriptor for the given AFM. Used only for Standard 14 fonts.

Parameters
metrics:FontMetrics

AFM

getFontEncodingback to summary
public Encoding getFontEncoding()

Returns the font's encoding.

getGlyphListback to summary
public GlyphList getGlyphList()

Returns the font's glyph list.

getType1Fontback to summary
public Type1Font getType1Font()

Returns the Type 1 font.