Skip to main content
Inspiring
October 26, 2022
Question

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

  • October 26, 2022
  • 2 replies
  • 690 views

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 has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
October 26, 2022

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.  

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Legend
October 27, 2022

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.

Inspiring
November 1, 2022

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

Legend
October 26, 2022

Are you writing an Acrobat plug-in?

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

Inspiring
October 27, 2022

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

 

For Levels only, how can i differnatiate. 

Thom Parker
Community Expert
Community Expert
October 27, 2022

Exactly what is it that you want to differentiate?

Explain in detail. 

 

 

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