Are there any good examples of right-to-left languages (Arabic, Hebrew, etc.) and how to use them in Aspose.PDF? I can find some examples online about usage for the old Generator namespace (Text Formatting inside PDF using C#|Aspose.PDF for .NET), but now that it’s not included in the product (I’m using Aspose.Pdf 17.8), none of the examples seem to apply, and I’m not finding anything that looks equivalent, specifically, the IsRightToLeft flag.
I don’t seem to be able to tell a TextFragment or a TextSegment about its language orientation. This results in PDF content that isn’t matching what I’ve put into a TextFragment. For example, if I enter into a TextFragment “10203 :מזהה”, what actually comes out on my PDF is flipped around, with the numerals on the right. Cutting and pasting the text out of the PDF is correct, but visually on the PDF itself it is incorrect.
The product description at On Premise, Cloud & App Based PDF File Format Solution | Aspose.PDF states that Arabic and Hebrew may be used, so I’m thinking that I’m simply not doing things correctly. Is there any documentation available on how to do this in Aspose.Pdf?
@bob.becker
Thanks for contacting support.
Currently you can set text direction of entire document by setting Document.Direction
property. However, we have logged an enhancement request as PDFNET-43251 in our issue tracking system, for the requirement of setting text direction at TextFragment
level. Product team will further investigate the feasibility of the enhancement and as soon as we have some updates in this regard, we will inform you. Please be patient and spare us little time.
We are sorry for this inconvenience.
Thanks for the response – is it true that this is functionality that was supported in the old “Generator” code, but is currently not supported? Right-to-left support is a major reason that we are considering licensing Aspose.PDF, and in order to mix RTL and LTR content, we really need this feature. Based on the examples I saw online, it definitely was supported in the older version of the code. Is this true, and does this mean that the equivalent support is planned for the newer code?
If so, is it on any sort of project timeline, or have you simply added it to a list of enhancement requests that might encompass things that were not originally supported? I’m trying to get a feel for how likely, and when, it may be available.
@bob.becker
Thanks for sharing your concerns.
Yes, you are right about old Aspose.Pdf.Generator model, that it used to support specifying Right-To-Left property at TextSegment
Level, and providing all features of old legacy Aspose.Pdf.Generator approach in new Aspose.Pdf DOM model, is definitely included in our plans.
Please note that our product team is working in resolving issues in the queue as well as adding missing and new features in the API. Which is why, currently we are not in the position to share any reliable ETA, but we are sure that they will plan to provide this feature as per their development schedule.
Furthermore, we have also recorded your concerns and intimated relevant team about them as well. As soon as we have some news or updates in this regard, we will certainly inform you. We highly appreciate your patience and comprehension in this matter. Please spare us little time.
We are sorry for this inconvenience.
Any updates on this feature, or when it is scheduled to be re-introduced to the library?
@bob.becker
Thanks for your inquiry.
I am afraid that due to other pending high priority issues and enhancements, earlier logged enhancement request is still pending. We are sure that product team will plan to investigate it and provide a fix as per their development schedule. We will definitely let you know, once we have any certain updates in this regard. Please be patient and give us little time.
We are sorry for the inconvenience.
I work with Bob Becker. We’ve started some testing with a temporary license, and so far everything seems to be going well. It looks like aspose.pdf will meet our needs, except for the lack of support for mixed RTL/LTR text.
We’d really like to get a sense of when PDFNET-43251 might get scheduled for implementation. I know this is often a difficult question to answer, and that you cannot give any guarantees at the moment, but I’m hoping that your PM group might be able to give a very rough estimate in terms of weeks, months, or years.
I’d be happy to speak with someone in person if that is more convenient for you.
Thanks for your time.
@blakelachance
Thanks for sharing your concerns with us.
Please note the product team resolves all logged issues, however they have been resolved on first come first serve basis. Furthermore, we have recorded your latest concerns and shared them with the respective team. We have requested to share an ETA (if possible) as well.
I am afraid that you cannot communicate directly with our product team, therefore, this is the only medium (i.e Support Forums) where you can share your concerns and they will certainly be communicated to respective team by us. As soon as we receive some feedback from product team regarding you issue, we will update you within this forum thread. Please spare us little time.
We are sorry for the inconvenience.
Hi Asad,
We’re nearing the end of our temporary license and it looks like Aspose.pdf will work nicely for our needs, except for the above stated issue. Is there any word from your PM team about a likely ETA?
Thanks,
Blake
@blakelachance
Thanks for your inquiry.
I am afraid that we cannot offer any ETA for now, as there are large number of issues in the queue, which were reported prior to your issue. However, we have again requested the respective team to share an update, if possible. As soon as we receive some feedback from their side, we will surely inform you. Your patience is highly appreciated in this regard. Please spare us little time.
We are sorry for the inconvenience.
Hi,
We’ve purchased aspose.pdf and it’s worked out very well for us except for the missing support for RTL/LTR text. Is there any word yet on adding this feature? Even a non-binding-general-ball-park estimate would be fine.
We have RFPs from prospects in Europe and the Middle East that will need RTL support, so this has become a much more pressing priority for us.
Thanks for your time,
Blake
@blakelachance
Thanks for your patience.
We are pleased to inform you that requested enhancement, logged under the ticket ID PDFNET-43251, has been added in latest version Aspose.Pdf for .NET 18.1. In latest version of the API, it is possible to set language transformation mode during generating document with DOM. This option is available in the TextEditOptions
of TextSegment
(s) of the TextFragment
.
Please consider following code snippet:
using (Aspose.Pdf.Document asposePdf = new Aspose.Pdf.Document())
{
asposePdf.Pages.Add();
asposePdf.Pages[1].Paragraphs.Add(new Aspose.Pdf.Text.TextFragment("LanguageTransformation.Default"));
TextFragment fragment1 = new Aspose.Pdf.Text.TextFragment("10203 :מזהה");
fragment1.Segments[1].TextEditOptions = new TextEditOptions(TextEditOptions.LanguageTransformation.Default);
asposePdf.Pages[1].Paragraphs.Add(fragment1);
asposePdf.Pages[1].Paragraphs.Add(new Aspose.Pdf.Text.TextFragment(" "));
asposePdf.Pages[1].Paragraphs.Add(new Aspose.Pdf.Text.TextFragment("LanguageTransformation.None"));
TextFragment fragment2 = new Aspose.Pdf.Text.TextFragment("10203 :מזהה");
fragment2.Segments[1].TextEditOptions = new TextEditOptions(TextEditOptions.LanguageTransformation.None);
asposePdf.Pages[1].Paragraphs.Add(fragment2);
asposePdf.Pages[1].Paragraphs.Add(new Aspose.Pdf.Text.TextFragment(" "));
asposePdf.Pages[1].Paragraphs.Add(new Aspose.Pdf.Text.TextFragment("LanguageTransformation.ExactlyAsISee"));
TextFragment fragment3 = new Aspose.Pdf.Text.TextFragment("10203 :מזהה");
fragment3.Segments[1].TextEditOptions = new TextEditOptions(TextEditOptions.LanguageTransformation.ExactlyAsISee);
asposePdf.Pages[1].Paragraphs.Add(fragment3);
asposePdf.Pages[1].Paragraphs.Add(new Aspose.Pdf.Text.TextFragment(" "));
asposePdf.Save(dataDir + "RTL_options_sample.pdf");
}
For your reference, an output document RTL_options_sample.pdf (32.8 KB) has also been attached, which illustrates, how these options work. Please try using latest version of the API and in case of any further assistance, please feel free to contact us.
Excellent! That is great news!
We look forward to adding this functionality in our next release.
Thank you for your responsiveness, both in the forum and from the product team.
Cheers,
Blake