com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class PageCollection

  • All Implemented Interfaces:
    Iterable<Page>


    public final class PageCollection
    extends Object
    implements Iterable<Page>

    Collection of PDF document pages.

    • Method Detail

      • size

        public int size()

        Gets count of pages in the document.

        Returns:
        int value
      • isEmpty

        public boolean isEmpty()

        Returns TRUE if the collection is empty.

        Returns:
        boolean value
      • isSynchronized

        public boolean isSynchronized()

        Returns true of object is synchorinzed.

        Returns:
        boolean value
      • getSyncRoot

        public Object getSyncRoot()

        Gets synchronization object of the collection.

        Returns:
        Object for synchronization
      • isReadOnly

        public boolean isReadOnly()

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

        Returns:
        boolean value
      • add

        public Page add(Page entity)

        Adds page to collection.

        Parameters:
        entity - Page which should be added.
        Returns:
        Added page.
      • clear

        public void clear()

        Clear page collection.

      • delete

        public void delete(int index)

        Delete specified page.

        Parameters:
        index - Number of page that will be deleted. Pages numbers start from 1.
      • delete

        public void delete()

        Deletes all pages from collection.

      • indexOf

        public int indexOf(Page entity)

        Returns index of the specified page.

        Parameters:
        entity - Page object. Pages numbers start from 1.

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

        Returns:
        Index of the page in collection.
      • getUnrestricted

        public Page getUnrestricted(int index)

        Returns page by its index. Page

        Parameters:
        index - Index of requested page. Pages are numbered from 1.
        Returns:
        Requested page
      • copyTo

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

        Copyies pages into document.

        Parameters:
        array - Array containing Pages object to insert into document. It must be Object[] or Page[].
        index - Starting index where pages will be inserted
      • accept

        public void accept(AnnotationSelector visitor)

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

        Parameters:
        visitor - AnnotationSelector Visitor
      • delete

        public void delete(Integer[] pages)

        Delete pages specified which numbers are specified in array.

        Parameters:
        pages - Array of pages to be deleted.
      • insert

        public Page insert(int pageNumber)

        Insert empty apge into collection at the specified position.

        Parameters:
        pageNumber - Position of the new page.
        Returns:
        Inserted page.
      • add

        public Page add()

        Adds empty page

        Returns:
        Added page.
      • add

        public void add(List<Page> pages)

        Adds to collection all pages from list.

        Parameters:
        pages - List which contains all pages which must be added.
      • add

        public void add(Iterable<Page> pages)

        Adds to collection all pages from list.

        Parameters:
        pages - List which contains all pages which must be added.
      • insert

        public Page insert(int pageNumber,
                           Page entity)

        Inserts page into page collection at specified place.

        Parameters:
        pageNumber - Required page index in collection.
        entity - Page to be inserted.
        Returns:
        Inserted page.
      • get_Item

        public Page get_Item(int index)

        Gets page by index.

        Parameters:
        index - Index of page.
        Returns:
        Retreived page.
      • accept

        public void accept(ImagePlacementAbsorber visitor)

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

        Parameters:
        visitor - Image placement object.
      • accept

        public void accept(TextFragmentAbsorber visitor)

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

        Parameters:
        visitor - Text fragment absorber object.
      • accept

        public void accept(TextAbsorber visitor)

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

        Parameters:
        visitor - Text absorber object.
      • add

        public void add(Page[] pages)

        Adds to collection all pages from array.

        Parameters:
        pages - Array of pages which will be added.
      • insert

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

        Inserts pages from the collection into document.

        Parameters:
        pageNumber - Starting position of the new pages.
        pages - Pages collection.
      • insert

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

        Inserts pages from the collection into document.

        Parameters:
        pageNumber - Starting position of the new pages.
        pages - Pages collection.
      • insert

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

        Inserts pages of the array into document.

        Parameters:
        pageNumber - Starting number of the new pages.
        pages - 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

        public void add_Rename_Namesake(Page entity)

        Adds page to collection.

        Parameters:
        entity - Page which should be added.
      • contains

        public boolean contains(Page item)

        Determines whether this instance contains the object.

        Parameters:
        item - Page instance
        Returns:
        boolean value true if [contains] [the specified item]; otherwise, false.
        Throws:
        com.aspose.ms.System.NotSupportedException - and exception
      • remove

        public boolean remove(Page item)

        Removes the specified item.

        Parameters:
        item - Page instance
        Returns:
        boolean value
        Throws:
        com.aspose.ms.System.NotSupportedException - an exception
      • findByPdfObject

        public final Page findByPdfObject(com.aspose.pdf.engine.data.IPdfObject pdfObject)