|
@@ -14,10 +14,10 @@ import org.apache.xmlbeans.XmlObject;
|
|
|
import org.apache.xmlbeans.impl.values.TypeStore;
|
|
|
import org.apache.xmlbeans.impl.values.XmlAnyTypeImpl;
|
|
|
import org.apache.xmlbeans.impl.values.XmlComplexContentImpl;
|
|
|
-import org.freehep.graphicsio.emf.EMF2SVG;
|
|
|
-import org.freehep.graphicsio.emf.EMFConverter;
|
|
|
-import org.freehep.graphicsio.emf.EMFInputStream;
|
|
|
-import org.freehep.graphicsio.emf.EMFRenderer;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
import org.junit.Test;
|
|
|
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDrawing;
|
|
|
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
|
|
@@ -303,18 +303,18 @@ public class WordServiceTest {
|
|
|
|
|
|
@Test
|
|
|
public void testEmf() throws Exception{
|
|
|
- EMFInputStream inputStream = new EMFInputStream(new FileInputStream("image/bbb.emf"),
|
|
|
- EMFInputStream.DEFAULT_VERSION);
|
|
|
- System.out.println("height = " + inputStream.readHeader().getBounds().getHeight());
|
|
|
- System.out.println("width = " + inputStream.readHeader().getBounds().getWidth());
|
|
|
-
|
|
|
- EMFRenderer emfRenderer = new EMFRenderer(inputStream);
|
|
|
- final int width = (int)inputStream.readHeader().getBounds().getWidth();
|
|
|
- final int height = (int)inputStream.readHeader().getBounds().getHeight();
|
|
|
- System.out.println("width = " + width + " and height = " + height);
|
|
|
- final BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
|
|
|
- Graphics2D g2 = (Graphics2D)result.createGraphics();
|
|
|
- emfRenderer.paint(g2);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -324,7 +324,7 @@ public class WordServiceTest {
|
|
|
|
|
|
|
|
|
File outputfile = new File("D:\\result.png");
|
|
|
- ImageIO.write(result, "png", outputfile);
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -349,10 +349,10 @@ public class WordServiceTest {
|
|
|
|
|
|
@Test
|
|
|
public void emfTest2() throws Exception{
|
|
|
- EMFInputStream inputStream = new EMFInputStream(new FileInputStream("image/bbb.emf"),
|
|
|
- EMFInputStream.DEFAULT_VERSION);
|
|
|
- System.out.println("height = " + inputStream.readHeader().getBounds().getHeight());
|
|
|
- System.out.println("width = " + inputStream.readHeader().getBounds().getWidth());
|
|
|
- EMF2SVG.main(new String[]{"image/aaa.emf","D:\\result.svg"});
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|