I am using the below code for importing and exporting word document to html and html back to word document.
I am facing the following issues:
a) The author details for all inserts and deletes become unknown (check OverviewafterExport.docx attachment).
b) The comments are exported to docx but the footnote position is changed (please compare document overview.docx and OverviewAfterExport.docx for comments and footnote.)
- Import word document to html code
Aspose.Words.Document doc = new Aspose.Words.Document(fUpload.PostedFile.InputStream);
MemoryStream dstStream = new MemoryStream();
doc.Save(dstStream, SaveFormat.Html);
dstStream.Position = 0;
var sr = new StreamReader(dstStream);
var myStr = sr.ReadToEnd();
- Pass the html generated back to aspose to convert to word document
Document doc = new Document();
Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder(doc);
builder.InsertHtml(myStr);
// Send the document in Word format to the client browser with an option to save to disk.
OoxmlSaveOptions oso = new OoxmlSaveOptions();
oso.SaveFormat = SaveFormat.Docx;
doc.Save(Response, "exportusingaspose.docx", ContentDisposition.Attachment, oso);
Response.End();
Thanks,
Suraj