Hello, I have attached a few documents and will try to explain the requirements.
In the TestHTMLTemplateJS.7z file, there is a TestHTMLTemplateJS.htm file. This is the file that ultimately needs to be converted to a DOCX while executing Javascript.
asposeWordsDocx.docx was created using Aspose.Words with just a basic open and save as DocX. The resulting DOCX is the desired output, however, the javascript within the HTML file is not executed. The code used is the following
Dim asposeWords As New Words.Document("C:\InfoEdSVN\Internal\Alpha15\TestHTMLTemplateJS.htm")
asposeWords.Save("C:\InfoEdSVN\Internal\Alpha15\asposeWordsDocx.docx")
asposeHtmldocx.docx was created using Aspose.HTML. Using this, javascript is executed, and the output looks ok, but the main issue is that the text is basically split out into objects. Notably, the highlighted text as turned into essentially a yellow rectangle / word shape. This does not happen with Aspose.Words. It is a requirement for a clients to remove the text (and the corresponding highlighting) and input their own text. It is very difficult to do this with the objects that get created instead of just plain text. The code to generate this docx is the following:
Dim margin As New Html.Drawing.Margin(36, 45, 36, 45)
Dim docRenderingOptions As New Html.Rendering.Doc.DocRenderingOptions
docRenderingOptions.PageSetup.AnyPage = New Html.Drawing.Page(margin)
Using device As New Html.Rendering.Doc.DocDevice(docRenderingOptions, "C:\InfoEdSVN\Internal\Alpha15\AsposeHtmldocx.docx")
Using htmlrenderer As New Html.Rendering.HtmlRenderer
Using htmlDocument As New Html.HTMLDocument("C:\InfoEdSVN\Internal\Alpha15\TestHTMLTemplateJS.htm")
htmlrenderer.Render(device, htmlDocument)
End Using
End Using
End Using
Please let me know how I can achieve the desired results. Again, I need the javascript to be executed from the html file, but I want the output to be what I get from Aspose.Words (actual text instead of objects and shapes).
Let me know if you have questions about the requirements.
Thank you,
Brett
TestHTMLTemplateJS.7z (4.1 KB)
asposeWordsDocx.docx (25.8 KB)
AsposeHtmldocx.docx (68.5 KB)