Icon Image Module
Functions
|
|
Detailed Description
- group a3d_pdf_iconimage_module
(HOOPS Publish Advanced) Module to define icon image used for interactivity.
This module describes the functions that allows to define an icon image that can be used for interactivity.
Icon images are stored into the document on a way that is accessible for interactivity. An icon image is referenced by its identifier during interactivity. Identifier must be unique in the document. An Icon image can be set as button icon, which can be set by javascript. Also, icons can be set interactively on widgets populated by data model (Button or Scrolltable).
Function Documentation
Warning
doxygenfunction: Unable to resolve function “A3D_API_DEPRECATED” with arguments “None”. Candidate function could not be parsed. Parsing error is Error when parsing function declaration. If the function has no return type: Error in declarator or parameters-and-qualifiers Invalid C++ declaration: Expected identifier in nested name. [error at 60] A3D_API_DEPRECATED (A3DStatus, A3DPDFDocumentAddImageAsIcon,(A3DPDFDocument *pDoc, const A3DPDFImage *pImage, const A3DUTF8Char *pcIconName)) ————————————————————^ If the function has a return type: Error in declarator If declarator-id with parameters-and-qualifiers: Invalid C++ declaration: Expected identifier in nested name. [error at 19] A3D_API_DEPRECATED (A3DStatus, A3DPDFDocumentAddImageAsIcon,(A3DPDFDocument *pDoc, const A3DPDFImage *pImage, const A3DUTF8Char *pcIconName)) ——————-^ If parenthesis in noptr-declarator: Error in declarator or parameters-and-qualifiers If pointer to member declarator: Invalid C++ declaration: Expected ‘::’ in pointer to member (function). [error at 29] A3D_API_DEPRECATED (A3DStatus, A3DPDFDocumentAddImageAsIcon,(A3DPDFDocument *pDoc, const A3DPDFImage *pImage, const A3DUTF8Char *pcIconName)) —————————–^ If declarator-id: Invalid C++ declaration: Expecting “(” in parameters-and-qualifiers. [error at 29] A3D_API_DEPRECATED (A3DStatus, A3DPDFDocumentAddImageAsIcon,(A3DPDFDocument *pDoc, const A3DPDFImage *pImage, const A3DUTF8Char *pcIconName)) —————————–^
-
A3DStatus A3DPDFDocumentAddImageAsIcon2(A3DPDFDocument *pDoc, const A3DPDFImage *pImage, const A3DUTF8Char *pcInIconId, A3DUTF8Char **ppcOutIconId)
Function to store an image in the document in a way it can be used as an icon for interactive widgets.
Stored in that way, the image can be dynamically retrieved by the Acrobat JavaScript document function ‘getIcon’. For example, if the function is called with A3DPDFDocumentAddImageAsIcon2(pimage, “myicon”,NULL), then the following JavaScript code might be used on the document to dynamically set the icon on a button :
var but = this.getField("buttonfieldtopopulate"); var icon = this.getIcon("myicon"); but.buttonSetIcon(icon);
Also, the icon can be used in widgets automatically handled with data model. For this, the icon must be stored in the document with A3DPDFDocumentAddImageAsIcon2, and the icon id must be used into data table.
Memory Management
If successful and a new icon id is generated, the
ppcOutIconId
pointer contains heap-allocated memory for which you are responsible. To free the memory inppcOutIconId
, callA3DPDFDocumentAddImageAsIcon2
withpImage
andpDoc
set to 0:A3DPDFDocumentAddImageAsIcon2(0, 0, 0, &ppcOutIconId);
- Version
10.2
- Parameters:
pDoc – [inout] The Document object to work with.
pImage – [in] The image to store as icon in the Document.
pcInIconId – [in] The icon identifier. If provided, this is the internal id used into PDF document to name the icon. Warning, the name should be unique into the document! If NULL is specified, a unique id is automatically generated. The unique id is returned in
ppcOutIconId
argument.ppcOutIconId – [out] The identifier as a string. NULL is accepted if this information is not useful.
- Return values:
A3D_SUCCESS –
- Returns:
A3D_SUCCESS in case of success or an error code