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

Community Beginner ,
May 28, 2018

Copy link to clipboard

Copied

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..

TOPICS
Acrobat SDK and JavaScript

Views

235

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

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

Community Beginner ,
May 28, 2018

Copy link to clipboard

Copied

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..

TOPICS
Acrobat SDK and JavaScript

Views

236

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
May 28, 2018 0
Adobe Employee ,
May 28, 2018

Copy link to clipboard

Copied

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.

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
Reply
Loading...
May 28, 2018 1
Community Beginner ,
May 28, 2018

Copy link to clipboard

Copied

Thank you for your reply..

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

Thanks..

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
Reply
Loading...
May 28, 2018 0
Most Valuable Participant ,
May 29, 2018

Copy link to clipboard

Copied

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

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
Reply
Loading...
May 29, 2018 0
Community Beginner ,
May 29, 2018

Copy link to clipboard

Copied

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...

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
Reply
Loading...
May 29, 2018 1
Community Beginner ,
May 29, 2018

Copy link to clipboard

Copied

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...

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
Reply
Loading...
May 29, 2018 0
Most Valuable Participant ,
May 29, 2018

Copy link to clipboard

Copied

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.

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
Reply
Loading...
May 29, 2018 3
Community Beginner ,
May 29, 2018

Copy link to clipboard

Copied

Thanks for the Useful Information...

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
Reply
Loading...
May 29, 2018 0