Ask a Question related to Adobe Acrobat SDK, Design and Development.
-
Gitte_Thorvil@adobeforums.com #1
How do I get the end word-index of a multi-page selection?
Hi there,
I have made a selection that covers several pages in continous view. I need to get the pagenumber and the word-index at the end of the selection.
I have managed to get the end-page with AVDocSelectionEnumPageRanges, but that still leaves me without a clue of which word the selection ends at.
If you get the selection-range with PDTextSelectGetRange and ask for the end (range->end) then it returns a word-index that equals the number of words on the first page of the selection, but this has nothing to do with the actual end of the selection, it just shows that the selection goes beyond the page.
Note that a continous multi-page selection only results in 1 range count (PDTextSelectGetRangeCount()). It also says that in the documentation.
Any help is appreciated.
Thanks,
Gitte
Gitte_Thorvil@adobeforums.com Guest
-
Splitting or separating 1 multi page pdfdocument into individual page documents
I am looking for any product that will take a multi page pdf file and burst or separate it into individual pdf files created from each page. Mac... -
Index selection issue
Hi, I have an innodb table with about 8 million rows of data that has several indexes defined. While performing a select MySQL almost always... -
multi column index and order by
Hello, "order by a asc b desc" how can I create an index for this? Mage ---------------------------(end of... -
How to make multi page MS Word to multi page pdf
I have a five page MSWord X document that when exported to PDF only captures the first page. The document is sectioned(1st and 2nd pages are in... -
Login - multi table insert for registrant; subsquent login insert page requests into joined 'Selection' Table
Question regards insert and updates in sql server for a simple login script that requires registration the first time and only "email address" upon... -
Gitte_Thorvil@adobeforums.com #2
Re: How do I get the end word-index of a multi-page selection?
I found a way (workaround) to solve my problem - If anybody is interested:-)
Gitte
* ******************************************
static long g_selectedWordCount = 0;
static ACCB1 ASBool ACCB2 PDTextSelectEnumTextProcCB(void* procObj, PDFont /*font*/, ASFixed *size*/, PDColorValue /*color*/, char* text, ASInt32 textLen)
{
std::string* returnStr = static_cast<std::string*>(procObj);
returnStr->append(text, textLen);
std::string theText(text);
//Reset counter when New page occurs.
//Right now I assume that \r\n alone indicates a new page
// - so far it does!
if (textLen == 2 && CRLF.compare(theText) == 0) {
g_selectedWordCount = 0;
}
else {
g_selectedWordCount++;
}
return true;
}
//The following is added to the method where you need the end word-index. This also gives you a string with all selected text.
std::string returnStr = "";
g_selectedWordCount = 0;
PDTextSelectEnumTextProc cbPDTextSelectEnumTextProc = ASCallbackCreateProto(PDTextSelectEnumTextProc, &PDTextSelectEnumTextProcCB);
// Enumerate the text runs in PDText
PDTextSelectEnumText(ts, cbPDTextSelectEnumTextProc, &returnStr);
ASCallbackDestroy((void*)cbPDTextSelectEnumTextPro c);
long endWordIndex = g_selectedWordCount;
* ******************************************
Gitte_Thorvil@adobeforums.com Guest



Reply With Quote

