Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Oct 10, 2025 3:23 pm

Dear Spire.PDF Support Team,

I am currently using the Spire.Free PDF for Java library (the free version) and am encountering an issue with embedding the "Noto Sans" custom font.

My current implementation for standard fonts, which works correctly, is as follows:

Java

PdfTrueTypeFont fontBold = new PdfTrueTypeFont(new Font(PdfFontFamily.Helvetica.getName(), Font.BOLD, (int) fontSize), true);
However, when I attempt to use a custom font like "Noto Sans" by providing the font file, it does not work. I have tried passing the font file directly to the constructor, but the font is not correctly applied in the generated PDF.

Could you please clarify if this difficulty with embedding custom TrueType fonts, such as Noto Sans, is a known limitation of the free version of your library?

Specifically, does the paid version of Spire.PDF for Java offer different or more robust functionality for loading and embedding fonts from external .ttf files? I need to confirm whether upgrading to the paid version will resolve this specific issue.

Thank you for your time and assistance.

Best regards,
Jacopo.

jadinard
 
Posts: 13
Joined: Wed Aug 13, 2025 2:25 pm

Sat Oct 11, 2025 2:43 am

Hello,

Thank you for your inquiry.
During my testing across both Free (v9.13.0) and Commercial (v11.9.6) versions, I have been unable to reproduce the issue you reported and the Noto Sans font is functioning correctly. The following is my test code:
Code: Select all
      PdfDocument doc = new PdfDocument();
        PdfPageBase page = doc.getPages().add();
        PdfRGBColor color = new PdfRGBColor(Color.black);

        // Import fonts using font paths
        PdfTrueTypeFont fontBold = new PdfTrueTypeFont("C:\\Users\\user1\\Desktop\\font\\NotoSans-Bold-5.ttf", 20f);

        page.getCanvas().drawString("Hello, World!",
                fontBold ,
                new PdfSolidBrush(color), 10, 10);
        String result = "out.pdf";
        doc.saveToFile(result, FileFormat.PDF);
        doc.close();

Could you please update to our latest commercial version Spire.PDF 11.9.6 and test again?
The key differences lie in the Free version's limitation of processing only 10 pages for PDF generation and 3 pages for format conversions, along with the Commercial version's priority access to new features and fixes. I suggest you evaluate our Commercial version since it offers better stability, more complete functionality, and includes the latest updates and bug fixes compared to the Free version. We can offer you a one-month temporary license to help you test the Commercial version without watermarks or functional restrictions. If you need one, please let me know anytime.
Last edited by talia.liu on Thu Oct 16, 2025 1:14 am, edited 1 time in total.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Wed Oct 15, 2025 2:35 pm

talia.liu wrote:Hello,

Thank you for your inquiry.
During my testing across both Free (v9.13.0) and Commercial (v11.9.6) versions, I have been unable to reproduce the issue you reported and the Noto Sans font is functioning correctly. The following is my test code:
Code: Select all
      PdfDocument doc = new PdfDocument();
        PdfPageBase page = doc.getPages().add();
        PdfRGBColor color = new PdfRGBColor(Color.black);

        // Import fonts using font paths
        PdfTrueTypeFont fontBold = new PdfTrueTypeFont("C:\\Users\\user1\\Desktop\\font\\NotoSans-Bold-5.ttf", 20f);

        page.getCanvas().drawString("Hello, World!",
                fontBold ,
                new PdfSolidBrush(color), 10, 10);
        String result = "out.pdf";
        doc.saveToFile(result, FileFormat.PDF);
        doc.close();

Could you please update toour latest commercial version Spire.PDF 11.9.[/url]6 and test again?
The key differences lie in the Free version's limitation of processing only 10 pages for PDF generation and 3 pages for format conversions, along with the Commercial version's priority access to new features and fixes. I suggest you evaluate our Commercial version since it offers better stability, more complete functionality, and includes the latest updates and bug fixes compared to the Free version. We can offer you a one-month temporary license to help you test the Commercial version without watermarks or functional restrictions. If you need one, please let me know anytime.



hi, it's still not working on my pc, when i try i see no difference with other standard font from your library, maybe it's some kind of limitiation of my code? the noto sans file it's called this way

Code: Select all
        PdfTrueTypeFont fontBold = new PdfTrueTypeFont("C:\\Users\\ja.dinardo\\Documents\\myTest\\src\\data\\NotoSans-Bold.ttf",fontSize);
        PdfTrueTypeFont fontRegular = new PdfTrueTypeFont("C:\\Users\\ja.dinardo\\Documents\\myTest\\src\\data\\NotoSans-Regular.ttf",fontSize);
        cell.getStyle().setFont(isBold ? fontBold : fontRegular);


it could be nice to have a free trial of your library to test its potential, thanks

jadinard
 
Posts: 13
Joined: Wed Aug 13, 2025 2:25 pm

Thu Oct 16, 2025 5:52 am

Hello,

Thank you for your feedback.
I have attached my font files. Could you please test again using these files? If the issue persists, could you please send us your result files along with your specific testing environment details (e.g., Windows 11 64-bit, Java 11)? We will conduct further investigation. Additionally, my sales colleague has sent a 30-day temporary license to your email. Please check your inbox.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Thu Oct 16, 2025 7:57 am

talia.liu wrote:Hello,

Thank you for your feedback.
I have attached my font files. Could you please test again using these files? If the issue persists, could you please send us your result files along with your specific testing environment details (e.g., Windows 11 64-bit, Java 11)? We will conduct further investigation. Additionally, my sales colleague has sent a 30-day temporary license to your email. Please check your inbox.



Actually now it works, thank you :D

Thanks a lot for the license, I'll let you know if I have any other issue.

Thanks.
Jacopo.

jadinard
 
Posts: 13
Joined: Wed Aug 13, 2025 2:25 pm

Thu Oct 16, 2025 8:43 am

Dear Jacopo,

Glad to hear your issue has been resolved.
If you have any questions or need further assistance, please don't hesitate to let us know.
Sincerely,
Talia
E-iceblue support team
User avatar

talia.liu
 
Posts: 341
Joined: Mon Apr 14, 2025 3:33 am

Return to Spire.PDF

cron