Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Developers

Topic: how to get hilited word from AReader -OLE Auto
Conf: (P-PDF) Developers, Msg: 81016
From: alex_alex
Date: 2/8/2003 12:12 AM

Hello all,

I want to get the word that is been
selected(clicked) in Adobe Acrobat Reader 5.0,
from my VC++ 6.0.

I tried the following using OLE Automation
using the typelib "acrobat.tlb" in MFC
it works well.
But here i have hard coded the value
for hilight(first word from list of 4).

How can i initialize the hilight object
at run time with the current selection.

any clues,suggestion,ideas...!


including type lib "acrobat.tlb"
#include "acrobat.h"
#define PDBeforeFirstPage -1
class OleInitClass

OleInitClass g_OleInitClass;
void somefunction(){

CAcroApp app;
CAcroAVDoc* m_pAcroAVDoc =
new CAcroAVDoc;;
CAcroAVPageView pageView;
CAcroPDPage page;
CAcroPDTextSelect* textSelect =
new CAcroPDTextSelect;
CAcroHiliteList* hilite =
new CAcroHiliteList;
char buf[255];
COleException e;
long num, selectionSize;

(app.GetActiveDoc(), TRUE);
(m_pAcroAVDoc->GetAVPageView(), TRUE);
num = pageView.GetPageNum();

if ((BOOL) num> PDBeforeFirstPage)
if (hilite)
page.AttachDispatch(pageView.GetPage(), TRUE);
selectionSize = textSelect->GetNumText();
if (selectionSize)
sprintf (buf, "word..: %s",textSelect->GetText(0));
sprintf (buf, "Failed to create text selection.");


delete textSelect;
delete hilite;
delete m_pAcroAVDoc;


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.