We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Print Arabic Rendering Problem

Hi
Thank you for your great library
I am using Mono to have c# in Ubuntu 14.04.
Using evaluation version of Aspose.words, I can create and manipulate words files very easy. But my problem is that when i render to print (Persian/Arabic). letters are not joined to create words.I tried the code under windows and it has no problem at all. but here under Ubuntu i have this annoying problem. I know that it is related to OS somehow but any help would be appreciated greatly.

Here is my code

// The path to the documents directory.
string dataDir = "./";
// Initialize a Document.
Document doc = new Document();
// Use a document builder to add content to the document.
DocumentBuilder builder = new DocumentBuilder(doc);
builder.ParagraphFormat.ClearFormatting();
builder.Font.LocaleIdBi = 1025;
builder.Font.NameBi = "Arial unicode MS";
builder.Font.SizeBi = 20;
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
builder.ParagraphFormat.Bidi = true;
builder.Font.Bidi = true;

builder.Writeln("سلام به شما"); // this is line i have problem

dataDir = dataDir + "out.docx";
doc.Save(dataDir);

PrintDialog printDlg = new PrintDialog();
printDlg.AllowSomePages = true;

printDlg.PrinterSettings.MinimumPage = 1;
printDlg.PrinterSettings.MaximumPage = doc.PageCount;
printDlg.PrinterSettings.FromPage = 1;
printDlg.PrinterSettings.ToPage = doc.PageCount;

if (!printDlg.ShowDialog().Equals(DialogResult.OK))
return;

AsposeWordsPrintDocument awPrintDoc = new AsposeWordsPrintDocument(doc);
awPrintDoc.PrinterSettings = printDlg.PrinterSettings;

ActivePrintPreviewDialog previewDlg = new ActivePrintPreviewDialog();

// Pass the Aspose.Words print document to the Print Preview dialog.
previewDlg.Document = awPrintDoc;
// Specify additional parameters of the Print Preview dialog.
previewDlg.ShowInTaskbar = false;
previewDlg.MinimizeBox = true;
previewDlg.PrintPreviewControl.Zoom = 1;
previewDlg.Document.DocumentName = "doc.doc";
previewDlg.WindowState = FormWindowState.Maximized;
// Show the appropriately configured Print Preview dialog.
previewDlg.ShowDialog();

Hi there,

Thanks for your inquiry.

We have tested the scenario using latest version of Aspose.Words for .NET 17.4 at Ubuntu and have not found the shared issue. Please use Aspose.Words for .NET 17.4.

Please note that Aspose.Words requires TrueType fonts when rendering document to fixed-page formats or printing it. You need to install fonts that are used in your document on the machine where you're printing document. Please refer to the following articles:

How Aspose.Words Uses True Type Fonts