
Adobe Acrobat SDK
Working with Acrobat Extended APIs
Developing Plug-ins and Applications
AcroColor extended API 238
During execution, a plug-in performs the following tasks:
1. Respond to the following callbacks for each domain:
●
SCEnableProc
is called by Spelling to ask if this domain has anything that needs to be checked
●
SCGetTextProc
is called to get a text buffer to be checked.
●
SCCompletionProc
is called after the user has modified the text buffer.
2. The client may call other Spelling HFT services during execution even if it did not add a domain.
During its
unloadCallback
, a plug-in should perform the following tasks:
1. Remove all spelling domains added during initialization using the
SpellRemoveDomain
method.
2. Free all memory associated with
SpellCheckParam
block(s) (
scInBuffer
,
scOutBuffer
, and
scClientData
).
3. Free the
SpellCheckParam
block(s).
Several of the Spelling API methods (
SpellCheck
,
SpellCheckText
, and
SpellCheckWord
) take
input strings as parameters, and several methods return strings as output parameters.
Input strings are either big-endian Unicode strings with the bytes 0xFE 0xFF prepended, or strings with
PDFDocEncoding
. In either case a string is expected to have the appropriate null-termination. If a string
is UCS-2 it may have embedded language and country information.
Output text is in big-endian UCS-2 format with the bytes 0xFE 0xFF prepended. This string can be
converted to a host encoded string by using the
ASTextFromPDText
and
ASTextGetEncodedCopy
methods:
char **altArray = NULL;
ASInt32 altCount = 0;
ASBool status = SpellCheckWord(acd, cWord, NULL, 0, &altArray, &altCount);
if (altCount) {
ASText ast = ASTextFromPDText(altArray[1]);
char* altWord = ASTextGetEncodedCopy(ast, (ASHostEncoding)
PDGetHostEncoding() );
}
AcroColor extended API
AcroColor is an HFT that allows you to access the AcroColor engine (ACE), which controls color profile
management for Adobe Acrobat. Plug-ins can import the AcroColor HFT to use the color management
methods.
While not, strictly speaking, an “extended API” (since the API is not exposed from a plug-in) the AcroColor
API is included here with the extended APIs since it doesn’t fit into the “layered” structure of the Acrobat
core API. The AcroColor APIs, unlike the other extended APIs, can be used by the PDF Library.
The AcroColor HFT encapsulates color management into a set of convenient objects and functions. The
objects represent basic color-management entities:
●
The color management engine, or ACE, which is used by the underlying software to control a color
management session.