Please take a look at this code snippet written in Java:
import com.aspose.diagram.Diagram;
import com.aspose.diagram.SaveFileFormat;
import org.apache.commons.io.FileUtils;
import java.io.ByteArrayOutputStream;
import java.io.File;
public static void main(String[] args)
{
String visioPath = "Microsoft_Visio_Drawing.vsdx";
String emfPath = "Microsoft_Visio_Drawing.emf";
try(ByteArrayOutputStream baos = new ByteArrayOutputStream())
{
Diagram diagram = new Diagram(visioPath);
diagram.save(baos, SaveFileFormat.EMF);
FileUtils.writeByteArrayToFile(new File(emfPath), baos.toByteArray());
}
catch (Exception e)
{
e.printStackTrace();
}
}
The code converts following VSDX file: Microsoft_Visio_Drawing.zip (333.5 KB)
There is some missing content in the EMF target file: Microsoft_Visio_Drawing-emf.zip (223.2 KB)
Expected:
expected.png (97.6 KB)
Actual:
actual.png (24.5 KB)