Skip to main content
Vijaykumar L S
Known Participant
May 28, 2018
Question

How to Get Font Properties of the text present in the PDF Page

  • May 28, 2018
  • 4 replies
  • 1684 views

Hi,

I am using FontGetdata() function, but this function doesn't give any data.

Which function I need use to get font data.

Please Help me..

Thanks..

This topic has been closed for replies.

4 replies

Legend
May 29, 2018

Ah, PDEFontGetAttrs not FontGetAttrs. So you are already working in a plug-in.

1. PDEFont has no size. It is just the font, and may be used at any size by PDEText elements.

2. PDEText elements do not have a size either but they have a matrix. You must analyse the matrix and decompose it into scaling, rotation and skewing.

Vijaykumar L S
Known Participant
May 29, 2018

Thanks for the Useful Information...

Vijaykumar L S
Known Participant
May 29, 2018

I am using PDEFontGetAttrs API to get Font Type and Font Name.

but Font size was not present.

PDEFont pdont = PDETextGetFont(textObject, kPDETextRun, iIndexSubElement);

PDEFontAttrs fontAttrRec;

PDEFontGetAttrs(pdont, &fontAttrRec, sizeof(fontAttrRec));

strcpy_s(fontName, 100, ASAtomGetString(fontAttrRec.name));

CString csfontName = (CString)fontName;

What i need to do to get Font size of the text..

Thanks...

Vijaykumar L S
Known Participant
May 29, 2018

Thanks for the Reply

I need the Following Font Attributes of the text from the PDF Page.

Font Type-----TrueType or Type1 or Type2 or etc...

Font name----Times New Roman or any other Font

Font Size----8,9,10,etc....

Thanks...

lrosenth
Adobe Employee
Adobe Employee
May 28, 2018

I don’t know what “FontGetData” is, it’s not part of the Acrobat API set…

What sort of “properties” do you need? IN general, you can use PDDocEnumResources() to get the list of fonts, then use the PDFont APIs to get info about each one.

Vijaykumar L S
Known Participant
May 29, 2018

Thank you for your reply..

I need to extract text Font properties like, Font type, Font size from the PDF Page.

Thanks..

Legend
May 29, 2018

What do you mean by “font type” exactly? Do you have Acrobat Pro?