Class PreflightType3Stream
java.lang.Object
org.apache.pdfbox.contentstream.PDFStreamEngine
org.apache.pdfbox.preflight.content.PreflightStreamEngine
org.apache.pdfbox.preflight.font.util.PreflightType3Stream
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
FieldsModifier and TypeFieldDescriptionprivate BoundingBox
private final PDType3CharProc
private boolean
private PDInlineImage
private float
Fields inherited from class org.apache.pdfbox.preflight.content.PreflightStreamEngine
context, cosDocument, processedPage
-
Constructor Summary
ConstructorsConstructorDescriptionPreflightType3Stream
(PreflightContext context, PDPage page, PDType3CharProc charProc) -
Method Summary
Modifier and TypeMethodDescriptionprivate 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".This will parse a type3 stream and create an image from it.float
getWidth()
protected void
processOperator
(Operator operator, List<COSBase> operands) This is used to handle an operation.void
showType3Character
(PDType3CharProc charProc) Methods inherited from class org.apache.pdfbox.preflight.content.PreflightStreamEngine
checkColorOperators, checkSetColorSpaceOperators, registerError, registerError, registerError, registerError, validateInlineImageColorSpace, validateInlineImageFilter, validateNumberOfGraphicStates, validateRenderingIntent
Methods inherited from class org.apache.pdfbox.contentstream.PDFStreamEngine
addOperator, applyTextAdjustment, beginMarkedContentSequence, beginText, decreaseLevel, endMarkedContentSequence, endText, getAppearance, getCurrentPage, getGraphicsStackSize, getGraphicsState, getInitialMatrix, getLevel, getResources, getTextLineMatrix, getTextMatrix, increaseLevel, operatorException, processAnnotation, processChildStream, processOperator, processPage, processSoftMask, processTilingPattern, processTilingPattern, processTransparencyGroup, processType3Stream, registerOperatorProcessor, restoreGraphicsStack, restoreGraphicsState, saveGraphicsStack, saveGraphicsState, setLineDashPattern, setTextLineMatrix, setTextMatrix, showAnnotation, showFontGlyph, showFontGlyph, showForm, showGlyph, showGlyph, showText, showTextString, showTextStrings, showTransparencyGroup, showType3Glyph, showType3Glyph, transformedPoint, transformWidth, unsupportedOperator
-
Field Details
-
charProc
-
firstOperator
private boolean firstOperator -
width
private float width -
image
-
box
-
-
Constructor Details
-
PreflightType3Stream
-
-
Method Details
-
showType3Character
- Throws:
IOException
-
createImage
This will parse a type3 stream and create an image from it.- Returns:
- The image that was created.
- Throws:
IOException
- If there is an error processing the stream.
-
processOperator
This is used to handle an operation.- Overrides:
processOperator
in classPDFStreamEngine
- Parameters:
operator
- The operation to perform.operands
- The list of arguments.- Throws:
IOException
- If there is an error processing the operation.
-
checkType3FirstOperator
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.- Parameters:
arguments
-- Throws:
IOException
-
getWidth
public float getWidth()- Returns:
- the width of the CharProc glyph description
-