Hi team,
using aspose.Words .net 4.7
I am converting word file into html, which is not in proper format but it is similar to web layout option in MS Word Office, So, we cant expect better html then this option thats fine.
but issue is when I am regenerating Docx file back from same html file, I am getting distorted docx file, I expect to get same regenrated docx file like original one.
This is the code sample I am using for docx to html conversion.
Aspose.Words.Saving.HtmlSaveOptions options = new Aspose.Words.Saving.HtmlSaveOptions();
options.Encoding = System.Text.Encoding.UTF8;
options.AllowNegativeIndent = true;
options.ExportImagesAsBase64 = true;
options.ExportFontResources = true;
options.ExportFontsAsBase64 = true;
options.ExportTocPageNumbers = true;
options.ExportOriginalUrlForLinkedImages = true;
options.ExportPageSetup = true;
options.ExportLanguageInformation = true;
options.ExportRelativeFontSize = true;
options.ExportTextBoxAsSvg = true;
options.ExportHeadersFootersMode = Aspose.Words.Saving.ExportHeadersFootersMode.PerSection;
//options.ExportPageMargins = true;
and this is sample code I am using to reconvert html file back to docx.
Document doc = new Document(filepath);
doc.Save(docxfile,SaveFormat.Docx);
Please find attached files for your reference(includes original file , html file, regenerated file from html)
there is vast difference in regenerated and original file
Documents.zip (1005.6 KB)
can you suggest me If i need some improvement in code part…or is there any possible way to improve this.