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.

Sat May 11, 2019 4:53 am

Hi, I try to replace font in a pdf file with c#, but it shows "The font being replaced is not a standard font of Type 1 font or a non-embeded TrueType font" .

source code:

Spire.Pdf.Graphics.Fonts.PdfUsedFont[] fonts = doc.UsedFonts;


Spire.Pdf.Graphics.PdfFont newfont = new Spire.Pdf.Graphics.PdfFont(PdfFontFamily.TimesRoman, 30f);


foreach (Spire.Pdf.Graphics.Fonts.PdfUsedFont font in fonts)
{
font.Replace(newfont); //the error occurs here!!!
}


usedfonts:
Name "Lucida Console" string
Size 9.99597 float
Style Regular Spire.Pdf.Graphics.PdfFontStyle
Type TrueTypeEmbedded Spire.Pdf.Graphics.PdfFontType
非公共成员
ActualFontName "R14" string
InternalFont {Spire.Pdf.Graphics.PdfTrueTypeFont} Spire.Pdf.Graphics.PdfFontBase {Spire.Pdf.Graphics.PdfTrueTypeFont}
ᜀ "Lucida Console" string
ᜁ 9.99597 float
ᜂ Regular Spire.Pdf.Graphics.PdfFontStyle
ᜃ TrueTypeEmbedded Spire.Pdf.Graphics.PdfFontType
ᜄ {Spire.Pdf.Graphics.PdfTrueTypeFont} Spire.Pdf.Graphics.PdfFontBase {Spire.Pdf.Graphics.PdfTrueTypeFont}
ᜅ {Spire.Pdf.PdfPageWidget} Spire.Pdf.PdfPageWidget
ᜆ "R14" string
Can you help me?

goalgood_2000
 
Posts: 1
Joined: Tue Apr 16, 2019 6:51 am

Mon May 13, 2019 3:59 am

Hi,

Thanks for you inquiry.
To help us investigate your issue accurately, please provide your input Pdf document. You could send it to us via email ([email protected]). Thanks in advance.

Sincerely,
Nancy
E-iceblue support team
User avatar

nancy.yang
 
Posts: 184
Joined: Wed Apr 03, 2019 2:33 am

Mon Sep 28, 2020 3:16 am

I had the same issue. please provide me the solution

snaren0423
 
Posts: 4
Joined: Mon Sep 28, 2020 2:53 am

Mon Sep 28, 2020 6:14 am

Hi snaren0423,

Thanks for your inquiry.
To help us investigate your issue more accurately, please provide your pdf file. You can upload your file here or send it us([email protected]) via email. Thanks in advance.

Sincerely,
Elena
E-iceblue support team
User avatar

Elena.Zhang
 
Posts: 279
Joined: Thu Jul 23, 2020 1:18 am

Mon Sep 28, 2020 7:22 am

attached my pdf here.. I just want to update all the text in that pdf to "Century Gothic 11f". Once everything is fine, I will be buying the same for client demo.

Thanks
Naren
Last edited by snaren0423 on Tue Sep 29, 2020 12:16 am, edited 1 time in total.

snaren0423
 
Posts: 4
Joined: Mon Sep 28, 2020 2:53 am

Mon Sep 28, 2020 10:33 am

Hi snaren0423,

Thanks for providing your file.
Please kindly note that our Spire.Pdf currently only supports replacing standard font of type 1 and non-emmbeded true type font. I checked your document and noticed that the font is embedded. This embedded font contains 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.

Sincerely,
Elena
E-iceblue support team
User avatar

Elena.Zhang
 
Posts: 279
Joined: Thu Jul 23, 2020 1:18 am

Return to Spire.PDF

cron