i’m are facing a strange behavior since migration from aspose 18 to 24 with characters with accents like “è,é,î…ê…ô” which are not well handled; They are generated in my output pdf file but it seems like the font/or encoding is incorrect and nothing is display when editing/reading pdf with online tool like “we-pdf.com” ( it works fine with aspose cells 18)
Code:
public static void main(String[] args) {
String inputPath = "...MytestBook.xlsx"; /// a simple excel file with single sheet and a range/cells named "customText"
String outputPath = "...testPdfAccentSimple.pdf"; // out pdf file
Workbook wb = new Workbook(inputPath);
wb.getSettings().setRegion(CountryCode.FRANCE);
wb.getSettings().setLocale(Locale.FRANCE);
wb.getWorksheets().getRangeByName("customText").setValue("Comptabilité Prénom é à è î ");
// initializing named range customText
wb.calculateFormula(true);
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setCompliance(0);
pdfSaveOptions.setOptimizationType(1);
// saving
wb.save(outputPath, pdfSaveOptions);
}
Thanks for the template Excel file and output PDF file by Aspose.Cells for Java v25.1. Could you please also provide your expected PDF file. We will look into your issue soon.
@fournierl
In addition, if the text does not match the expected font, it may be that the program cannot find the installed fonts. You can add the following example code to set a custom font folder before loading the sample file.
// add this line to set a custom font folder
FontConfigs.setFontFolder("/usr/openwin/lib/X11/fonts/TrueType/", true);
String inputPath = "...MytestBook.xlsx"; /// a simple excel file with single sheet and a range/cells named "customText"
String outputPath = "...testPdfAccentSimple.pdf"; // out pdf file
Workbook wb = new Workbook(inputPath);
wb.getSettings().setRegion(CountryCode.FRANCE);
wb.getSettings().setLocale(Locale.FRANCE);
wb.getWorksheets().getRangeByName("customText").setValue("Comptabilité Prénom é à è î ");
// initializing named range customText
wb.calculateFormula(true);
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setCompliance(0);
pdfSaveOptions.setOptimizationType(1);
// saving
wb.save(outputPath, pdfSaveOptions);
You can also refer to the following document on how to set a custom font folder.
Could you please try to add the following line to set the custom fonts folder at the start of your program/code snippet if it makes any difference?
// add this line to set a custom font folder, please set/adjust the font folder path accordingly
FontConfigs.setFontFolder("/usr/openwin/lib/X11/fonts/TrueType/", true);
i just run it on my local windows laptop where fonts are located in C:/Windows/Fonts with option suggested just to make sure my remote solaris server is not missing somthing under his fonts folder (/usr/openwin/lib/X11/fonts/TrueType/)
We require thorough evaluation and investigation of your issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSJAVA-46249
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
This is to inform you that your issue (logged earlier as “CELLSJAVA-46249”) has been resolved on priority basis. By default, the fix/enhancement will be included in the next release (Aspose.Cells v25.3) scheduled for release first half of March (next month).
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.