IndexOf

Description

Gets the index of a given object.

Applies to

PDFDocument object

PDFPage object

Syntax

If calling the function on a PDFDocument object:

long IndexOf(PDFPage page)

Argument

Description

page

The name of the PDFPage object in the PDFDocument.


If calling the function on a PDFPage object:

long IndexOf(PDFContent content)

Argument

Description

content The name of the PDFContent object in the PDFPage object.

Return value

Long. Returns 1 if it succeeds and -1 if it fails. For more errors, see the Error Codes.

Usage

Call the function to get the index of a PDFPage object in a PDFDocument object, or the index of a PDFContent in a PDFPage object.

The index of the objects are determined by the orders they are added, starting at 1. If one object is removed, the indexes of the remaining objects will be reordered.

Examples

This example gets the index of the specified PDFPage object in the current PDFDocument object:

//Get the index of lpdf_page
Long ll_index
ll_index = lpdf_doc.indexof(lpdf_page)

See also

PDFDocument objects:

AddPage

Clone

GetPage

GetPageCount

GetTableOfContents

ImportDataWindow

ImportPDF

ImportRichTextEdit

InsertPage

RemovePage

Save

SearchObject

SetTableOfContents

PDFPage objects:

AddContent

Clone

GetContent

GetContentCount

GetHeight

GetWidth

ImportContent

RemoveContent

SetHeight

SetPageSize

SetWidth