Class MetaDo


  • public class MetaDo
    extends java.lang.Object
    A class to process WMF files. Used internally by WmfImageHelper.
    • Constructor Detail

      • MetaDo

        public MetaDo​(java.io.InputStream in,
                      PdfCanvas cb)
        Creates a MetaDo instance.
        Parameters:
        in - inputstream containing the data
        cb - PdfCanvas
    • Method Detail

      • readAll

        public void readAll()
                     throws java.io.IOException
        Reads and processes all the data of the InputMeta.
        Throws:
        java.io.IOException - an IOException
      • outputText

        public void outputText​(int x,
                               int y,
                               int flag,
                               int x1,
                               int y1,
                               int x2,
                               int y2,
                               java.lang.String text)
                        throws java.io.IOException
        Output Text at a certain x and y coordinate. Clipped or opaque text isn't supported as of yet.
        Parameters:
        x - x-coordinate
        y - y-coordinate
        flag - flag indicating clipped or opaque
        x1 - x1-coordinate of the rectangle if clipped or opaque
        y1 - y1-coordinate of the rectangle if clipped or opaque
        x2 - x2-coordinate of the rectangle if clipped or opaque
        y2 - y1-coordinate of the rectangle if clipped or opaque
        text - text to output
        Throws:
        java.io.IOException - an IOException
      • isNullStrokeFill

        public boolean isNullStrokeFill​(boolean isRectangle)
        Return true if the pen style is null and if it isn't a brush.
        Parameters:
        isRectangle - value to decide how to change the state. If true state.setLineJoinRectangle(cb) is called, if false state.setLineJoinPolygon(cb) is called.
        Returns:
        true if the pen style is null and if it isn't a brush
      • strokeAndFill

        public void strokeAndFill()
        Stroke and fill the MetaPen and MetaBrush paths.
      • getArc

        static float getArc​(float xCenter,
                            float yCenter,
                            float xDot,
                            float yDot)
      • wrapBMP

        public static byte[] wrapBMP​(ImageData image)
                              throws java.io.IOException
        Wrap a BMP image in an WMF.
        Parameters:
        image - the BMP image to be wrapped
        Returns:
        the wrapped BMP
        Throws:
        java.io.IOException - an IOException
      • writeWord

        public static void writeWord​(java.io.OutputStream os,
                                     int v)
                              throws java.io.IOException
        Writes the specified value to the specified outputstream as a word.
        Parameters:
        os - outputstream to write the word to
        v - value to be written
        Throws:
        java.io.IOException - an IOException
      • writeDWord

        public static void writeDWord​(java.io.OutputStream os,
                                      int v)
                               throws java.io.IOException
        Writes the specified value to the specified outputstream as a dword.
        Parameters:
        os - outputstream to write the dword to
        v - value to be written
        Throws:
        java.io.IOException - an IOException