RemoveItem

Removes a specified item.

To

Use

Remove an item from the table of contents.

Syntax 1

Remove an item from a PDFFormFieldComboBox or PDFFormFieldListBox object

Syntax 2


Syntax 1: For a PDFTableOfContents or PDFTableOfContentsItem object

Description

Removes an item from the table of contents.

Applies to

PDFTableOfContents objects

PDFTableOfContentsItem objects

Syntax

long RemoveItem(PDFTableOfContentsItem item)
long RemoveItem(long index)

Argument

Description

item

The item to be removed from the table of contents.

index The index of the item to be removed from the table of contents. The indexes of the items in a table of contents are auto generated, and are structured by levels. For example, the level-1 chapters start their index at 1; and the sub-items in each chapter start their index at 1 too.

Return value

Long. Returns 1 if the function succeeds and -1 if an error occurs. For more errors, see the Error Codes.

Usage

Use this syntax to remove an item from the table of contents.

Examples

The following example removes the newly created item from the table of contents:

PDFtableofcontentsitem lpdf_tocitem
lpdf_tocitem = create PDFtableofcontentsitem

lpdf_toc.removeitem(  lpdf_tocitem)

See also

AddItem

GetBottomMargin

GetFont

GetItem

GetItemCount

GetLeftMargin

GetPosByPageIndex

GetRightMargin

GetStyle

GetTitle

GetTopMargin

RemoveItem

SetBottomMargin

SetFont

SetLeftMargin

SetPosByPageIndex

SetRightMargin

SetStyle

SetTitle

SetTopMargin

Syntax 2: For a PDFFormFieldComboBox or PDFFormFieldListBox object

Description

Removes a specified item.

Applies to

PDFFormFieldComboBox object

PDFFormFieldListBox object

Syntax

long RemoveItem(string itemText)

Argument

Description

itemText

The text of the item to be removed.


Return value

Long. Returns 1 if it succeeds. If an error occurs, returns the Error Codes. Otherwise, returns null.

Example

The following code example removes the item at the index 1 in the PDFFormFieldComboBox object lpdf_combobox.

string ls_text
long ll_return ,ll_return1
ls_text = lpdf_combobox.getitem(1)
//Remove the item
ll_return1 = lpdf_combobox.removeitem(ls_text)

See also

SetItemList

AddItem

GetItemCount

GetItem

RemoveAllItem

SetReadOnly

GetReadOnly