Class PreflightType3Stream


  • public class PreflightType3Stream
    extends PreflightStreamEngine
    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.
    • Method Detail

      • showType3Character

        public void showType3Character​(PDType3CharProc charProc)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • createImage

        public java.awt.Image createImage()
                                   throws java.io.IOException
        This will parse a type3 stream and create an image from it.
        Returns:
        The image that was created.
        Throws:
        java.io.IOException - If there is an error processing the stream.
      • processOperator

        protected void processOperator​(Operator operator,
                                       java.util.List<COSBase> operands)
                                throws java.io.IOException
        This is used to handle an operation.
        Overrides:
        processOperator in class PDFStreamEngine
        Parameters:
        operator - The operation to perform.
        operands - The list of arguments.
        Throws:
        java.io.IOException - If there is an error processing the operation.
      • checkType3FirstOperator

        private void checkType3FirstOperator​(java.util.List<COSBase> arguments)
                                      throws java.io.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.
        Parameters:
        arguments -
        Throws:
        java.io.IOException
      • getWidth

        public float getWidth()
        Returns:
        the width of the CharProc glyph description