class ImgWMF extends Image {

    // Constructors

    ImgWMF(Image image) {
        super(image);
    }

    /**
     * Constructs an <CODE>ImgWMF</CODE>-object, using an <VAR>url</VAR>.
     *
     * @param url the <CODE>URL</CODE> where the image can be found
     * @throws BadElementException on error
     * @throws IOException         on error
     */

    public ImgWMF(URL url) throws BadElementException, IOException {
        super(url);
        processParameters();
    }

    /**
     * Constructs an <CODE>ImgWMF</CODE>-object, using a <VAR>filename</VAR>.
     *
     * @param filename a <CODE>String</CODE>-representation of the file that contains the image.
     * @throws BadElementException   on error
     * @throws MalformedURLException on error
     * @throws IOException           on error
     */

    public ImgWMF(String filename) throws BadElementException, IOException {
        this(Utilities.toURL(filename));
    }

    /**
     * Constructs an <CODE>ImgWMF</CODE>-object from memory.
     *
     * @param img the memory image
     * @throws BadElementException on error
     * @throws IOException         on error
     */

    public ImgWMF(byte[] img) throws BadElementException, IOException {
        super((URL) null);
        rawData = img;
        originalData = img;
        processParameters();
    }

    /**
     * This method checks if the image is a valid WMF and processes some parameters.
     *
     * @throws BadElementException
     * @throws IOException
     */

    private void processParameters() throws BadElementException, IOException {
        type = IMGTEMPLATE;
        originalType = ORIGINAL_WMF;
        InputStream is = null;
        try {
            String errorID;
            if (rawData == null) {
                is = url.openStream();
                errorID = url.toString();
            } else {
                is = new java.io.ByteArrayInputStream(rawData);
                errorID = "Byte array";
            }
            InputMeta in = new InputMeta(is);
            if (in.readInt() != 0x9AC6CDD7) {
                throw new BadElementException(
                        MessageLocalization.getComposedMessage("1.is.not.a.valid.placeable.windows.metafile", errorID));
            }
            in.readWord();
            int left = in.readShort();
            int top = in.readShort();
            int right = in.readShort();
            int bottom = in.readShort();
            int inch = in.readWord();
            dpiX = 72;
            dpiY = 72;
            scaledHeight = (float) (bottom - top) / inch * 72f;
            setTop(scaledHeight);
            scaledWidth = (float) (right - left) / inch * 72f;
            setRight(scaledWidth);
        } finally {
            if (is != null) {
                is.close();
            }
            plainWidth = getWidth();
            plainHeight = getHeight();
        }
    }

    /**
     * Reads the WMF into a template.
     *
     * @param template the template to read to
     * @throws IOException       on error
     * @throws DocumentException on error
     */
    public void readWMF(PdfTemplate template) throws IOException, DocumentException {<FILL_FUNCTION_BODY>}
}

        setTemplateData(template);
        template.setWidth(getWidth());
        template.setHeight(getHeight());
        InputStream is = null;
        try {
            if (rawData == null) {
                is = url.openStream();
            } else {
                is = new java.io.ByteArrayInputStream(rawData);
            }
            MetaDo meta = new MetaDo(is, template);
            meta.readAll();
        } finally {
            if (is != null) {
                is.close();
            }
        }
    
<methods>public void <init>(java.net.URL) ,public float getAbsoluteX() ,public float getAbsoluteY() ,public com.lowagie.text.pdf.PdfDictionary getAdditional() ,public int getAlignment() ,public java.lang.String getAlt() ,public com.lowagie.text.Annotation getAnnotation() ,public int getBpc() ,public int getColorspace() ,public int getCompressionLevel() ,public com.lowagie.text.pdf.PdfIndirectReference getDirectReference() ,public int getDpiX() ,public int getDpiY() ,public java.awt.color.ICC_Profile getICCProfile() ,public com.lowagie.text.Image getImageMask() ,public float getImageRotation() ,public float getIndentationLeft() ,public float getIndentationRight() ,public float getInitialRotation() ,public static com.lowagie.text.Image getInstance(java.net.URL) throws com.lowagie.text.BadElementException, java.io.IOException,public static com.lowagie.text.Image getInstance(java.lang.String) throws com.lowagie.text.BadElementException, java.io.IOException,public static com.lowagie.text.Image getInstance(byte[]) throws com.lowagie.text.BadElementException, java.io.IOException,public static com.lowagie.text.Image getInstance(int, int, int, int, byte[]) throws com.lowagie.text.BadElementException,public static com.lowagie.text.Image getInstance(int, int, byte[], byte[]) ,public static com.lowagie.text.Image getInstance(int, int, boolean, int, int, byte[]) throws com.lowagie.text.BadElementException,public static com.lowagie.text.Image getInstance(int, int, boolean, int, int, byte[], int[]) throws com.lowagie.text.BadElementException,public static com.lowagie.text.Image getInstance(int, int, int, int, byte[], int[]) throws com.lowagie.text.BadElementException,public static com.lowagie.text.Image getInstance(com.lowagie.text.pdf.PdfTemplate) throws com.lowagie.text.BadElementException,public static com.lowagie.text.Image getInstance(java.awt.Image, java.awt.Color, boolean) throws com.lowagie.text.BadElementException, java.io.IOException,public static com.lowagie.text.Image getInstance(java.awt.Image, java.awt.Color) throws com.lowagie.text.BadElementException, java.io.IOException,public static com.lowagie.text.Image getInstance(com.lowagie.text.pdf.PdfWriter, java.awt.Image, float) throws com.lowagie.text.BadElementException, java.io.IOException,public static com.lowagie.text.Image getInstance(com.lowagie.text.pdf.PdfContentByte, java.awt.Image, float) throws com.lowagie.text.BadElementException, java.io.IOException,public static com.lowagie.text.Image getInstance(com.lowagie.text.pdf.PRIndirectReference) throws com.lowagie.text.BadElementException,public static com.lowagie.text.Image getInstance(com.lowagie.text.Image) ,public static com.lowagie.text.Image getInstanceFromClasspath(java.lang.String) throws com.lowagie.text.BadElementException, java.io.IOException,public com.lowagie.text.pdf.PdfOCG getLayer() ,public java.lang.Long getMySerialId() ,public byte[] getOriginalData() ,public int getOriginalType() ,public float getPlainHeight() ,public float getPlainWidth() ,public byte[] getRawData() ,public float getScaledHeight() ,public float getScaledWidth() ,public float getSpacingAfter() ,public float getSpacingBefore() ,public com.lowagie.text.pdf.PdfTemplate getTemplateData() ,public int[] getTransparency() ,public java.net.URL getUrl() ,public float getWidthPercentage() ,public float getXYRatio() ,public boolean hasAbsoluteX() ,public boolean hasAbsoluteY() ,public boolean hasICCProfile() ,public boolean isDeflated() ,public boolean isImgRaw() ,public boolean isImgTemplate() ,public boolean isInterpolation() ,public boolean isInverted() ,public boolean isJpeg() ,public boolean isMask() ,public boolean isMaskCandidate() ,public boolean isNestable() ,public boolean isSmask() ,public void makeMask() throws com.lowagie.text.DocumentException,public float[] matrix() ,public void scaleAbsolute(float, float) ,public void scaleAbsoluteHeight(float) ,public void scaleAbsoluteWidth(float) ,public void scalePercent(float) ,public void scalePercent(float, float) ,public void scaleToFit(float, float) ,public void setAbsolutePosition(float, float) ,public void setAdditional(com.lowagie.text.pdf.PdfDictionary) ,public void setAlignment(int) ,public void setAlt(java.lang.String) ,public void setAnnotation(com.lowagie.text.Annotation) ,public void setCompressionLevel(int) ,public void setDeflated(boolean) ,public void setDirectReference(com.lowagie.text.pdf.PdfIndirectReference) ,public void setDpi(int, int) ,public void setImageMask(com.lowagie.text.Image) throws com.lowagie.text.DocumentException,public void setIndentationLeft(float) ,public void setIndentationRight(float) ,public void setInitialRotation(float) ,public void setInterpolation(boolean) ,public void setInverted(boolean) ,public void setLayer(com.lowagie.text.pdf.PdfOCG) ,public void setOriginalData(byte[]) ,public void setOriginalType(int) ,public void setRotation(float) ,public void setRotationDegrees(float) ,public void setSmask(boolean) ,public void setSpacingAfter(float) ,public void setSpacingBefore(float) ,public void setTemplateData(com.lowagie.text.pdf.PdfTemplate) ,public void setTransparency(int[]) ,public void setUrl(java.net.URL) ,public void setWidthPercentage(float) ,public void setXYRatio(float) ,public void simplifyColorspace() ,public void tagICC(java.awt.color.ICC_Profile) ,public int type() <variables>public static final int AX,public static final int AY,public static final int BX,public static final int BY,public static final int CX,public static final int CY,public static final int DEFAULT,public static final int DX,public static final int DY,public static final int LEFT,public static final int MIDDLE,public static final int ORIGINAL_BMP,public static final int ORIGINAL_GIF,public static final int ORIGINAL_JBIG2,public static final int ORIGINAL_JPEG,public static final int ORIGINAL_JPEG2000,public static final int ORIGINAL_NONE,public static final int ORIGINAL_PNG,public static final int ORIGINAL_PS,public static final int ORIGINAL_TIFF,public static final int ORIGINAL_WMF,public static final int[] PNGID,public static final int RIGHT,public static final int TEXTWRAP,public static final int UNDERLYING,private float XYRatio,protected float absoluteX,protected float absoluteY,private com.lowagie.text.pdf.PdfDictionary additional,protected int alignment,protected java.lang.String alt,protected com.lowagie.text.Annotation annotation,protected int bpc,protected int colorspace,protected int compressionLevel,protected boolean deflated,private com.lowagie.text.pdf.PdfIndirectReference directReference,protected int dpiX,protected int dpiY,protected com.lowagie.text.Image imageMask,protected float indentationLeft,protected float indentationRight,private float initialRotation,protected boolean interpolation,protected boolean invert,protected com.lowagie.text.pdf.PdfOCG layer,protected boolean mask,protected java.lang.Long mySerialId,protected byte[] originalData,protected int originalType,protected float plainHeight,protected float plainWidth,protected java.awt.color.ICC_Profile profile,protected byte[] rawData,protected float rotationRadians,protected float scaledHeight,protected float scaledWidth,static long serialId,private boolean smask,protected float spacingAfter,protected float spacingBefore,protected com.lowagie.text.pdf.PdfTemplate[] template,protected int[] transparency,protected int type,protected java.net.URL url,private float widthPercentage