Product & Version:
Apose.total_for_cpp_windows_26.6.0
Platform: Windows 11
I saw my issue with that configuration, then I overlayed
Aspose.Cell-for-Cpp-26.7-windows and Aspose.PDF.Cpp.26.7 and continue to see my issue
Platform: Windows 11
Issue:
My issue is when I convert the attached Excel document for conversion to PDF, the resulting PDF is wrong.
In this Excel file we use an installed Aptos Narrows Font and an Arial font. When we convert to PDF the resulting PDF does not have a Aptos Narrow font but a substitute font is used, SimSn-ExtB
I tried this same file on the Convert any file, save as PDF, Word, HTML, CSV, JPG, HTML, ODS, BMP, PNG, SVG, TIFF, XPS and more. Immediate download, 100% Free Online site and it did not produce a correct PDF file either, the substituted font was Malgun Gothic.
Doing this similar test with a word document does produce a PDF with the correct font.
Input: fonttest.xlsx
Output PDF: fonttest.pdf
Code Snippet:
Aspose::Cells::Startup();
// Set up warning callback
FontWarningCallback fontWarningCallback;
Aspose::Cells::LoadOptions options;
options.SetWarningCallback(&fontWarningCallback);
LOG("Loading Excel workbook...");
auto str = Aspose::Cells::U16String(inputFilePath.c_str());
// Load the Excel workbook with warning callback
Aspose::Cells::Workbook workbook(str, options);
LOG("Excel workbook loaded successfully.");
// Check if license file exists
if (!fileExists("Aspose.Total.C__.lic")) {
LOG("WARNING: License file 'Aspose.Total.C__.lic' not found in current directory");
}
//Licensing
try {
Aspose::Cells::License license;
license.SetLicense(u"Aspose.Total.C__.lic");
LOG("License applied successfully for Cells.");
}
catch (...) {
LOG("WARNING: Failed to apply license for Cells - continuing anyway");
}
if (outputExtension == "pdf") {
LOG("Saving Excel file as PDF.");
workbook.Save(Aspose::Cells::U16String(outputFilePath.c_str()), Aspose::Cells::SaveFormat::Pdf);
LOG("Excel file saved successfully.");
}
Aspose::Cells::Cleanup();