Skip to main content
Inspiring
Oct 26, 2022 5:01 AM UTC
Question

How to get Pdf page words Font properties in adobe acrobat using c++

Hi Team,

I'm working on Toc pages in Acrobat pdf.

Here I need to identify levels of font properies.

Any suggestions! 

 

[Moved to the Acrobat SDK forum]

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

7 replies

Thom Parker
Community Expert
Community Expert
Oct 26, 2022 6:53 PM UTC

If this is for a plug-in, then use the WordFinder. 

 

You can also get font properties using regular page content iteration that returns PDText objects.   

This is the techniqued used by PDFCanOpener, which would be a big help to you on this project.   

 

I've used a combination of both on other projects to get more complete text info.  

 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Legend
Oct 27, 2022 8:22 AM UTC

Ok, I think I understand what you want to do. To analyse the text on a page in a PDF, which contains a TOC, and get the structure of the TOC to make a matching bookmarks.

 

There are no "levels" in a TOC page, except what you see. Levels may be seen as indenting, larger text, bold fonts, etc. You can use the methods we have said (Word Finder, probably) to get information on the position and font for each word. Then you must use your own rules (guesswork, or programmed specific rules) to decide the level for each word, and put the words together to make the labels for the TOC.

Translate
Inspiring
Nov 1, 2022 5:04 PM UTC

Thank you so much. wordfinder providing font information and size through PDWordGetNthCharStyle()

Translate
Legend
Oct 26, 2022 1:14 PM UTC

Are you writing an Acrobat plug-in?

What do you mean by "levels"? Please be detailed about what you are looking for.

Translate
Inspiring
Oct 27, 2022 5:25 AM UTC

Yes, I'm writing Acrobat Plugin only using C++.

 

For Levels only, how can i differnatiate. 

Translate
Thom Parker
Community Expert
Community Expert
Oct 27, 2022 5:48 AM UTC

Exactly what is it that you want to differentiate?

Explain in detail. 

 

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often