Save PDF as Docx with Bidi text (Hebrew or Arabic) miss the right font size.
Here my code (and below the code of Aspose.Words to fix the issue):
using (Document pdfFile = new Document(Path.Combine(SampleFiles, “OrgSampleFontSize.pdf”)))
{
pdfFile.Save(Path.Combine(SampleFiles, “SampleFontSize.doc”), new DocSaveOptions()
{
Format = DocSaveOptions.DocFormat.Doc
})
pdfFile.Save(Path.Combine(SampleFiles, “SampleFontSize.docx”), new DocSaveOptions()
{
Format = DocSaveOptions.DocFormat.DocX
})
}
Here my fix:
{
Document d = new Document(Path.Combine(SampleFiles, “SampleFontSize.docx”));
var runs = d.GetChildNodes(NodeType.Run, true);
foreach (Run r in runs)
{
r.Font.SizeBi = r.Font.Size;
}
d.Save(Path.Combine(SampleFiles, “FIXBiFontSize.docx”));
}
PdfBiFontSize.zip (3.4 MB)