Collection of PDF document pages. More...

Inherits System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::Page > >, and Aspose::Pdf::ISupportsMemoryCleanup.

Public Member Functions

int32_t get_Count () const
 Gets count of pages in the document. More...
 
bool get_IsSynchronized ()
 Returns true of object is synchorinzed. More...
 
System::SharedPtr< System::Objectget_SyncRoot ()
 Gets synchronization object of the collection. More...
 
bool get_IsReadOnly () const
 Gets value indicating of collection is readonly. Always returns false. More...
 
System::SharedPtr< PageCopyPage (System::SharedPtr< Page > entity)
 Adds page to collection. More...
 
void Clear ()
 Clear page collection. More...
 
void Delete (int32_t index)
 Delete specified page. More...
 
void Delete ()
 Deletes all pages from collection. More...
 
int32_t IndexOf (System::SharedPtr< Page > entity)
 Returns index of the specified page. More...
 
void CopyTo (System::ArrayPtr< System::SharedPtr< Page >> array, int32_t index)
 Copyies pages into document. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< Page > > > GetEnumerator ()
 Returns enumerator of pages. More...
 
void Accept (System::SharedPtr< Annotations::AnnotationSelector > visitor)
 Accepts AnnotationSelector visitor object that provides functionality to work with annotations. More...
 
void Delete (System::ArrayPtr< int32_t > pages)
 Delete pages specified which numbers are specified in array. More...
 
System::SharedPtr< PageInsert (int32_t pageNumber)
 Insert empty apge into collection at the specified position. More...
 
System::SharedPtr< PageAdd ()
 Adds empty page More...
 
void Add (System::SharedPtr< System::Collections::Generic::ICollection< System::SharedPtr< Page >>> const &pages)
 Adds to collection all pages from list. More...
 
System::SharedPtr< PageInsert (int32_t pageNumber, System::SharedPtr< Page > entity)
 Inserts page into page collection at specified place. More...
 
System::SharedPtr< Pageidx_get (int32_t index)
 Gets page by index. More...
 
void Accept (System::SharedPtr< ImagePlacementAbsorber > visitor)
 Accepts ImagePlacementAbsorber visitor object that provides functionality to work with image placement objects. More...
 
void Accept (System::SharedPtr< Text::TextFragmentAbsorber > visitor)
 Accepts TextFragmentAbsorber visitor object that provides functionality to work with text objects. More...
 
void Accept (System::SharedPtr< Text::TextAbsorber > visitor)
 Accepts TextAbsorber visitor object that provides functionality to work with text objects. More...
 
void Add (System::ArrayPtr< System::SharedPtr< Page >> const &pages)
 Adds to collection all pages from array. More...
 
void Insert (int32_t pageNumber, System::SharedPtr< System::Collections::Generic::ICollection< System::SharedPtr< Page >>> pages)
 Inserts pages from the collection into document. More...
 
void Insert (int32_t pageNumber, System::ArrayPtr< System::SharedPtr< Page >> pages)
 Inserts pages of the array into document. More...
 
void Flatten ()
 Removes all fields located on the pages and place their values instead. More...
 
void FreeMemory ()
 Clears cached data More...
 
void Add (System::SharedPtr< Page > const &entity)
 Adds page to collection. More...
 
bool Contains (System::SharedPtr< Page > const &item) const
 Determines whether this instance contains the object. More...
 
bool Remove (System::SharedPtr< Page > const &item)
 Removes the specified item. More...
 
- Public Member Functions inherited from System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::Page > >
virtual void CopyTo (System::ArrayPtr< System::SharedPtr< Aspose::Pdf::Page > > array, int arrayIndex)=0
 
ICollectionoperator= (ICollection &&)
 
ICollectionoperator= (const ICollection &)
 
 ICollection ()
 Default constructor. More...
 
 ICollection (const ICollection &)
 Copy constructor. More...
 
 ICollection (ICollection &&)
 Move constructor. More...
 
virtual ~ICollection ()
 Destructor. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () ASPOSE_CONST
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Protected Member Functions

bool get_AnnotationsAdded ()
 
 PageCollection (System::SharedPtr< Document > document)
 Constructor of PageCollection class. More...
 
System::SharedPtr< PageGetUnrestricted (int32_t index)
 Returns page by its index. Page More...
 
System::SharedPtr< PageInsert (int32_t pageNumber, System::SharedPtr< Page > entity, System::SharedPtr< Copier > copier)
 Inserts page into document using specified copier. More...
 
System::SharedPtr< PageAdd (System::SharedPtr< Page > entity, System::SharedPtr< Copier > copier)
 Adds page to document using passed copier object. More...
 
void Add (System::SharedPtr< System::Collections::Generic::ICollection< System::SharedPtr< Page >>> pages, System::SharedPtr< Copier > copier)
 
void Dispose ()
 frees up memory More...
 
System::SharedPtr< PageFindByObjectId (int32_t objectID)
 
System::SharedPtr< PageFindByPdfObject (System::SharedPtr< Engine::Data::IPdfObject > pdfObject)
 

Protected Attributes

System::WeakPtr< Document_document
 
System::SharedPtr< System::Collections::Generic::Dictionary< int32_t, int32_t > > _usedPages
 
System::SharedPtr< Engine::CommonData::IPages > pages
 

Additional Inherited Members

- Public Types inherited from System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::Page > >
typedef System::SharedPtr< Aspose::Pdf::PageValueType
 Value type name. More...
 
typedef ICollection< System::SharedPtr< Aspose::Pdf::Page > > ThisType
 Collection type name. More...
 
- Public Types inherited from System::Collections::Generic::IEnumerable< System::SharedPtr< Aspose::Pdf::Page > >
typedef IEnumerator< System::SharedPtr< Aspose::Pdf::Page > > IEnumeratorType
 Enumerator type. More...
 
- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Detailed Description

Collection of PDF document pages.

Constructor & Destructor Documentation

◆ PageCollection()

Aspose::Pdf::PageCollection::PageCollection ( System::SharedPtr< Document document)
protected

Constructor of PageCollection class.

Parameters
documentDocument instance

Member Function Documentation

◆ Accept() [1/4]

void Aspose::Pdf::PageCollection::Accept ( System::SharedPtr< Annotations::AnnotationSelector visitor)

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

Parameters
visitorAnnotationSelector Visitor

◆ Accept() [2/4]

void Aspose::Pdf::PageCollection::Accept ( System::SharedPtr< ImagePlacementAbsorber visitor)

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

Parameters
visitorImage placement object.

◆ Accept() [3/4]

void Aspose::Pdf::PageCollection::Accept ( System::SharedPtr< Text::TextFragmentAbsorber visitor)

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

Parameters
visitorText fragment absorber object.

◆ Accept() [4/4]

void Aspose::Pdf::PageCollection::Accept ( System::SharedPtr< Text::TextAbsorber visitor)

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

Parameters
visitorText absorber object.

◆ Add() [1/6]

System::SharedPtr<Page> Aspose::Pdf::PageCollection::Add ( )

Adds empty page

Returns
Added page.

◆ Add() [2/6]

void Aspose::Pdf::PageCollection::Add ( System::SharedPtr< System::Collections::Generic::ICollection< System::SharedPtr< Page >>> const &  pages)

Adds to collection all pages from list.

Parameters
pagesList which contains all pages which must be added.

◆ Add() [3/6]

void Aspose::Pdf::PageCollection::Add ( System::ArrayPtr< System::SharedPtr< Page >> const &  pages)

Adds to collection all pages from array.

Parameters
pagesArray of pages which will be added.

◆ Add() [4/6]

void Aspose::Pdf::PageCollection::Add ( System::SharedPtr< Page > const &  entity)
virtual

Adds page to collection.

Parameters
entityPage which should be added.
Returns
Added page.

Implements System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::Page > >.

◆ Add() [5/6]

System::SharedPtr<Page> Aspose::Pdf::PageCollection::Add ( System::SharedPtr< Page entity,
System::SharedPtr< Copier >  copier 
)
protected

Adds page to document using passed copier object.

Parameters
entity
copier

◆ Add() [6/6]

void Aspose::Pdf::PageCollection::Add ( System::SharedPtr< System::Collections::Generic::ICollection< System::SharedPtr< Page >>>  pages,
System::SharedPtr< Copier >  copier 
)
protected

◆ Clear()

void Aspose::Pdf::PageCollection::Clear ( )
virtual

◆ Contains()

bool Aspose::Pdf::PageCollection::Contains ( System::SharedPtr< Page > const &  item) const
virtual

Determines whether this instance contains the object.

Parameters
itemThe item.
Returns
true if [contains] [the specified item]; otherwise, false.
Exceptions
NotSupportedException

Implements System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::Page > >.

◆ CopyPage()

System::SharedPtr<Page> Aspose::Pdf::PageCollection::CopyPage ( System::SharedPtr< Page entity)

Adds page to collection.

Parameters
entityPage which should be added.
Returns
Added page.

◆ CopyTo()

void Aspose::Pdf::PageCollection::CopyTo ( System::ArrayPtr< System::SharedPtr< Page >>  array,
int32_t  index 
)

Copyies pages into document.

Parameters
arrayArray containing Pages object to insert into document. It must be Object[] or Page[].
indexStarting index where pages will be inserted

◆ Delete() [1/3]

void Aspose::Pdf::PageCollection::Delete ( int32_t  index)

Delete specified page.

Parameters
indexNumber of page that will be deleted. Pages numbers start from 1.

◆ Delete() [2/3]

void Aspose::Pdf::PageCollection::Delete ( )

Deletes all pages from collection.

◆ Delete() [3/3]

void Aspose::Pdf::PageCollection::Delete ( System::ArrayPtr< int32_t >  pages)

Delete pages specified which numbers are specified in array.

Parameters
pagesArray of pages to be deleted.

◆ Dispose()

void Aspose::Pdf::PageCollection::Dispose ( )
protected

frees up memory

◆ FindByObjectId()

System::SharedPtr<Page> Aspose::Pdf::PageCollection::FindByObjectId ( int32_t  objectID)
protected

◆ FindByPdfObject()

System::SharedPtr<Page> Aspose::Pdf::PageCollection::FindByPdfObject ( System::SharedPtr< Engine::Data::IPdfObject >  pdfObject)
protected

◆ Flatten()

void Aspose::Pdf::PageCollection::Flatten ( )

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

◆ FreeMemory()

void Aspose::Pdf::PageCollection::FreeMemory ( )
virtual

Clears cached data

Implements Aspose::Pdf::ISupportsMemoryCleanup.

◆ get_AnnotationsAdded()

bool Aspose::Pdf::PageCollection::get_AnnotationsAdded ( )
protected

◆ get_Count()

int32_t Aspose::Pdf::PageCollection::get_Count ( ) const
virtual

◆ get_IsReadOnly()

bool Aspose::Pdf::PageCollection::get_IsReadOnly ( ) const
virtual

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

Reimplemented from System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::Page > >.

◆ get_IsSynchronized()

bool Aspose::Pdf::PageCollection::get_IsSynchronized ( )

Returns true of object is synchorinzed.

◆ get_SyncRoot()

System::SharedPtr<System::Object> Aspose::Pdf::PageCollection::get_SyncRoot ( )

Gets synchronization object of the collection.

◆ GetEnumerator()

System::SharedPtr<System::Collections::Generic::IEnumerator<System::SharedPtr<Page> > > Aspose::Pdf::PageCollection::GetEnumerator ( )
virtual

Returns enumerator of pages.

Returns
Enumerator of pages

Implements System::Collections::Generic::IEnumerable< System::SharedPtr< Aspose::Pdf::Page > >.

◆ GetUnrestricted()

System::SharedPtr<Page> Aspose::Pdf::PageCollection::GetUnrestricted ( int32_t  index)
protected

Returns page by its index. Page

Parameters
indexIndex of requested page. Pages are numbered from 1.
Returns
Requested page

◆ idx_get()

System::SharedPtr<Page> Aspose::Pdf::PageCollection::idx_get ( int32_t  index)

Gets page by index.

Parameters
indexIndex of page.
Returns
Retreived page.

◆ IndexOf()

int32_t Aspose::Pdf::PageCollection::IndexOf ( System::SharedPtr< Page entity)

Returns index of the specified page.

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

Parameters
entityPage object. Pages numbers start from 1.
Returns
Index of the page in collection.

◆ Insert() [1/5]

System::SharedPtr<Page> Aspose::Pdf::PageCollection::Insert ( int32_t  pageNumber)

Insert empty apge into collection at the specified position.

Parameters
pageNumberPosition of the new page.
Returns
Inserted page.

◆ Insert() [2/5]

System::SharedPtr<Page> Aspose::Pdf::PageCollection::Insert ( int32_t  pageNumber,
System::SharedPtr< Page entity 
)

Inserts page into page collection at specified place.

Parameters
pageNumberRequired page index in collection.
entityPage to be inserted.
Returns
Inserted page.

◆ Insert() [3/5]

void Aspose::Pdf::PageCollection::Insert ( int32_t  pageNumber,
System::SharedPtr< System::Collections::Generic::ICollection< System::SharedPtr< Page >>>  pages 
)

Inserts pages from the collection into document.

Parameters
pageNumberStarting position of the new pages.
pagesPages collection.

◆ Insert() [4/5]

void Aspose::Pdf::PageCollection::Insert ( int32_t  pageNumber,
System::ArrayPtr< System::SharedPtr< Page >>  pages 
)

Inserts pages of the array into document.

Parameters
pageNumberStarting number of the new pages.
pagesArray of pages which will be inserted.

◆ Insert() [5/5]

System::SharedPtr<Page> Aspose::Pdf::PageCollection::Insert ( int32_t  pageNumber,
System::SharedPtr< Page entity,
System::SharedPtr< Copier >  copier 
)
protected

Inserts page into document using specified copier.

Parameters
pageNumberStarting position of the new pages.
entityPage to be inserted.
copierCopier object.

◆ Remove()

bool Aspose::Pdf::PageCollection::Remove ( System::SharedPtr< Page > const &  item)
virtual

Removes the specified item.

Parameters
itemThe item.
Returns
Exceptions
NotSupportedException

Implements System::Collections::Generic::ICollection< System::SharedPtr< Aspose::Pdf::Page > >.

Member Data Documentation

◆ _document

System::WeakPtr<Document> Aspose::Pdf::PageCollection::_document
protected

◆ _usedPages

System::SharedPtr<System::Collections::Generic::Dictionary<int32_t, int32_t> > Aspose::Pdf::PageCollection::_usedPages
protected

◆ pages

System::SharedPtr<Engine::CommonData::IPages> Aspose::Pdf::PageCollection::pages
protected