Aspose Demos > Java Components > Aspose.Metafiles for Java > Java > Convert Metafile to PNG
  1. Click the Start Demo button.
  2. Upload the wmf or emf image.
  3. After conversion, png image will be displayed below.
XHTML

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ice="http://www.icesoft.com/icefaces/component"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jstl/core"
      >

<ui:composition template="/WEB-INF/includes/templates/page-template.xhtml">
                        
    <ui:define name="pageTitle">
        Aspose.Metafiles Demo - Convert Metafile to PNG
    </ui:define>

    <ui:define name="page-content">
        <ui:decorate template="/WEB-INF/includes/templates/tabbed_container.xhtml">
            <ui:define name="example">

            <table width="100%" style="background-color: #EEEEEE">
                <tr>
                    <td>
                    <div align="left">
                    <ol>
                        <li>Click the Start Demo button.</li>
                        <li>Upload the wmf or emf image.</li>
                        <li>After conversion, png image will be displayed below.</li>
                    </ol>
                    </div>
                    </td>
                </tr>
                <tr>
                    <td align="right"><ice:commandButton value="Start Demo"
                        actionListener="#{converterBean.OpenUploadPanel}"></ice:commandButton>

                    <!--<ice:commandButton value="Clear Log"
                        actionListener="#{converterBean.ClearLog}"></ice:commandButton> <ice:outputText
                        style="color:Green; font-family:verdana; font-size:8pt"
                        value="#{converterBean.log}" />--></td>
                </tr>
                <tr>
                    <td><ice:outputText id="lastExp"
                        value="#{converterBean.lastException}"
                        style="color:Red; font-family:verdana; font-size:8pt" /></td>
                </tr>

            </table>

            <table width="100%">
                <tr>
                    <td align="center"><ice:outputText
                        value="Image shown in 500x300. Right click and Save Picture As... to see it in original dimensions."
                        style="font-family:verdana; font-size:8pt; color:RED"
                        rendered="#{converterBean.displayOutputImage}"></ice:outputText></td>
                </tr>
                <tr>
                    <td align="center"><ice:graphicImage width="500px"
                        height="300px" value="#{converterBean.imgBytes}"
                        rendered="#{converterBean.displayOutputImage}"></ice:graphicImage>
                    </td>
                </tr>
            </table>

            <table>
                <tr>
                    <td><!-- Modal Panel Popup --> <ice:panelPopup modal="true"
                        rendered="#{converterBean.visible}"
                        visible="#{converterBean.visible}"
                        style="background-color:#EEEEEE; width:510px" autoCentre="true"
                        autoPosition="true">


                        <f:facet name="body">
                            <ice:panelGroup>
                                <table>
                                    <tr>
                                        <td>
                                        <table width="100%" style="background-color: #005599;">

                                            <tr>
                                                <td align="right"><ice:commandButton
                                                    actionListener="#{converterBean.CloseUploadPanel}"
                                                    type="submit" value="X"></ice:commandButton></td>
                                            </tr>
                                        </table>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        <table>
                                            <tr>
                                                <td align="left"><ice:outputText
                                                    value="Please wait, once you clicked upload button."
                                                    style="font-family:verdana; font-size:8pt; color:RED"></ice:outputText>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="left"><ice:inputFile id="fileInput"
                                                    progressListener="#{converterBean.progressFileUpload}"
                                                    actionListener="#{converterBean.actionFileUpload}"
                                                    fileNamePattern="(.+\.(e|E)(m|M)(f|F))|(.+\.(w|W)(m|M)(f|F))"
                                                    style="width:500px"></ice:inputFile></td>
                                            </tr>
                                            <tr>
                                                <td align="center"><ice:outputProgress
                                                    value="#{converterBean.percent}"
                                                    style="font-family: verdana; font-size:8pt; background-color:#00FFFF" /></td>
                                            </tr>
                                            <tr>
                                                <td align="left"><ice:selectOneRadio id="SlctFormat"
                                                    value="#{converterBean.selectedFormat}"
                                                    partialSubmit="true"
                                                    style="font-family:verdana; font-size:8pt;">
                                                    <f:selectItems id="SlctFormats"
                                                        value="#{converterBean.imageFormats}" />
                                                </ice:selectOneRadio></td>
                                            </tr>
                                            <tr>
                                                <td align="left"><ice:messages
                                                    style="font-family:verdana; font-size:8pt;"></ice:messages></td>
                                            </tr>
                                        </table>
                                        </td>
                                    </tr>
                                </table>

                            </ice:panelGroup>
                        </f:facet>
                    </ice:panelPopup></td>
                </tr>
            </table>

            </ui:define>
        </ui:decorate>
    </ui:define>
  </ui:composition>
</html>