FreeHEP library is able to read EMF files and generate SVG files:
// read the EMF file
EMFRenderer emfRenderer = new EMFRenderer(
new EMFInputStream(
emf,
new ExtendedEMFTagSet(EMFInputStream.DEFAULT_VERSION)));
EMFPanel emfPanel = new EMFPanel();
emfPanel.setRenderer(emfRenderer);
// create SVG properties
Properties p = new Properties();
p.put(SVGGraphics2D.EMBED_FONTS, Boolean.toString(false));
p.put(SVGGraphics2D.CLIP, Boolean.toString(false));
p.put(SVGGraphics2D.COMPRESS, Boolean.toString(false));
p.put(SVGGraphics2D.TEXT_AS_SHAPES, Boolean.toString(false));
p.put(SVGGraphics2D.STYLABLE, Boolean.toString(false));
// prepare Graphics2D
SVGGraphics2D graphics2D = new PatchedSVGGraphics2D(svg, emfPanel);
graphics2D.setCreator(getClass().getSimpleName());
graphics2D.setProperties(p);
graphics2D.setDeviceIndependent(true);
// export to SVG
graphics2D.startExport();
emfPanel.print(graphics2D);
graphics2D.endExport();
svg.flush();
https://repo1.maven.org/maven2/org/freehep/freehep-graphicsio-emf/2.4/freehep-graphicsio-emf-2.4.pom
https://github.com/freehep/freehep-vectorgraphics
Cheers,
Vlad
On Thu, Jan 29, 2015 at 5:34 PM, AlexandreKouznetsov <
[email protected]> wrote:
> I am developing a text analytic pipeline that processes on Power Point
> presentation files.
>
> On pre-processing phase I am using org.apache.poi to convert input pptx
> file
> into a set of image files (like one image file per slide).
>
> I found that some my input slides can include EMF format images. The EMF
> images are lost as I am using something like PPTX2SVG code example
> (
> http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PPTX2SVG.txt
> ).
>
> Therefore I shifted to usage of org.apache.batic and tried to do something
> like PPTX2SVG code example
>
> (
> https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xslf/usermodel/PPTX2SVG.txt
> )
>
>
> The problem is that this example is about WMF, not EMF. I tried to find
> EMF
> related batic libraries (have not found so far) while my homemade
> modifications of WMFImageRender to adjust it for EMF does not work.
>
> I am wondering if you would suggest any updates that can work with EMF?
>
>
>
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/ImageRender-for-EMF-convert-PPTX-slides-include-EMF-images-into-PNG-tp5717773.html
> Sent from the POI - Dev mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>