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]
Want you change all fonts to Courier New?
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.
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 ?
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.
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.
You can do this with PDFEdit, and you will face the obstacles I described. The result will be unreadable/unusable in most cases.
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.
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 ?
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.
Thanks for the help.
Can i have any code snippet/documentation link to read and save the text positions.
No, detailed study is required.
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:
And making a careful study of the PDF Reference.
Please help if there is a way with adobe sdk for .net
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.
What does you mean with "adobe sdk for .net" ?