addRegion
Add a highlighted region.
addRegion([in] int pageNum, [in] double x0, [in] double y0, [in] double x1, [in] double y1,
[in] OLE_COLOR color, [in] OLE_COLOR selectColor,
[in] VARIANT_BOOL selectable, [in] BSTR label,
[out, retval] LONG *regionHandle)
The XpdfViewer control can display a set of highlighted regions on the
currently open PDF file. Once a highlighted region is created, the
user can manipulate it by selecting it (clicking on it) and then
moving its edges to resize it. As far as the XpdfViewer control is
concerned, highlighted regions are simply rectangles drawn in some
specified color. You can use regions for various purposes, e.g.,
allowing the user to mark parts of a PDF file to be extracted later.
This function adds a new highlighted region. The arguments are:
page
: page number for the regionx0, y0, x1, y1
: corners of the region rectangle, in PDF coordinate spacecolor
: normal colorselectColor
: color to be used when the highlighted region is selected by the userselectable
: if true, the region can be selected and resized by the userlabel
: label for the region (or an empty string for no label)
addRegion
function returns a handle that can be
passed to the other region-related functions.
VB:
Dim page As Long
Dim x0 As Double, y0 As Double, x1 As Double, y1 As Double
If viewer.getCurrentSelection2(page, x0, y0, x1, y1) Then
viewer.addRegion(page, x0, y0, x1, y1, _
RGB(255, 255, 0), RGB(0, 255, 0), True, "")
End If