We trying to transforms .docm file into pdf. Source document has macro enabled. In output pdf macros are not coming whereas in office rendition it is showing
We have used following code :
String fileName = "C:\\Docs\\9745\\DM00780156.docm";
com.aspose.words.Document document = new com.aspose.words.Document(fileName);
document.save("C:\\Docs\\9742\\DMRS-02321-LLB.pdf");
I am attaching input as well as output files of office and aspose. 9745.zip (431.9 KB)
@rnara Content of the document is updated by a macro. Aspose.Words does not run macros, so content is not updated.
Here is PDF document produced by MS Word with disabled macros: ms.pdf (103.5 KB)
It looks exactly the same as PDF produced by Aspose.Words.
Unfortunately, we do not have plans to add feature to run macros in Aspose.Words.
@rnara We do not provide support for the older version of the Aspose.Words. The current Aspose.Words version produces correct output which matches the MS Word output with disabled macros. Sorry for the inconvenience.
@rnara As far as I know there was no macros execution support in Aspose.Words 17.6 either. Please check attached output test.aw176.pdf (89.7 KB). Could you please share the code you use to convert document with Aspose.Words 17.6 to get your output?
Hi @Konstantin.Kornilov, sharing the below code to convert document with Aspose.Words 17.6-
com.aspose.words.Document doc = new com.aspose.words.Document("C:\\docs\\DM00780156.docm");
com.aspose.words.SaveOptions so = new com.aspose.words.PdfSaveOptions();
doc.save("C:\\docs\\DM00780156.pdf", so);
@rnara As I have mentioned content of the document is updated by a macro. Aspose.Words does not run macros, so content is not updated. The behavior is the same in 17.6 and 23.9 versions of Aspose.Words. I have rechecked once again using 17.6 version and the output is the same as Konstantin shared earlier. out_17.6.pdf (89.6 KB) out_23.9.pdf (90.4 KB)