Skip to main content

IFragmentCollection Interface

A collection of page fragments.

Declaration

public interface IFragmentCollection extends IObjectCollectionBase<PageFragment>

Remarks

Use this interface to access, search, replace, clone, and manage PageFragment objects that define PDF page content.

Call the Page.getFragments() method to access the fragments collection.

Refer to the following help topic for additional information: Add Content to Pages.

Implements

com.devexpress.docs.pdf.IObjectCollectionBase<com.devexpress.docs.pdf.PageFragment>

Methods

copy() Method

Creates a copy of the fragment collection.

Declaration

public abstract IFragmentCollection copy()

Returns

Type Description
IFragmentCollection

A new IFragmentCollection object that contains cloned fragments.

copy(DocumentCloneContext context) Method

Creates a copy of the fragment collection within the specified clone context.

Declaration

public abstract IFragmentCollection copy(DocumentCloneContext context)

Parameters

Name Type Description
context DocumentCloneContext

A DocumentCloneContext object that tracks cloned objects.

Returns

Type Description
IFragmentCollection

A copied IFragmentCollection object.

find(Predicate<PageFragment> func) Method

Returns the first page fragment that matches the specified condition.

Declaration

public abstract PageFragment find(Predicate<PageFragment> func)

Parameters

Name Type Description
func java.util.function.Predicate<PageFragment>

A predicate that determines whether a fragment matches the search condition.

Returns

Type Description
PageFragment

The first matching PageFragment object, or null if no fragment matches the condition.

findAll(Predicate<PageFragment> func) Method

Returns all page fragments that match the specified condition.

Declaration

public abstract List<PageFragment> findAll(Predicate<PageFragment> func)

Parameters

Name Type Description
func java.util.function.Predicate<PageFragment>

A predicate that determines whether a fragment matches the search condition.

Returns

Type Description
java.util.List<PageFragment>

A list of matching PageFragment objects.

objectClone() Method

Creates a copy of the current fragment collection.

Declaration

public abstract Object objectClone()

Returns

Type Description
Object

An Object that contains a cloned IFragmentCollection instance.

replace(PageFragment item, PageFragment[] newItems) Method

Replaces an existing page fragment with one or more page fragments.

Declaration

public abstract void replace(PageFragment item, PageFragment[] newItems)

Parameters

Name Type Description
item PageFragment

The fragment to replace.

newItems PageFragment[]

Fragments that replace the specified fragment.

toFlatIterable() Method

Returns an iterable collection that contains all page fragments in a flattened hierarchy.

Declaration

public abstract Iterable<PageFragment> toFlatIterable()

Returns

Type Description
java.lang.Iterable<PageFragment>

An Iterable object that contains all PageFragment objects.

Remarks

Use the toFlatIterable() method to iterate through fragments contained in nested fragment collections.