Skip to main content
Participating Frequently
Jul 5, 2021 2:54 PM UTC
Question

Replace Font sub types in a PDF using DC SDK

Hi,

 

We have a PDF file which has font subtypes.

we need to replace all font sub types with courier new font.

we are using Adobe DC sdk for .net to do it.

we need to understnad how can we do that using Adobe DC sdk for .net

 

[Question moved to the Acrobat SDK forum]

This topic is closed to new replies. Start a new post to keep the conversation going.

16 replies

Thom Parker
Community Expert
Community Expert
Jul 6, 2021 4:57 PM UTC

You say you are using the "Acrobat SDK for .Net". Do you mean you are using the PDF Library for .Net? or the IAC (Inter application Communication) SDK?  If you mean the IAC, then no, it is not possible to replace the fonts. 

To replace a font you'll need to use either the C++ SDK for plug-in development, or an independant PDF library.  Also, as Mr. Test Screen indicated, fonts are a complex and deep topic. There are many considerations when performing a font replacment.  It may seem like it should be a simple thing, since you can easily change a font from the Acrobat UI, but the Acrobat SDK does not automatically reformat text to adjust to the new font. However, some 3rd party PDF libraries do handle this. 

 

If you want to explore the internals of a PDF to see how fonts are handled I'd suggeset purchasing this tool:

https://www.windjack.com/product/pdfcanopener/

 

And making a careful study of the PDF Reference.

 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participating Frequently
Jul 7, 2021 5:44 AM UTC

Hi,

 

Please help if there is a way with adobe sdk for .net

Translate
Thom Parker
Community Expert
Community Expert
Jul 7, 2021 6:00 AM UTC

Please refer to my previous post. You'll need to tell us specifically which Acrobt SDK you are using.  The phrase "Acrobat SDK for .Net" doesn't mean anything by itself. 

 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Legend
Jul 5, 2021 5:21 PM UTC

I don't understand what you mean by changing "font sub types".


Each font has a subtype key but it is Type1, TrueType, OpenType etc. It is not a font name.

If you mean font substitution, that happens when the font is not in the file and you cannot influence it.

If you mean font subsets, then you can replace them using the PDFEdit API, but spacing will be a severe issue.

Translate
Participating Frequently
Jul 6, 2021 6:59 AM UTC

I want to replace all fomt with courier new.

Is there any issue with alignment if i use PDFEdit API to change all the fonts ?

 

Translate
Legend
Jul 6, 2021 10:17 AM UTC

Your problems will come from font metrics (width). Courier New is much wider than most fonts.

 

If you change font to Courier New in Word, the text will reflow, and you may need many more pages. This WILL NOT HAPPEN in PDFEdit. You change the text, but it stays on the same line. It will be too long, cut off, or overlapping other text. A complete mess. Unless you are replacing fonts with the same metrics.

 

You want reflow? Use Word. PDF is not suitable.

Translate
Bernd Alheit
Community Expert
Community Expert
Jul 5, 2021 4:03 PM UTC

Want you change all fonts to Courier New?

Translate
Participating Frequently
Jul 6, 2021 6:58 AM UTC

yes.

Translate