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
Method | Description |
---|---|
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 | Adds to collection all pages from list. |
add(Iterable | 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 | Inserts pages from the collection into document. |
insert(int pageNumber, List | 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:
Parameter | Type | Description |
---|---|---|
entity | Page | Page 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:
Parameter | Type | Description |
---|---|---|
index | int | Number 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:
Parameter | Type | Description |
---|---|---|
entity | Page | Page 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:
Parameter | Type | Description |
---|---|---|
index | int | Index 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:
Parameter | Type | Description |
---|---|---|
array | Page[] | Array containing Pages object to insert into document. It must be Object[] or Page[]. |
index | int | Starting 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:
Parameter | Type | Description |
---|---|---|
visitor | AnnotationSelector | AnnotationSelector Visitor |
delete(Integer[] pages)
public void delete(Integer[] pages)
Delete pages specified which numbers are specified in array.
Parameters:
Parameter | Type | Description |
---|---|---|
pages | java.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:
Parameter | Type | Description |
---|---|---|
pageNumber | int | Position 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:
Parameter | Type | Description |
---|---|---|
pages | java.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:
Parameter | Type | Description |
---|---|---|
pages | java.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:
Parameter | Type | Description |
---|---|---|
pageNumber | int | Required page index in collection. |
entity | Page | Page to be inserted. |
Returns: Page - Inserted page.
get_Item(int index)
public Page get_Item(int index)
Gets page by index.
Parameters:
Parameter | Type | Description |
---|---|---|
index | int | Index 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:
Parameter | Type | Description |
---|---|---|
visitor | ImagePlacementAbsorber | Image placement object. |
accept(TextFragmentAbsorber visitor)
public void accept(TextFragmentAbsorber visitor)
Accepts TextFragmentAbsorber visitor object that provides functionality to work with text objects.
Parameters:
Parameter | Type | Description |
---|---|---|
visitor | TextFragmentAbsorber | Text fragment absorber object. |
accept(TextAbsorber visitor)
public void accept(TextAbsorber visitor)
Accepts TextAbsorber visitor object that provides functionality to work with text objects.
Parameters:
Parameter | Type | Description |
---|---|---|
visitor | TextAbsorber | Text absorber object. |
add(Page[] pages)
public void add(Page[] pages)
Adds to collection all pages from array.
Parameters:
Parameter | Type | Description |
---|---|---|
pages | Page[] | 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:
Parameter | Type | Description |
---|---|---|
pageNumber | int | Starting position of the new pages. |
pages | java.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:
Parameter | Type | Description |
---|---|---|
pageNumber | int | Starting position of the new pages. |
pages | java.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:
Parameter | Type | Description |
---|---|---|
pageNumber | int | Starting number of the new pages. |
pages | Page[] | 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:
Parameter | Type | Description |
---|---|---|
entity | Page | Page which should be added. |
contains(Page item)
public boolean contains(Page item)
Determines whether this instance contains the object.
Parameters:
Parameter | Type | Description |
---|---|---|
item | Page | Page 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:
Parameter | Type | Description |
---|---|---|
item | Page | Page instance |
Returns: boolean - boolean value
findByPdfObject(IPdfObject pdfObject)
public final Page findByPdfObject(IPdfObject pdfObject)
Parameters:
Parameter | Type | Description |
---|---|---|
pdfObject | IPdfObject |
Returns: Page