Package org.apache.pdfbox.pdmodel.font
Class PDType3CharProc
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.font.PDType3CharProc
-
- All Implemented Interfaces:
PDContentStream,COSObjectable
public final class PDType3CharProc extends java.lang.Object implements COSObjectable, PDContentStream
A Type 3 character procedure. This is a standalone PDF content stream.
-
-
Field Summary
Fields Modifier and Type Field Description private COSStreamcharStreamprivate PDType3Fontfontprivate static org.apache.commons.logging.LogLOG
-
Constructor Summary
Constructors Constructor Description PDType3CharProc(PDType3Font font, COSStream charStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PDRectanglegetBBox()Returns the bounding box of the contents.java.io.InputStreamgetContents()Returns this stream's content, if any.RandomAccessReadgetContentsForRandomAccess()Returns this stream's content, if any.PDStreamgetContentStream()COSStreamgetCOSObject()Convert this standard java object to a COS object.PDType3FontgetFont()PDRectanglegetGlyphBBox()Calculate the bounding box of this glyph.MatrixgetMatrix()Returns the matrix which transforms from the stream's space to user space.PDResourcesgetResources()Returns this stream's resources, if any.floatgetWidth()Get the width from a type3 charproc stream.private floatparseWidth(Operator operator, java.util.List<COSBase> arguments)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pdfbox.contentstream.PDContentStream
getContentsForStreamParsing
-
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
-
font
private final PDType3Font font
-
charStream
private final COSStream charStream
-
-
Constructor Detail
-
PDType3CharProc
public PDType3CharProc(PDType3Font font, COSStream charStream)
-
-
Method Detail
-
getCOSObject
public COSStream getCOSObject()
Description copied from interface:COSObjectableConvert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The cos object that matches this Java object.
-
getFont
public PDType3Font getFont()
-
getContentStream
public PDStream getContentStream()
-
getContents
public java.io.InputStream getContents() throws java.io.IOExceptionDescription copied from interface:PDContentStreamReturns this stream's content, if any.- Specified by:
getContentsin interfacePDContentStream- Returns:
- An InputStream or null.
- Throws:
java.io.IOException- If the stream could not be read
-
getContentsForRandomAccess
public RandomAccessRead getContentsForRandomAccess() throws java.io.IOException
Description copied from interface:PDContentStreamReturns this stream's content, if any.- Specified by:
getContentsForRandomAccessin interfacePDContentStream- Returns:
- A RandomAccessRead or null.
- Throws:
java.io.IOException- If the content could not be read
-
getResources
public PDResources getResources()
Description copied from interface:PDContentStreamReturns this stream's resources, if any.- Specified by:
getResourcesin interfacePDContentStream- Returns:
- the resources of the content stream or null
-
getBBox
public PDRectangle getBBox()
Description copied from interface:PDContentStreamReturns the bounding box of the contents.- Specified by:
getBBoxin interfacePDContentStream- Returns:
- the bounding box of the content stream or null
-
getGlyphBBox
public PDRectangle getGlyphBBox() throws java.io.IOException
Calculate the bounding box of this glyph. This will work only if the first operator in the stream is d1.- Returns:
- the bounding box of this glyph, or null if the first operator is not d1.
- Throws:
java.io.IOException- If an io error occurs while parsing the stream.
-
getMatrix
public Matrix getMatrix()
Description copied from interface:PDContentStreamReturns the matrix which transforms from the stream's space to user space.- Specified by:
getMatrixin interfacePDContentStream- Returns:
- the matrix of the content stream or the identity matrix if there isn't any
-
getWidth
public float getWidth() throws java.io.IOExceptionGet the width from a type3 charproc stream.- Returns:
- the glyph width.
- Throws:
java.io.IOException- if the stream could not be read, or did not have d0 or d1 as first operator, or if their first argument was not a number.
-
-