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 10, 2020 11:18 pm

Hello,

i'm trying to change the font in PDF and I'm receiving this error message.

Could you help me ?

Obs: The PDF file is attached.

PdfPageBase page = doc.Pages[0];
PdfUsedFont[] fonts = doc.UsedFonts;

PdfFont newfont = new PdfFont(PdfFontFamily.TimesRoman, 11f);
try
{


foreach (PdfUsedFont font in fonts)

{

// Console.WriteLine("{0}, {1}, {2}, {3}", font.Name, font.Size, font.Type, font.Style);

font.Replace(newfont);

}

Dicipulofer
 
Posts: 24
Joined: Wed Apr 08, 2015 1:41 pm

Thu Jun 11, 2020 8:10 am

Hello,

Thanks for your inquiry.
I tested your case and indeed reproduced your issue. This issue has been posted our Dev team with the ticket SPIREPDF-3328 for further investigation. We will let you know if there is any update.
Sorry for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Jun 15, 2020 9:34 am

Hello,

Hope you are doing well.
After the further investigation by our Dev team, we found that the font in your document is an embedded font containing ToUnicode information. If we force to replace the embedded font with another font, it is most likely to cause mess of characters. Therefore, replacing this embedded font is unreachable in our Spire.PDF. Hope you can understand.
If there is anything else we can do for you, please do not hesitate to contact us.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.PDF

cron