Free Support Forum - aspose.com

Display CJK characters while converting workbook to PDF using Aspose.Cells for Java

Hi,
I am trying to do POC for potentially using Aspose to convert excels to PDF for imiging purposes.

As part of that POC, we have to support multiple languages and character sets. As a standard non-english character set CJK Charater sets are used.

I created a new xlsx file with CJK characters and ran to Aspose.cell to convert it to a PDF file.
The resulting PDF files had blocked characters instead of the actual CJK characters.

Please let me know how I may sget around the issue.

I have attached the source xlxs file, the resuling PDF file and code snippet as to how I am converting the xlsx to PDF.

Also the Characters were copied from http://orwell.ru/test/Unicode/_?72 and simply pasted into the xlsx

Regards.

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Aspose.Cells does support all Unicode characters.

However, when I opened your source xlsx file, I found, all such characters are showing as Box characters and they are rendered in PDF as Box characters.

Please see the screenshot below for your reference.

Screenshot:

This is interesting I have attached my screen shot of when i open the file

Hi,

Thanks for your Excel screenshot.

It seems to be a font related issue. Please set the font directory first via CellsHelper.setFontDir() and then convert your file into pdf.

e.g

Java


CellsHelper.setFontDir(pathToYourFontDir);


String filePath = “F:\Shak-Data-RW\Downloads\cjk.xlsx”;


Workbook workbook = new Workbook(filePath);

workbook.save(filePath + “.out.pdf”);


I added the extra line as you mentioned above.

I am running Aspose in a Windows Environment, so my path was c:\windows\fonts

I tried the same conversion with no difference in the output pdf file.
I also changed the font in the xls file to Ariel and got the same output

Hi,

Thanks for your feedback.

It’s strange that setting font directory is still not working.

We have logged this issue for investigation in our database. We will look into it and advise you asap.

This issue has been logged as CELLSJAVA-40319

Hi Shakeel,
Thank you for all the help.

Is there Public facing portal that I can use to view the progress of this issue?

I am running this under a trial license which expires on the 28th of this month, so I would appreciate if this could be looked into with priority. The order ID associated with the license is 120827173142.

Regards,
Chaitanya


Hi,


Well, I am afraid, JIRA is our internal Issue tracking system and you cannot access it. You will have to always ask us to know about the status or progress of the issue. We will be happy to update on it all the time.

Also, hopefully, we could fix your issue soon i.e…, before your temporary license’s expiry date.


Thank you.

Hi Amjad,
I wanted to get an update on this issue. Has the engineering team got a chance to look into this issue? if so, have they made any progress in identifying what may be an issue?

If they have no probable solution, do they have any probable work around?

Regards,

cp_agarwal:
Hi Amjad,
I wanted to get an update on this issue. Has the engineering team got a chance to look into this issue? if so, have they made any progress in identifying what may be an issue?

If they have no probable solution, do they have any probable work around?

Regards,
Hi,

I am afraid, there is no update for you at the moment. Please spare us some time (1~3) working days.

We will get back to you asap.

Thanks Shakeel for the update.

Any Update on this matter?

Hi,


I am afraid your issue still not resolved. We are sorry as the issue is taking more time than expected.

I have now asked the relevant developer if we could provide you an eta for the issue. Once we have any update on it, we will let you know here.

Thank you.

Hi,

Thanks for using Aspose.Cells for Java.

Please download and try this fix: Aspose.Cells for Java (Latest Version).

1 - Please set default font “MingLiu” this will show more characters.

Java

String filePath = "F:\\Shak-Data-RW\\Downloads\\cjk.xlsx";

Workbook workbook = new Workbook(filePath);
PdfSaveOptions pso = new PdfSaveOptions();
pso.setDefaultFont("MingLiu");
workbook.save(filePath + ".out.pdf",pso);


2 - And we will provide a new api to set a default font list when save to pdf.

3 - It will be helpful if you can send the pdf result converted by Excel to us.

Thanks for the update.

However, using the new Lib 7.3.2.1 and the MingLiu font, I still wasn’t able to render any of the CJK characters as pointed to in the last update.
I have attached the resulting PDF.

Note: My license has expired as I had mentioned in my first few posts. I hope that dosnt affect the result

Hi,


Please find attached the PDF file rendered on my computer. The issue is still not fixed properly as there are certain CJK chars that are not rendered fine. We will look into it soon. Could you attach the rendered PDF using MS Excel (via Adobe add-ins for PDF rendering), it will help for us to investigate it accurately.

Thank you.

Hi Amjad,
I am not sure if I understand your previous request. Is this add-in a free utility? if so, could you provide a link to where I could download/install from.

I am however, attaching a pdf generated using primo pdf which is showing all the characters.


Thanks.

Hi,

Actually, this issue is not fixed fully, but the work is in progress.

We require more information on your part. We found that MingLiu can show some of the characters not all characters.

In order to investigate this issue, we require you provide to the PDF which you have converted by your Ms-Excel and attach here.

I think, you have used some other software to generate your attached PDF. Could you please generated PDF using your Ms-Excel and attach it here.

the cjk.xlsx-latest.pdf file was created using Aspose with 7321 and the code as directed in the post before it.

the cjk-primio.pdf was created using Primo PDF.

So i have no idea what other tool is in play here. if there is any other tool i need to use, let me know. But at this point, i have been using Aspose to create most of the pdfs that I have posted.

Hi,

Thanks for your posting and using Aspose.Cells.

You can save your source xls/xlsx file into pdf using Ms-Excel 2010.

Just click File and then Save As button.

Then select Pdf as shown below in a screenshot. Attach the saved pdf file here.

Screenshot: