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

Free Support Forum - aspose.com

XLS to Pdf conversion wrong in Java

Hi,


I got corrupted PDF document when converting XLS to PDF.
The documents attached.

Also, during opening this document via Acrobat Reader I got error "Cannot extract the embedded font ‘FAAAAH+LucidiaSans’. Some characters may not display or print correctly."

Could you please help me?
Thank you.

Hi,


Please try our latest version: v7.3.5:
http://www.aspose.com/community/files/72/java-components/aspose.cells-for-java/entry434437.aspx

I have tested converting your attached file to PDF and it works fine. Please find it (output) attached here.


Thank you.

Just tried, doesn’t work.

Please try this conversion on the Windows Server platform (I am using Windows Server 2003, Enterprise).

Also please share your source code example.

thank you.
Hi,

It seems to be a font related issue. Please set the font directory first via CellsHelper.setFontDir() and then do what you want to perform.

e.g

CellsHelper.setFontDir(pathToYourFontDir);
String filePath = "F:\\00.xlsx";
Workbook workbook = new Workbook(filePath);
workbook.save("00_out.pdf");

Also, please make sure all the fonts are present (installed) on your computer.

Thank you.

Could you please share your font dir path?

I will just compare with my path.

Also, I posted the similar question (regarding my another issue) to Aspose.Words forum
Error "Cannot extract the embedded font 'Calibri-Bold'. Some characters..." on exported PDF

And latest version of Aspose.Words works fine for me without any “font directory” settings.
Could you please explain difference?

Thank you.

Hi,


Well, I do not set any font path in my original program, I am using Windows 7. I have all the required fonts used in your file installed on my pc.
I just gave you the example that you should specify the font directory path before converting to PDF. Please make sure that your required fonts are installed on your system or you have all the required fonts copied into your windows server’ font directory and you have specified the font directory in your code.

Earlier, we used to search fonts which does not require the font directory path explicitly. But it required administrative rights because we need to access some restricted objects like for example registry. So in order to increase performance, we have now adopted this approach. Now, a user explicitly tells us the path of his font directories etc.

Thanks for your understanding!

For example, XLS was created using the some exotic font. I don’t have this font on my server and I just want to convert XLS to PDF properly and make it readable (i.e. replace unknown font by some existing font).

Is there any solution?

Hi,

Please spare us some time. We are working over your issue by setting up your environment (Windows Server 2003 etc.) and then we will test your issue on it. We will get back to you soon

Thank you.

Hi,

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

We have tried to reproduce this error but we are unable to reproduce this at our end.

Please send us the Lucida Sans truetype font from your windows\font and jre\lib\font directories.

It will help us analyze your issue further and we will help you asap.

Exactly, I don’t have Lucida Sans font on the server. So this is my question:

I can have XLS files with some unknown fonts references (they may be commercial proprietary fonts which unavailable for me), but I need to get readable rendered PDF.

Could you implement ability to replace all unknown and unavailable fonts by standard fonts (by Times or Arial)?
vegaecm:
Exactly, I don't have Lucida Sans font on the server. So this is my question:
I can have XLS files with some unknown fonts references (they may be commercial proprietary fonts which unavailable for me), but I need to get readable rendered PDF.

Could you implement ability to replace all unknown and unavailable fonts by standard fonts (by Times or Arial)?
Hi,

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

Please try the following code and let us know your run results.

Java
PdfSaveOptions opts = new PdfSaveOptions();
opts.setDefaultFont("Times New Roman");

workbook.save(filePath + ".out.pdf", opts);

In this case I got the same error but for TimesNewRoman font.

Screenshot attached.

Looking forward for a solution.

Additional info:

Target environment - Java 1.6 on Win 2003 Server (on Win7 it works fine)
The font was embedded - screenshot attached.

Hi,

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

We have logged your comments in our database against the issue id: CELLSJAVA-40420.

Please spare us some time, we will look into your issue and help/advise you asap.

Once, there is some update for you, we will let you know.

Hi,

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

Please download and try the latest version: Aspose.Cells
for Java v7.5.0.2
.We will try to use java logic font instead when no proper physical font can be
found when rendering now.

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for Java 8.4.2 and let us know your feedback.