Words not rendering italicized Arabic text to PDF when imported from HTML document

We are importing a full HTML document into Words and generating Doc and PDF files with it. When creating documents that have been set to RTL, containing Arabic text, all Arabic text that has been italicized via tags appears as empty boxes in the PDF output, but appear as they should in the Word Doc.


Is there any way around this?

Pay no mind to this. It turns out that the font must be something other than what we’re using at present (Arial). Changing this to a more appropriate font (Arial Unicode MS, etc.) fixes this issue.

Hi Sean,

Thanks for your inquiry. It is nice to hear from you that your issue has been solved.

Please
note that Aspose.Words requires TrueType fonts when rendering documents
to fixed-page formats (PDF, XPS or SWF). Make sure you have all the
Fonts installed on your machine you’re using to convert Word document to
PDF format. I would suggest you please read the following article:
http://www.aspose.com/docs/display/wordsnet/How+Aspose.Words+Uses+True+Type+Fonts

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

More to the point - Arial itself uses a different outline for its italic variation, which simply does not include the Arabic characters. Thus, when pushed through Aspose.Words, the infamous “missing character” blocks appear where the italicized Arabic characters should otherwise appear.

Hi Sean,

Thanks for your feedback. I like to share with you that you can implement IWarningCallback
interface if you want to have your own custom method called to capture
loss of fidelity warnings that can occur during document loading or
saving. Please check the following code example for your kind reference.


public class HandleDocumentWarnings
: IWarningCallback

{

///

/// Our callback only needs to implement the "Warning" method. This method is called whenever there is a

/// potential issue during document processing. The callback can be set to listen for warnings generated during document

/// load and/or document save.

///

public void Warning(WarningInfo info)

{

// We are only interested in fonts being substituted.

if (info.WarningType == WarningType.FontSubstitution)

{

Console.WriteLine("Font substitution: " + info.Description);

}

}

}

Document doc = new Document(MyDir + "in.docx");

PdfSaveOptions options = new PdfSaveOptions();

options.WarningCallback = new HandleDocumentWarnings ();

doc.Save(MyDir + "Out.pdf", options);


Thank you, Tahir! This may certainly come in handy down the line.