Class MetaDo

java.lang.Object
com.itextpdf.kernel.pdf.canvas.wmf.MetaDo

public class MetaDo extends Object
A class to process WMF files. Used internally by WmfImageHelper.
  • Field Details

  • Constructor Details

    • MetaDo

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

    • readAll

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

      public void outputText (int x, int y, int flag, int x1, int y1, int x2, int y2, String text) throws 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:
      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.
    • wrapBMP

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

      public static void writeWord (OutputStream os, int v) throws 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:
      IOException - an IOException
    • writeDWord

      public static void writeDWord (OutputStream os, int v) throws 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:
      IOException - an IOException