Hai,
I tried converting a pdf document
to docx format, and it came out well. I got odf successfully converted to docx without any alignmnt or font issue,
But when I try to convert again this docx file to html, I am getting font issue, some text are not displaying properly.Some texts are found to be overlapped with each other.
I am getting this issue.PNG (6.9 KB)
and the document is Business problems and Solutions (1).docx (1.5 MB)
code used to convert pdf to docx
DocSaveOptions saveOption = new DocSaveOptions();
saveOption.Mode = DocSaveOptions.RecognitionMode.Textbox;
saveOption.Format = DocSaveOptions.DocFormat.DocX;
saveOption.RecognizeBullets = true;
saveOption.RelativeHorizontalProximity = 2.5f;
//this line resolves font issue
saveOption.AddReturnToLineEnd = false;
saveOption.MaxDistanceBetweenTextLines = 2.5f;
saveOption.CloseResponse = true;
saveOption.ExtractOcrSublayerOnly = true;
saveOption.TryMergeAdjacentSameBackgroundImages = false;
Aspose.Pdf.Document pdfDocument = new Document(destFileName);
//pdfDocument.UpdateTableLayout();
// Save the file into MS document format
pdfDocument.Save(Path.Combine(path, "pdfToWord", fileName + ".docx"), saveOption);
code used to convert docx to html
HtmlFixedSaveOptions htmlFixedSaveOptions = new HtmlFixedSaveOptions();
htmlFixedSaveOptions.ExportEmbeddedCss = true;
htmlFixedSaveOptions.ExportEmbeddedFonts = true;
htmlFixedSaveOptions.ExportEmbeddedImages = true;
htmlFixedSaveOptions.ExportEmbeddedSvg = true;
htmlFixedSaveOptions.ExportFormFields = true;
htmlFixedSaveOptions.ExportGeneratorName = true;
string cssprefix = "aspose_doc" + page;
htmlFixedSaveOptions.CssClassNamesPrefix = cssprefix;
htmlFixedSaveOptions.AllowEmbeddingPostScriptFonts = true;
//htmlFixedSaveOptions.UseTargetMachineFonts = true;
htmlFixedSaveOptions.SaveFormat = Aspose.Words.SaveFormat.HtmlFixed;
htmlFixedSaveOptions.PrettyFormat = true;
htmlFixedSaveOptions.PageHorizontalAlignment =
HtmlFixedPageHorizontalAlignment.Center;
htmlFixedSaveOptions.OptimizeOutput = true;
Document doc = new Document(docxFile);
doc.Save(path, htmlFixedSaveOptions);