Hi.
I’ve got problem with converting XLSX file to PDF on Linux with Polish Fonts.
I use Arial font in this file.
When I’m converting docx file with Arial, everything is OK.
When it is XLSX, there is some problem.
I have installed Liberation Fonts in this system.
Here is my piece of code for XLSX:
CellsHelper.setFontDir("/usr/share/fonts/liberation");
com.aspose.cells.Workbook doc = new Workbook(filePath);
doc.save(newFile);
Here is my code for DOCX:
com.aspose.words.Document doc;
doc.save(newFile);
Why for docx there is no problem?
Example files in attachment.
Hi Krzysztof,
Thank you for contacting Aspose support.
Please note that Aspose.Cells APIs require the fonts used in the spreadsheet to be present in the environment for the correct conversion to PDF format. Your provided spreadsheet is using Arial font so you can avoid this situation by placing the TTFs of Arial font family on your machine and pointing the Aspose.Cells for Java API to that location (same as you are currently setting the font location to Liberation Fonts folder).
Moreover, the Liberation Fonts package consists of Liberation Sans, Liberation Sans Narrow, Liberation Serif and Liberation Mono. These fonts are metrically compatible with Monotype Corporation’s Arial but not equivalent because Aspose.Cells APIs search the fonts with exact names. Please check the details articles on
this link to get more information about how Aspose.Cells for Java API uses the TrueType fonts for rendering purposes.
Hi, thanks for the answer.
Could You tell me, why there is no problem with docx file? Docx has Arial too, but Aspose.Words can use Liberation Fonts to convert this kind of file to pdf correctly. What is the different?
Hi Krzysztof,
Aspose.Cells & Aspose.Words for Java APIs behave more or less in a similar fashion when it comes to the rendering of PDF files on Non-Windows platforms such as Linux. Both APIs tries to find the exact font (by font name) used in the spreadsheet/document in the environment’s font folders. In case the exact font is not found that the APIs tries to substitute the required fonts with any available ones. In order to search for the substitute fonts, both APIs first look for the system’'s font folders and then in the folders explicitly specified.
If you check the properties of your provided PDF files in Adobe Reader (screenshots attached), you will notice that Aspose.Words for Java API was able to substitute the Arial font with LiberationSans whereas no embedded fonts were found in the PDF generated with Aspose.Cells for Java API. We suspect that the problem is with Aspose.Cells for Java API as it cannot substitute the Arial font with Liberation fonts where it should be. We have currently tested the case on Windows platform and were able to notice this problem. Now we re moving forward to test the same case on Linux (Ubuntu), and if the said behavior is established as a bug on the part of Aspose.Cells APIs, we will log appropriate ticket for the product team’s analysis. We will keep you posted with updates in this regard.
Please feel free to write back in case you have further concerns or questions.
Hi again,
This is to inform you that we are able to verify the issue of Aspose.Cells for Java API not being able to substitute the Arial font with Liberation fonts in Linux environment. We have logged this problem in our bug tracking system under the ticket
CELLSJAVA-41227 for further investigation & correction purposes. Please spare us little time to properly analyze the problem cause, and to provide the fix at earliest possible. In the meanwhile, you can install the Microsoft’s core fonts (
ttf-mscorefonts) as elaborated in
this article. We have tested that
Aspose.Cells for Java 8.3.2.4 can pick these fonts correctly to embed them in the resultant PDF file. If you wish not to upgrade the API now, you can simply install the fonts and point the API to their folder with your current version of Aspose.Cells for Java API.
Please feel free to write back in case you face any difficulty.
Now, with new version, everything works fine.
Thank You!
Hi Krzysztof,
Thank you for the confirmation.
It is good to know that you are up & running again. Please feel free to contact us back in case you need our further assistance with Aspose APIs.
The issues you have found earlier (filed as CELLSJAVA-41227) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.