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.

Wed Jun 02, 2021 8:07 am

Hi,

We are trying to set html text in Pdf form's text field control.
Even though font type is given as courier, it is not reflecting in pdf after setting text using PdfHTMLTextElement's Draw() method.

Please help, how to solve this.

[Attaching code file, pdf form file and output pdf file]

Thanks.

jigratho
 
Posts: 11
Joined: Thu Feb 14, 2019 8:32 am

Wed Jun 02, 2021 11:34 am

Hello,

Thank you for your inquiry. Please use the following method to set the font. If there is any question, please feel free to write back.
Code: Select all
PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("Courier New", 10f, FontStyle.Regular));

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Wed Jun 02, 2021 12:16 pm

Hello,

Thanks for quick response, I tried this and it is showing correct font now.
But font size is still 13 instead of 10.

Please help, how to solve this.

Thanks.

jigratho
 
Posts: 11
Joined: Thu Feb 14, 2019 8:32 am

Thu Jun 03, 2021 2:52 am

Hello,

Thank you for your feedback.
I did find that the font size was not displayed correctly. I have logged the issue into our Bug tracking system with the ticket number SPIREPDF-4351. Our development team will investigate and fix it. Once it is resolved, I will inform you. Sorry for the inconvenience caused.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Tue Jun 29, 2021 8:48 am

Hello,

Thanks for your patience.
Glad to inform you that we just released Spire.PDF Pack Version: 7.6.15 which contains the fix of your reported issue. Please download the hotfix from the following links.
Website link: https://www.e-iceblue.com/Download/download-pdf-for-net-now.html
Nuget link: https://www.nuget.org/packages/Spire.PDF/7.6.15

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1647
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF