• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Replace Font sub types in a PDF using DC SDK

New Here ,
Jul 05, 2021 Jul 05, 2021

Copy link to clipboard

Copied

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]

TOPICS
Acrobat SDK and JavaScript

Views

237

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 05, 2021 Jul 05, 2021

Copy link to clipboard

Copied

Want you change all fonts to Courier New?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 05, 2021 Jul 05, 2021

Copy link to clipboard

Copied

yes.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 05, 2021 Jul 05, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 05, 2021 Jul 05, 2021

Copy link to clipboard

Copied

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 ?

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

Hi,

 

Below is some thing we want to try.

Read the content from one pdf and remove the font subtypes and add couriner new font.

After that we will save the content to new pdf file.

 

Please suggest if possible.

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

You can do this with PDFEdit, and you will face the obstacles I described. The result will be unreadable/unusable in most cases.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

PS to use PDFEdit you will need a basic knowledge of the PDF graphics and text model, so I suggest you spend some months studying the PDF Reference, ISO 32000.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

Thanks for the reply.

 

One last question.

after reading the existing pdf, If i can note down the positions of each element like paragraph, image and textbox positions while creating new pdf, can i apply the same positions ?

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

There are no paragraphs in a PDF. There are no text boxes. However, each run of text has a starting position, and it can be noted.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

Hi, 

 

Thanks for the help.

Can i have any code snippet/documentation link to read and save the text positions.

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

No, detailed study is required. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

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.

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

Hi,

 

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

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. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

LATEST

What does you mean with "adobe sdk for .net" ?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines