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

Free Support Forum - aspose.com

Issue with Hebrew text in Excel to PDF conversion

Hi, I’m using the latest version of Aspose Total and i’m currently having issues with bulleted lists and numbered lists with hebrew text.
when a line is too long, instead of a normal text flow (to the next line), the text goes to the previous line (see attached .png file)

my code (in short):

// creating PDF save option
var saveOptions = new Aspose.Cells.PdfSaveOptions();
saveOptions.AllColumnsInOnePagePerSheet = true;
// aspose workbook - save to stream(MemoryStream)
asposeWB.Save(stream, saveOptions);

i’ve tried playing around with directions and fonts but couldn’t get it right.
i’ve also attached a sample pdf and the result pdf

hopefully you’ll be able to reproduce this issue or find out what’s the problem

thanks
.Attachments.zip (110.3 KB)

@TopSolutions,

Thanks for the sample files and screenshot.

Since you are also adding some header and footer contents and specify other settings for which we are not sure about it. So, could you save to Excel file format (XLSX) just before saving to PDF file format and also provide us the output Excel file here, so we can make further investigations.

Thank you.

Hi,

The attached zip file contains the original xlsx, the saved xlsx before convertion and the output pdf.
i’ve removed the headers and footers and other settings to match my code above
(basically i loaded the excel file, created a new PdfSaveOptions object and saved it).
Attachments2.zip (57.0 KB)

@TopSolutions,

Thanks for the sample files.

After an initial test, I am able to observe the issue as you mentioned. I found the Issue with Hebrew text in Excel to PDF conversion. I noticed when a line is too long, instead of a normal text flow (to the next line), the text goes to the previous line as per your screenshot. The issue can be seen in the second, third and fourth line in D6 cell in the worksheet.
e.g
Sample code:

  Workbook asposeWB = new Workbook("e:\\test2\\BeforeConvertion.xlsx"); 

            var saveOptions = new Aspose.Cells.PdfSaveOptions(); 
            saveOptions.AllColumnsInOnePagePerSheet = true; 
            asposeWB.Save("e:\\test2\\out1.pdf", saveOptions) ;

I have logged a ticket with an id “CELLSNET-45465” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

Thank you.

@TopSolutions,

We did evaluate your issue further.
Well, the issue is related to RTL characters and multi-paragraphs in a cell. I am afraid, we cannot fix it for now.

A workaround is to add a Hebrew word/letter at the start. Similar to your other thread:

Please find attached the file “BeforeConvertion-2.xlsx”, we added “ע” character at the start in Cell D6 and D7:

Thank you.

@Amjad_Sahi,

After a deeper investigation we found out that the cause to this behaviour is a “&rlm” (8207 char in ASCII) in the text

  • We fixed the problem (for the cells with prefix before bullets) by removing it
  • As for the cells without prefix - when you remove the &rlm mark, the first bullet’s direction changes to ltr (and not rtl as we wanted to) - to fix this we added a prefix as you suggested.

Thanks for the workaround and it’ll work for now, but it still creates inconsistency in out output PDF (some cells with injected prefix, others without)
Please inform me if you working towards a more permanent solution.

Thanks.

@TopSolutions,

Good to know that you figures out your issue for now.

I have also logged your concerns against your issue “CELLSNET-45465” into our database for product team’s investigations and analysis.

Once we have an update on it, we will let you know here.

Thank you.