RemoveTextBlock

Description

Removes a PDFTextBlock object in the current PDFRichText object.

Applies to

PDFRichText object

Syntax

long RemoveTextBlock(string name)
long RemoveTextBlock(long index)

Argument

Description

index

The PDFTextBlock object to be removed from the current PDFRichText 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.

name The name of the PDFTextBlock object to be removed. If there are multiple PDFTextBlock objects with the same name in the PDFRichText object, only the first one will be removed.

Return value

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

Examples

The following example removes the PDFTextBlock object with index = 1:

//Remove PDFTextBlock with index = 1
lpdf_rtext.removetextblock(1)

The following example removes the PDFTextBlock object with name = "block":

pdf_block.name="block"
lpdf_block.content= "name is block"
lpdf_rtext.addtextblock(lpdf_block)
//Remove PDFTextBlock with name = "block"
lpdf_rtext.removetextblock("block")

See also

AddTextBlock

Clone

GetOverflowPageText

GetTextBlock

GetTextBlockCount

GetWrapImage

GetWrapImageCount

IsOverflowPage

RemoveWrapImage

WrapImage