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

Free Support Forum - aspose.com

Hebrew in DataTable display left to right instead right to left


We use your first demo code for .Net PDF - Alphabetical List of Products.

In the DataTable we put hebrew text. The problem is that the hebrew text is displayed in wrong way: the letters are displayed from the end of the word to the beggining of the word.

Asample code is attached.

Please, advice.

protected void Button1_Click(object sender, EventArgs e)


DataTable dt = CreateDataTable();

Pdf pdf = new Pdf();

string xmlFileName = Server.MapPath("~/XML/schema.xml");

string resultFileName = Server.MapPath("~/XML/result.pdf");

pdf.BindXML(xmlFileName, null);

pdf.IsRightToLeft = true;

pdf.IsRtlInSegmentMode = true;

pdf.IsTruetypeFontMapCached = true;

pdf.TruetypeFontMapPath = Path.GetTempPath();

Section section = pdf.Sections["section1"];

Text dateText = (Text)section.Paragraphs["DateText"];

Segment dateSeg = dateText.Segments["DateSec"];

DateTime dateTime = DateTime.Now;

dateSeg.Content = dateTime.ToString("d", DateTimeFormatInfo.InvariantInfo);

AddTable(pdf, section, dt);

pdf.Save("resultTable.pdf", SaveType.OpenInAcrobat, Response);



private DataTable CreateDataTable()


DataTable dt = new DataTable();

dt.Columns.Add("מספר", typeof(string));

dt.Columns.Add("שם החברה", typeof(string));

dt.Rows.Add("אחד", "גולן");

dt.Rows.Add("שניים", "דניאל");

return dt;


private void AddTable(Pdf pdf, Section sec, DataTable dt)


Aspose.Pdf.TextInfo textInfo = new Aspose.Pdf.TextInfo();

//textInfo.FontName = "Arial Unicode MS";

textInfo.IsRightToLeft = true;

textInfo.IsUnicode = true;

textInfo.Alignment = AlignmentType.Right;

Aspose.Pdf.Table newTable = new Aspose.Pdf.Table();

newTable.DefaultCellTextInfo = textInfo;


newTable.IsBroken = false;

newTable.DefaultCellTextInfo.FontSize = 9;

newTable.ColumnWidths = "50 200 250";

newTable.Border = new BorderInfo((int)(BorderSide.Top | BorderSide.Bottom), 1F);

Row row1 = newTable.Rows.Add();


newTable.ImportDataTable(dt, true, 1, 1);


Hello Tzali,

Thanks for using our products.

I have tested the scenario using Aspose.Pdf for .NET 5.1.0 and as per my observations, I am unable to notice any problem. As per my observations, the text in resultant PDF is being displayed as present in the source code. Please take a look over the attached PDF document that I have generated and in case I am missing something, please do let m know.

We apologize for your inconvenience.


Thanks for your testing. The attached PDF you have generated is perfect.

However, where I use the same code of the scenario i get the attached PDF which all the Hebrew letters are reversed . Attached the PDF I get after the running the website code (resultTable.pdf).

We are in the middle of a project and if this problem will be solved we will purchase Aspose PDF for .Net (after we have already purchased Aspose PDF.KIT for .Net)

I will appreciate if you can reply this massage quickly.



Hello Tzali,

Thanks for sharing further details.

In my earlier attempt, I used the same code snippet which you have shared in your first post. I tested the scenario using Aspose.Pdf for .NET 5.1.0. Can you please try using this version (which is available for download over this link) and in case you still encounter any problem, please share some details regarding your working environment i.e. OS, Regional Language settings, Application type etc

We are really sorry for this inconvenience.


We downloaded the Aspose.Pdf for .NET 5.1.0 dll (which looks to be the same as the origibal attached website). Still the problem occures.

My working environment:

OS: Windows7 Ultimate (64bit)

Regional Language settings: attached doc with screen shots

VS2010, Website (application) Type: ASP.Net Web Site -



Hello Tzali,

Thanks for sharing the information.

I have tested the scenario and I have observed that the problem is occurring when using Visual Studio 2010 over Windows 7 64bit. However, during my testing over Windows XP SP3 with Visual Studio 2005, the problem does not seem to be occurring. For the sake of correction, I have logged this problem as PDFNET-26084 in our issue tracking system. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

PS, In both the scenarios, I have applied the Regional Language settings as specified in word document that you have shared.

Hello Tzali,

Further investigations have revealed that even if we do not set the Regional and Language settings, the direction of text is reversed when PDF document is generated over Windows7 64bit while using Visual Studio 2010.

Hello Nayyer,

We continue to test and the direction of text is reversed when PDF document is generated over:

WindowsXP while using Visual Studio 2008

WindowsXP while using Visual Studio 2010

Windows7 64bit while using Visual Studio 2010

Windows7 64bit while using Visual Studio 2008

Windows7 32bit while using Visual Studio 2010

Windows7 32bit while using Visual Studio 2008

Winsows Server 2008 64bit

Do you have time estimatioon when this problem will be fixed ?

We need it to be fixed in order to purchase Aspose PDF .Net.



Hello Tzali,

Thanks for sharing the detailed information.

It will really help us while resolving this problem. Also we recently have been able to notice this problem and we require little time to figure out the actual reasons of this problem. So please spare us little time and be patient. Meanwhile, I have requested the development team for its ETA and as soon as we have some updates, we would be more than happy to share this information with you. We are sorry for this inconvenience.

The issues you have found earlier (filed as 26084) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.


I have a dataTable with 500 Row’s and 400 Column.
What are best code available to convert this data in to PDF.
If it can be done within 5 Sec that will be very helpfull for Me

Thanks & Regards
Gulam Ansari

Hello Gulam Ansari,

Thanks for your interest in our products.

Please visit the following link for required information Integrate Table with Database. In order to increase the performance of application and to reduce the document generation time, please try using the Direct-to-PDF save method. For more information, please visit Writing PDF directly

Please download the latest release version of Aspose.Pdf for .NET 6.2.0 and try using it. In case you encounter any issue or you have any further query, please feel free to contact.

Please don’t forget to visit How to Use New Documentation.