HTML Drawing Control

Save drawings as images

You may wish to allow users to capture an image of a drawing and attach it to a document field. For example, users may want to save a zoomed drawing, or save a drawing with a redline. To do so, add a Capture Image button to a view, to convert any drawing in the view to a common image format, and store the drawing in an image file.

To create an image from a drawing, the system traverses the page's Document Object Model (DOM) to gather information on the elements there. It uses the information to build a representation of the page. It does not take a screenshot of the page, but builds a representation of the page based on properties it reads from the DOM.

The image below shows the Capture Image button highlighted in yellow at the upper right.

capture_image.png

To add this action, use:

<action id="captureImage">
<title>Capture Image</title>
<command type="captureDrawingImage" id="drawingDivId" displayImage="true” functionName="control.captureImageCallback"/>
</action>

displayImage is an optional parameter. The setting allows you to control whether or not to display the generated PNG image in a separate browser window. The default is true. functionName allows you to specify a callback function.