Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Apr 21, 2022 3:34 pm

Hi,
I am using spire.pdf.free. I have a table which has a mix of Arabic and English text and there is a need to align all text to the right. Unfortunately, when I use PdfTextAlignment.Right, a lot of spaces are added in front of the the Arabic text which is not the case if I used PdfTextAlignment.Left. This is a showstopper for me as the resulting output is not acceptable.

I am using JAVA and spire.pdf.free 5.1.0 on Windows 10 environment.

I attached the code and resulting PDFs in both case as well as screenshot with more explanation of my issue. Thanks a lot for your support.

mgalal123
 
Posts: 29
Joined: Thu Apr 21, 2022 12:48 pm

Thu Apr 21, 2022 10:02 pm

I used another simple test based on the available samples where it shows how right alignment in Arabic is messed up.

public static void main(String[] args) {
//create a PdfDocument object
PdfDocument doc = new PdfDocument();
//add a page
PdfPageBase page = doc.getPages().add();
//create a true type font
PdfTrueTypeFont font= new PdfTrueTypeFont(new Font("Times New Roman",Font.PLAIN,15));
//create a brush
PdfSolidBrush brush = new PdfSolidBrush(new PdfRGBColor(Color.black));
//create a PdfStringFormat object, specifying PdfTextAlignment to Left
PdfStringFormat leftAlignment = new PdfStringFormat(PdfTextAlignment.Left);
//draw text at left
page.getCanvas().drawString("test 123", font , brush, 0, 20, leftAlignment);
leftAlignment.setRightToLeft(true);
page.getCanvas().drawString("عربى اسم رقم", font , brush, 0, 40, leftAlignment);
page.getCanvas().drawString("عربى اسم", font , brush, 0, 60, leftAlignment);
page.getCanvas().drawString("عربى", font , brush, 0, 80, leftAlignment);
//draw text at right
PdfStringFormat rightAlignment = new PdfStringFormat(PdfTextAlignment.Right);
page.getCanvas().drawString("test 123", font , brush, page.getCanvas().getClientSize().getWidth(), 20, rightAlignment);
rightAlignment.setRightToLeft(true);
page.getCanvas().drawString("عربى اسم رقم", font , brush, page.getCanvas().getClientSize().getWidth(), 40, rightAlignment);
page.getCanvas().drawString("عربى اسم", font , brush, page.getCanvas().getClientSize().getWidth(), 60, rightAlignment);
page.getCanvas().drawString("عربى", font , brush, page.getCanvas().getClientSize().getWidth(), 80, rightAlignment);
//save the file
doc.saveToFile("C:\\temp\\align.pdf");
doc.close();
}

mgalal123
 
Posts: 29
Joined: Thu Apr 21, 2022 12:48 pm

Fri Apr 22, 2022 2:40 am

Hello,

Thanks for your inquiry.
I tested your case and did reproduce the issue you mentioned. I have logged the issue into our bug tracking system with the ticket number SPIREPDF-5117. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.
In addition, we only upgrade our commercial products regularly, that means once the issue is resolved, we will provide your with a commercial version including the fixes. Hope you can understand.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Fri Apr 22, 2022 12:29 pm

thanks a lot for your response. Hope we can get a fix soon. On the other hand, I need to know if there is any chance to apply the same fix to the free version at any time later ?

mgalal123
 
Posts: 29
Joined: Thu Apr 21, 2022 12:48 pm

Sun Apr 24, 2022 1:07 am

Hello,

Thanks for your feedback.
Regarding the issue SPIREPDF-5117, our developers have started investigating. I will notify you as soon as it is resolved.
In addition, since we do not regularly maintain the free version, there is no guarantee that this issue will be fixed in future upgrades to the free version. Hope you can understand.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Sun May 08, 2022 9:12 am

Hi team,
Any progress updates ? we are considering getting a paid license but we must ensure this issue has been resolved first.

mgalal123
 
Posts: 29
Joined: Thu Apr 21, 2022 12:48 pm

Mon May 09, 2022 2:03 am

Hello,

Thanks for following up.
Issue SPIREPDF-5117 is not currently resolved due to the complexity of the issue. Our developers are still working hard to find a workaround. I have informed our developers about your situation and asked them to resolve it as soon as possible. Please give us more time. As soon as there is any update, I will keep you informed. Sorry for the inconvenience caused again.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Wed May 18, 2022 8:43 am

Hi,
As mentioned earlier, we plan to buy license but need to ensure this issue is fixed. I am ready to connect with a seller to negotiate how to set higher priority for this and agree on license model.

mgalal123
 
Posts: 29
Joined: Thu Apr 21, 2022 12:48 pm

Wed May 18, 2022 8:59 am

Hello,

Thanks for your follow-up.
The issue SPIREPDF-5117 has been resolved and it is going to test phase now. If all goes well, we will add this fix in the next release and notify you in time.
In addition, I've upgraded this issue to a superlative A (A>B>C).

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Wed May 18, 2022 10:48 am

great news. thanks for the updates. If possible I can help during the testing if you could avail a beta version.

While the testing is ongoing we are ready to start the licenses discussion. I checked the license options but got some questions which I need to be connected to the sales team for discussion.

mgalal123
 
Posts: 29
Joined: Thu Apr 21, 2022 12:48 pm

Thu May 19, 2022 2:08 am

Hello,

Thanks for your feedback.
We have compiled a temporary version(Spire.Pdf_8.5.5) for you. I have confirmed your issue has been resolved in this version. Please download and test with it. Once the official version is released, I will inform you in time.
In addition, regarding the license issue, you can send the issue you encounter to our sales department by email (sales@e-iceblue.com), and they will deal with it in time.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Thu May 19, 2022 1:06 pm

Thanks a lot. I have tested the code and it worked fine.
I have also sent email to sales team.
I need to know the expected date for the general availability of the code.
we plan to get Spire.office as we use some other libraries besides spire.pdf. Please confirm the fix will be included as well.

mgalal123
 
Posts: 29
Joined: Thu Apr 21, 2022 12:48 pm

Fri May 20, 2022 1:35 am

Hello,

Thanks for your feedback.
I asked the person in charge that a new version of Spire.Office for Java will be released at the end of this month and may contain a fix for this issue. If not included, we will also provide you with a stable temporary version that includes the fix for this issue for you to use. Thanks for your understanding.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Mon May 30, 2022 4:04 am

Hello,

Thanks for your patience!
Glad to inform you that we just released Spire.Office for Java Version:7.5.4 which fixes the issue of SPIREPDF-5117.
Please download the new version to test.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Mon May 30, 2022 7:59 am

Great news,
Thanks a lot for your continuous support.

mgalal123
 
Posts: 29
Joined: Thu Apr 21, 2022 12:48 pm

Return to Spire.PDF