IacDocument.GetObjectsInRectangle Method

The GetObjectsInRectangle method gets all the objects that are in the specified rectangle. The objects are placed in a Safe Array.

Syntax

IacObject[]  GetObjectsInRectangle(long left, long top, long right, long bottom, IacGetRectObjectsConstants flags );

Parameters

left

X-coordinate of the top-left corner.

top

Y-coordinate of the top-left corner.

right

X-coordinate of the bottom-right corner.

bottom

Y-coordinate of the bottom-right corner.

Flags

Value from enum IacGetRectObjectsConstants.

 

Option

Value

Description

acGetRectObjectsNone

0x0000

Use default behavior. Returns objects in the main document only, which are completely inside the specified rectangle.

acGetRectObjectsInMainDocument

0x0001

Return objects that are contained in the main document.

acGetRectObjectsInTemplateDocument

0x0002

Return objects that are contained in the template document.

acGetRectObjectsIntersecting

0x0004

Return objects that intersect, but are not completely within the specified rectangle.

acGetRectObjectsOptimize

0x0008

Optimize text objects before returning them. That is, combine text objects that are close to each other into a single text object.

 

Result

This is the return value, an array of acObjects.

Example

Array objects = pdfCreator1.Document.GetObjectsInRectangle(10, 10, 100, 100, Amyuni.PDFCreator.IacGetRectObjectsConstants.acGetRectObjectsInMainDocument);
for (int i = 0; i < objects.Length; i++)
{
    Amyuni.PDFCreator.IacObject o = (Amyuni.PDFCreator.IacObject)objects.GetValue(i);
    // do something with the object
}
Array objects = pdfCreator1.Document.GetObjectsInRectangle(10, 10, 100, 100, Amyuni.PDFCreator.IacGetRectObjectsConstants.acGetRectObjectsInMainDocument);
for (int i = 0; i < objects.Length; i++)
{
    Amyuni.PDFCreator.IacObject o = (Amyuni.PDFCreator.IacObject)objects.GetValue(i);
    // do something with the object
}