Hi,
I am evaluating the product in order to buy it.
I am building a multi-language application so I am testing unicode and Hebrew.
1)
Well, I have a few problems with long text which spans on more than one line.
If I use a short text for one line, it’s OK
Please see this code:
private void longHebrewText(Section section, string title, string text)
{
Text hebrewText = new Aspose.Pdf.Text(section, title);
hebrewText.TextInfo.IsRightToLeft = true;
hebrewText.TextInfo.IsUnicode = true;
hebrewText.TextInfo.Alignment = AlignmentType.Left;
hebrewText.TextInfo.FontSize = 15;
hebrewText.TextInfo.IsUnderline = true;
section.Paragraphs.Add(hebrewText);
hebrewText = new Text();
Segment segment = hebrewText.Segments.Add(text);
segment.TextInfo.IsRightToLeft = true;
segment.TextInfo.IsUnicode = true;
segment.TextInfo.FontName = “Times New Roman”;
//segment.TextInfo.FontName = “Arial”;
hebrewText.TextInfo.Alignment = AlignmentType.Right;
//hebrewText.IsHtmlTagSupported = true;
section.Paragraphs.Add(hebrewText);
/*
hebrewText = new Aspose.Pdf.Text(section, text);
hebrewText.TextInfo.IsRightToLeft = true;
hebrewText.TextInfo.IsUnicode = true;
hebrewText.TextInfo.Alignment = AlignmentType.Left;
section.Paragraphs.Add(hebrewText);
*/
}
THIS IS THE CALLING CODE
private void btnSample1_Click(object sender, EventArgs e)
{
setLabelSemaple1(“In progress…”);
DateTime start = DateTime.Now;
Pdf pdf = new Pdf();
pdf.IsTruetypeFontMapCached = true;
pdf.TruetypeFontMapPath = “.”;
Section section = pdf.Sections.Add();
addImage(“1B.jpg”, section, “כותרת לתמונה שמופיעה”, ImageFileType.Jpeg);
hebrewText(section);
longHebrewText(section, “מלל ארוך בעברית מיושר לימין”, @“זאת ועוד, שליחים בישראל, ירדן, סוריה, מצרים וסעודיה נתבקשו לאסוף מידע ביומטרי על דמויות מפתח של הרשות הפלסטינית ומנהיגי ונציגי חמאס בעזה ובגדה המערבית, ונדרשו גם למצוא הוכחות לקשר בין כוחות הביטחון של הרשות הפלסטינית לארגוני טרור. צו נוסף שנשלח לירושלים, קהיר, עמאן, דמשק וריאד הורה לאסוף תכנית נסיעה מדויקות ומידע על כלי רכב בהם משתמשים חברים בולטים בחמאס וברשות הפלסטינית. לצו שנשלח לא צורפו הסברים.”);
addImage(“3D.jpg”, section, “title in english”, ImageFileType.Jpeg);
addImage(“shap2-B.png”, section, “test for png”, ImageFileType.Png);
addImage(“shape1-e.png”, section, “4th image”, ImageFileType.Png);
if (!Directory.Exists(CurrentOutput))
Directory.CreateDirectory(CurrentOutput);
pdf.IsRtlInSegmentMode = true;
pdf.SetUnicode();
pdf.Save(CurrentOutput + “sample1.pdf”);
setLabelSemaple1(“Done in " + (DateTime.Now - start).TotalSeconds + " seconds”);
}
If I use HTML inside the text parameter I get the Hebrew in LEFT align and the order of the letters inside the words in the wrong direction (please see image attachment called 1).
If I don’t use HTML in the long text I get the lines mixed up!!! Meaning the 1st line shows up the last in the paragraph and the last line appears as the 1st!!!
Very strange behavior indeed.
2)
Image title in Hebrew does not show the Hebrew nor throws and error.
PLEASE HELP ME ASAP AS I NEED TO DECIDE WHICH PDF PRODUCT TO USE AND I LIKE YOURS…
Jacob