PageCollection

Inheritance: java.lang.Object

All Implemented Interfaces: java.lang.Iterable, com.aspose.pdf.ISupportsMemoryCleanup

public final class PageCollection implements Iterable<Page>, ISupportsMemoryCleanup

Collection of PDF document pages.

Methods

MethodDescription
size()Gets count of pages in the document.
isEmpty()Returns TRUE if the collection is empty.
isSynchronized()Returns true of object is synchorinzed.
getSyncRoot()Gets synchronization object of the collection.
isReadOnly()Gets value indicating of collection is readonly.
add(Page entity)Adds page to collection.
clear()Clear page collection.
delete(int index)Delete specified page.
delete()Deletes all pages from collection.
indexOf(Page entity)Returns index of the specified page.
getUnrestricted(int index)Returns page by its index.
copyTo(Page[] array, int index)Copyies pages into document.
iterator()Returns enumerator of pages.
accept(AnnotationSelector visitor)Accepts AnnotationSelector visitor object that provides functionality to work with annotations.
delete(Integer[] pages)Delete pages specified which numbers are specified in array.
insert(int pageNumber)Insert empty apge into collection at the specified position.
add()Adds empty page
add(List pages)Adds to collection all pages from list.
add(Iterable pages)Adds to collection all pages from list.
insert(int pageNumber, Page entity)Inserts page into page collection at specified place.
get_Item(int index)Gets page by index.
accept(ImagePlacementAbsorber visitor)Accepts ImagePlacementAbsorber visitor object that provides functionality to work with image placement objects.
accept(TextFragmentAbsorber visitor)Accepts TextFragmentAbsorber visitor object that provides functionality to work with text objects.
accept(TextAbsorber visitor)Accepts TextAbsorber visitor object that provides functionality to work with text objects.
add(Page[] pages)Adds to collection all pages from array.
insert(int pageNumber, Iterable pages)Inserts pages from the collection into document.
insert(int pageNumber, List pages)Inserts pages from the collection into document.
insert(int pageNumber, Page[] pages)Inserts pages of the array into document.
flatten()Removes all fields located on the pages and place their values instead.
freeMemory()Clears cached data
add_Rename_Namesake(Page entity)Adds page to collection.
contains(Page item)Determines whether this instance contains the object.
remove(Page item)Removes the specified item, throws exception.
findByPdfObject(IPdfObject pdfObject)

size()

public int size()

Gets count of pages in the document.

Returns: int - int value

isEmpty()

public boolean isEmpty()

Returns TRUE if the collection is empty.

Returns: boolean - boolean value

isSynchronized()

public boolean isSynchronized()

Returns true of object is synchorinzed.

Returns: boolean - boolean value

getSyncRoot()

public Object getSyncRoot()

Gets synchronization object of the collection.

Returns: java.lang.Object - Object for synchronization

isReadOnly()

public boolean isReadOnly()

Gets value indicating of collection is readonly. Always returns false.

Returns: boolean - boolean value

add(Page entity)

public Page add(Page entity)

Adds page to collection.

Parameters:

ParameterTypeDescription
entityPagePage which should be added.

Returns: Page - Added page.

clear()

public void clear()

Clear page collection.

delete(int index)

public void delete(int index)

Delete specified page.

Parameters:

ParameterTypeDescription
indexintNumber of page that will be deleted. Pages numbers start from 1.

delete()

public void delete()

Deletes all pages from collection.

indexOf(Page entity)

public int indexOf(Page entity)

Returns index of the specified page.

Parameters:

ParameterTypeDescription
entityPagePage object. Pages numbers start from 1.

Pages numbers start from 1. Returns 0 in case collection doesn’t contain the page. |

Returns: int - Index of the page in collection.

getUnrestricted(int index)

public Page getUnrestricted(int index)

Returns page by its index. Page

Parameters:

ParameterTypeDescription
indexintIndex of requested page. Pages are numbered from 1.

Returns: Page - Requested page

copyTo(Page[] array, int index)

public void copyTo(Page[] array, int index)

Copyies pages into document.

Parameters:

ParameterTypeDescription
arrayPage[]Array containing Pages object to insert into document. It must be Object[] or Page[].
indexintStarting index where pages will be inserted

iterator()

public Iterator<Page> iterator()

Returns enumerator of pages.

Returns: java.util.Iterator<com.aspose.pdf.Page> - Enumerator of pages

accept(AnnotationSelector visitor)

public void accept(AnnotationSelector visitor)

Accepts AnnotationSelector visitor object that provides functionality to work with annotations.

Parameters:

ParameterTypeDescription
visitorAnnotationSelectorAnnotationSelector Visitor

delete(Integer[] pages)

public void delete(Integer[] pages)

Delete pages specified which numbers are specified in array.

Parameters:

ParameterTypeDescription
pagesjava.lang.Integer[]Array of pages to be deleted.

insert(int pageNumber)

public Page insert(int pageNumber)

Insert empty apge into collection at the specified position.

Parameters:

ParameterTypeDescription
pageNumberintPosition of the new page.

Returns: Page - Inserted page.

add()

public Page add()

Adds empty page

Returns: Page - Added page.

add(List pages)

public void add(List<Page> pages)

Adds to collection all pages from list.

Parameters:

ParameterTypeDescription
pagesjava.util.List<com.aspose.pdf.Page>List which contains all pages which must be added.

add(Iterable pages)

public void add(Iterable<Page> pages)

Adds to collection all pages from list.

Parameters:

ParameterTypeDescription
pagesjava.lang.Iterable<com.aspose.pdf.Page>List which contains all pages which must be added.

insert(int pageNumber, Page entity)

public Page insert(int pageNumber, Page entity)

Inserts page into page collection at specified place.

Parameters:

ParameterTypeDescription
pageNumberintRequired page index in collection.
entityPagePage to be inserted.

Returns: Page - Inserted page.

get_Item(int index)

public Page get_Item(int index)

Gets page by index.

Parameters:

ParameterTypeDescription
indexintIndex of page.

Returns: Page - Retrieved page.

accept(ImagePlacementAbsorber visitor)

public void accept(ImagePlacementAbsorber visitor)

Accepts ImagePlacementAbsorber visitor object that provides functionality to work with image placement objects.

Parameters:

ParameterTypeDescription
visitorImagePlacementAbsorberImage placement object.

accept(TextFragmentAbsorber visitor)

public void accept(TextFragmentAbsorber visitor)

Accepts TextFragmentAbsorber visitor object that provides functionality to work with text objects.

Parameters:

ParameterTypeDescription
visitorTextFragmentAbsorberText fragment absorber object.

accept(TextAbsorber visitor)

public void accept(TextAbsorber visitor)

Accepts TextAbsorber visitor object that provides functionality to work with text objects.

Parameters:

ParameterTypeDescription
visitorTextAbsorberText absorber object.

add(Page[] pages)

public void add(Page[] pages)

Adds to collection all pages from array.

Parameters:

ParameterTypeDescription
pagesPage[]Array of pages which will be added.

insert(int pageNumber, Iterable pages)

public void insert(int pageNumber, Iterable<Page> pages)

Inserts pages from the collection into document.

Parameters:

ParameterTypeDescription
pageNumberintStarting position of the new pages.
pagesjava.lang.Iterable<com.aspose.pdf.Page>Pages collection.

insert(int pageNumber, List pages)

public void insert(int pageNumber, List<Page> pages)

Inserts pages from the collection into document.

Parameters:

ParameterTypeDescription
pageNumberintStarting position of the new pages.
pagesjava.util.List<com.aspose.pdf.Page>Pages collection.

insert(int pageNumber, Page[] pages)

public void insert(int pageNumber, Page[] pages)

Inserts pages of the array into document.

Parameters:

ParameterTypeDescription
pageNumberintStarting number of the new pages.
pagesPage[]Array of pages which will be inserted.

flatten()

public void flatten()

Removes all fields located on the pages and place their values instead.

freeMemory()

public void freeMemory()

Clears cached data

add_Rename_Namesake(Page entity)

public void add_Rename_Namesake(Page entity)

Adds page to collection.

Parameters:

ParameterTypeDescription
entityPagePage which should be added.

contains(Page item)

public boolean contains(Page item)

Determines whether this instance contains the object.

Parameters:

ParameterTypeDescription
itemPagePage instance

Returns: boolean - boolean value true if [contains] [the specified item]; otherwise, false .

remove(Page item)

public boolean remove(Page item)

Removes the specified item, throws exception.

Parameters:

ParameterTypeDescription
itemPagePage instance

Returns: boolean - boolean value

findByPdfObject(IPdfObject pdfObject)

public final Page findByPdfObject(IPdfObject pdfObject)

Parameters:

ParameterTypeDescription
pdfObjectIPdfObject

Returns: Page