(HOOPS Publish Advanced) Module to define icon image used for interactivity. More...

Functions

A3DStatus A3DPDFDocumentAddImageAsIcon (A3DPDFDocument *pDoc, const A3DPDFImage *pImage, const A3DUTF8Char *pcIconName)
 Function to store an image in the document in a way it can be used as an icon for interactive widgets. More...
 
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. More...
 

Detailed Description

(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

◆ A3DPDFDocumentAddImageAsIcon()

A3DStatus A3DPDFDocumentAddImageAsIcon ( A3DPDFDocument pDoc,
const A3DPDFImage pImage,
const A3DUTF8Char pcIconName 
)

Function to store an image in the document in a way it can be used as an icon for interactive widgets.

Deprecated:
This function is deprecated. Please use A3DPDFDocumentAddImageAsIcon2 instead.

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 A3DPDFDocumentAddImageAsIcon(pimage, "myicon"), 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);

Parameters
[in,out]pDocThe Document object to work with.
[in]pcIconNameThe icon name that will be used to identify the image.
[in]pImageThe image.
Returns
A3D_SUCCESS in case of success or an error code
Return values
A3D_SUCCESS
Version
6.1

◆ A3DPDFDocumentAddImageAsIcon2()

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

When A3DPDFDocumentAddImageAsIcon2 returns A3D_SUCCESS, ppcOutIconId can be freed by calling A3DPDFDocumentAddImageAsIcon2 with pImage & pDoc set to nullptr

Parameters
[in,out]pDocThe Document object to work with.
[in]pImageThe image to store as icon in the Document.
[in]pcInIconIdThe 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.
[out]ppcOutIconIdThe identifier as a string. NULL is accepted if this info is not useful.
Returns
A3D_SUCCESS in case of success or an error code
Return values
A3D_SUCCESS
Version
10.2