• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Acrobat plugin SDK => Find Text => Error: The RPC server is unavailable

New Here ,
Feb 22, 2017 Feb 22, 2017

Copy link to clipboard

Copied

Hello,

While finding text, especially large text, sometimes, it gives me below error:

"The RPC server is unavailable."

When I debugged the code, I came to know that error comes at the function SearchExecuteQueryEx.

Here is my code snippet:

LPCWSTR secName = convertCharArrayToLPCWSTR(sectionName);

LPCWSTR arg = L"value";

LPWSTR searchText;

DWORD size = 1024;

LPCWSTR filePath = convertCharArrayToLPCWSTR(iniFilePath);

//Gets the search text from INI file

GetPrivateProfileStringW(secName, arg, NULL, searchText, size, filePath);

ASText searchKey = ASTextNew();

searchKey = ASTextFromUnicode((ASUTF16Val*)searchText, kUTF16HostEndian);

SearchQueryDataRec srcQuery;

memset(&srcQuery, 0, sizeof (SearchQueryDataRec));

srcQuery.size = sizeof(SearchQueryDataRec);

srcQuery.query = searchKey;

srcQuery.type = kSearchActiveDoc;

srcQuery.scope = kSearchDocumentText | kSearchMarkup;

srcQuery.path = NULL;

srcQuery.fs = NULL;

srcQuery.maxDocs = 1;

ASBool ret = SearchExecuteQueryEx(&srcQuery);

if (ret == false) {

  AVAlertNote("Search text not found");

}

ASTextDestroy(searchKey);

It was working previously, I am not getting what is the possible mistake.

Please help.

I am using: Windows 7 and Acrobat Pro XI trial version

Thank you.

TOPICS
Acrobat SDK and JavaScript

Views

609

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
community guidelines
New Here ,
Feb 09, 2018 Feb 09, 2018

Copy link to clipboard

Copied

LATEST

Hello Navnath,

I think the problem comes from not allocated searchText variable. So, you write anywhere in the memory and the result is obviously unexpected.

Votes

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
community guidelines