Support "right to left text" in ODT export/import using .NET

Hello,

We are using Aspose 10.8 for many English document processing but now we need to convert Arabic Docx documents to ODT (OpenOffice documents) and we faced some issues that we couldn’t find a solution for; we tried many workarounds as time limitation didn’t allow us to wait for a bug fix but nothing really worked for us so here we are heading to our last option. The issues are:

1- Arabic documents (which are naturally right-aligned) convert to left-aligned odt documents; one workaround I found is to set the language-direction of the document to "Right" and then justify all text/objects on the document but this can’t be applied in real-world as Arabic documents are right-aligned when composed and we can’t convert each and every document to “Justified” (and modify all the alignment issues that will appear doing so).
2- Textboxes alignment is not consistent and doesn’t show correct. I again tried tens of solutions here but nothing really worked out. To better see this issue (and the other ones) I have attached a docx document (and the converted odt one) and commented all the issues there.
3- Text direction in the Header/Footer sidebar doesn’t flip to vertical (please see the attachments)

The first issue is the major one that disturbs our entire solution though.

Looking forward to hearing from you soon.
Many thanks & Regards,
Alaa Tadmori

Hi Alaa,

Thanks for your query. Please use the following code snippet for your issues (1 & 2) . However, I have managed to reproduce the 3rd issue at my end. Please let me know, If the following code solve your problem.

It would be great, If you share which product you are using, Aspose.Words for Java or Aspose.Words for .NET?

Document doc = new Document(MyDir + "aspose-test_ar_commented.docx");

DocumentBuilder builder = new DocumentBuilder();

builder.ParagraphFormat.Bidi = true;

doc.Save(MyDir + "asposeOut.Odt", SaveFormat.Odt);

Java code:

Document doc = new Document(MyDir + “aspose-test_ar_commented.docx”);

DocumentBuilder builder = new DocumentBuilder();

builder.getParagraphFormat().setBidi(true);

doc.save(MyDir + “asposeOut.Odt”, SaveFormat.ODT);

Hi Tahir & Thanks for your quick reply.

We are using Aspose.Words for Java.

Unfortunately the code didn’t work for us as Bidi property was set to true before we did the tests; however I reassigned the property as the code indicates but as expected it didn’t change anything.
I want to mention that the docx we are trying to convert has no issues at all, the issues we are experiencing happen when we convert the docx to ODT (so the bidi is initially correct but the render of it is not).

Looking forward to hearing from you soon.
Regards,
Alaa Tadmori

Hi Alaa,

I have logged the 3rd issue (Text direction in the Header/Footer sidebar doesn’t flip to vertical) in our issue tracking system and linked to this thread. You will be updated via this forum thread once this issue is resolved.

I have generated the ODT file with latest version of Aspose.Words for Java and have not found any issue regarding text direction. Please find the generated ODT file in attachment and share some more information about about your issues.

Hello Tahir,

The document doesn’t look fine for me, my previous issues are still there, to see how it looks for me I provided a screenshot of the documents you have attached me in which the same issues appear. I highlighted the issues with the following convention:

Issue number 1: I used yellow highlight to show where it doesn’t convert correct (text that was right-aligned in the original docx converts here to left-aligned). For this same issue I circled with red line the text that looks fine in this document because I used the workaround I previously explained (which is to justify the text in the original docx instead of making it right-aligned); though it looks find in the converted document but we can’t justify all our docx documents and deal with the consequences of this for the sake of having them appear correct in the odt files..

Issue number 2: I used blue circle for it; as you can see from the screenshot it doesn’t look fine as well; please review the details of this issue in the previous posts.

Issue number 3: you already logged it in so no need to further discuss it; however it is circled with black.

I much appreciate your patience.
Regards,
Alaa Tadmori

Hi Alaa,

Thanks for sharing the information. It would be great, If you share some more information about your development platform.

I am using windows 7 (64 bit) and Office 2007/2010. The ODT file looks good to me, please see the screen shots of ODT file in attachment. Are you using OpenOffice?

Hi Tahir,

I am using windows 7 64 bit and Office 2010; Aspose.Words for Java version 10.8.

The screenshot you attached is for odt file opened in Office, I don’t see why we would need to convert a docx to odt then use Office to process this odt! Our effort is all based on getting a correctly converted docx-to-odt document and then use OpenOffice to process it. The screenshot I have sent you shows a converted document opened with OpenOffice version 3.3.0 and shows the previously mentioned issues with highlights and comments. Please take a look at it.

I hope this helps to better identify the problem. I will be looking forward to hearing from you soon.


Thanks & Regards,
Alaa Tadmori

Hi Alaa,

Thanks for sharing the information. The Aspose.Words mimics the MS Word behavior upon converting documents to ODT. If you convert .docx file to ODT by using MS word and open that ODT file in Open Office, you will experience the same behavior.

However, we already logged this issue in our issue tracking system as new feature request. You will be updated via this forum thread once this feature is available.

We apology for your inconvenience.

Hi Tahir,


We hope to get this feature soon as it seems to be our only solution. It would be even greater to hear about docx-to-pdf conversion support for Arabic documents as that would save us all the workarounds we are doing now; with each release from Aspose this is the first feature we look at; we know it is planned for development & wish to see it soon.

Thank you for your care. I hope I hear from you soon about these issues.
Best regards,
Alaa Tadmori

Hi Alaa,

Thanks for your interest in Aspose.Words. We will update you via this forum thread about the status of requested issues.

Hello Tahir,


I have upgraded to version 11.3 recently in which I believe that one of our old issues was fixed (issue number 3 which you logged previously) however even with this version I still get the same results as previously described (text direction in header/footer still doesn’t look correct). Any insights?

Thanks & Regards,
Alaa Tadmori

Hi Alaa,

I have verified the status of logged issues from our issue tracking system and regret to share with you that these issue are not resolved yet. We will update you via this forum thread once these issues are resolved.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-3609) have been fixed in this .NET update and this Java update.


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

The issues you have found earlier (filed as WORDSNET-5719) have been fixed in this .NET update and this Java update.


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