Top Description Fields Constructors Methods
org.apache.pdfbox.preflight.font.util

public Class PreflightType3Stream

extends PreflightStreamEngine
Class Inheritance
Imports
java.awt.Image, java.io.IOException, java.util.List, org.apache.fontbox.util.BoundingBox, org.apache.pdfbox.cos.COSNumber, .COSBase, org.apache.pdfbox.pdmodel.PDPage, org.apache.pdfbox.pdmodel.font.PDType3CharProc, org.apache.pdfbox.pdmodel.graphics.image.PDInlineImage, org.apache.pdfbox.preflight.PreflightContext, org.apache.pdfbox.preflight.content.PreflightStreamEngine, org.apache.pdfbox.contentstream.operator.Operator, .OperatorName

This class is used to parse a glyph of a Type3 font program. If the glyph is parsed without error, the width of the glyph is accessible through the getWidth method.

Field Summary

Modifier and TypeField and Description
private BoundingBox
private final PDType3CharProc
private boolean
private PDInlineImage
private float
Inherited from org.apache.pdfbox.preflight.content.PreflightStreamEngine:
contextprocessedPage

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
checkType3FirstOperator(List<COSBase> arguments)

According to the PDF Reference, the first operator in a CharProc of a Type3 font must be "d0" or "d1".

public Image

Returns:

The image that was created.
createImage
()

This will parse a type3 stream and create an image from it.

public float

Returns:

the width of the CharProc glyph description
getWidth
()

protected void
processOperator(Operator
The operation to perform.
operator
,
List<COSBase>
The list of arguments.
operands
)

Overrides org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator.

This is used to handle an operation.

public void
Inherited from org.apache.pdfbox.preflight.content.PreflightStreamEngine:
checkColorOperatorscheckSetColorSpaceOperatorsregisterErrorregisterErrorregisterErrorregisterErrorvalidateInlineImageColorSpacevalidateInlineImageFiltervalidateNumberOfGraphicStatesvalidateRenderingIntent

Field Detail

boxback to summary
private BoundingBox box
charProcback to summary
private final PDType3CharProc charProc
firstOperatorback to summary
private boolean firstOperator
imageback to summary
private PDInlineImage image
widthback to summary
private float width

Constructor Detail

PreflightType3Streamback to summary
public PreflightType3Stream(PreflightContext context, PDPage page, PDType3CharProc charProc)

Method Detail

checkType3FirstOperatorback to summary
private void checkType3FirstOperator(List<COSBase> arguments) throws IOException

According to the PDF Reference, the first operator in a CharProc of a Type3 font must be "d0" or "d1". This method process this validation. This method is called by the processOperator method.

createImageback to summary
public Image createImage() throws IOException

This will parse a type3 stream and create an image from it.

Returns:Image

The image that was created.

Exceptions
IOException:
If there is an error processing the stream.
getWidthback to summary
public float getWidth()
Returns:float

the width of the CharProc glyph description

processOperatorback to summary
protected void processOperator(Operator operator, List<COSBase> operands) throws IOException

Overrides org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator.

This is used to handle an operation.

Parameters
operator:Operator

The operation to perform.

operands:List<COSBase>

The list of arguments.

Annotations
@Override
Exceptions
IOException:
If there is an error processing the operation.
showType3Characterback to summary
public void showType3Character(PDType3CharProc charProc) throws IOException