How to use java to export file
I want to draw and export the file by manipulating com components in java, but I get an error when exporting. Example code and error are as follows:
code:
ActiveXComponent app = new ActiveXComponent("Illustrator.Application");
Dispatch.call(app, "open","D:\\pic\\ai\\init.ai").toDispatch();
Dispatch doc = Dispatch.get(app, "activeDocument").toDispatch();
Dispatch.call(doc, "exportFile", "D:\\test2.dwg",7);
error:
Exception in thread "main" com.jacob.com.ComFailException: Can't map name to dispid: exportFile
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:625)
at com.jacob.com.Dispatch.callN(Dispatch.java:453)
at com.jacob.com.Dispatch.call(Dispatch.java:541)
