Aspose::Pdf::Facades::PdfPageEditor Class Referencefinal

Represents a class to edit the PDF file's page, including rotating page, zooming page, moving position and changing page size. More...

Inherits Aspose::Pdf::Facades::SaveableFacade.

Public Member Functions

int32_t get_TransitionDuration ()
 Gets duration of the transition effect. More...
 
void set_TransitionDuration (int32_t value)
 Sets duration of the transition effect. More...
 
int32_t get_TransitionType ()
 Gets transition style to use when moving to this page from another during a presentation. More...
 
void set_TransitionType (int32_t value)
 Sets transition style to use when moving to this page from another during a presentation. More...
 
int32_t get_DisplayDuration ()
 Gets display duration for pages. More...
 
void set_DisplayDuration (int32_t value)
 Sets display duration for pages. More...
 
System::ArrayPtr< int32_t > get_ProcessPages ()
 Gets the page numbers to be edited. By default, each page would be edited. More...
 
void set_ProcessPages (System::ArrayPtr< int32_t > value)
 Sets the page numbers to be edited. By default, each page would be edited. More...
 
int32_t get_Rotation ()
 Gets the rotation of the pages, the rotation must be 0, 90, 180 or 270. Default value is 0. More...
 
void set_Rotation (int32_t value)
 Sets the rotation of the pages, the rotation must be 0, 90, 180 or 270. Default value is 0. More...
 
System::SharedPtr< System::Collections::Generic::Dictionary< int32_t, int32_t > > get_PageRotations ()
 A hashtable contains the page number and rotation degree, the key represents the page number, the value of key represents the rotation in degrees. More...
 
void set_PageRotations (System::SharedPtr< System::Collections::Generic::Dictionary< int32_t, int32_t >> value)
 A hashtable contains the page number and rotation degree, the key represents the page number, the value of key represents the rotation in degrees. More...
 
float get_Zoom ()
 Get or sets zoom coefficient. Value 1.0 corresponds to 100%. Default value is 1.0. The following example demonstrates how to change zoom of the document pages.

editor.BindPdf("sample.pdf");
editor.Zoom = 0.5f;
More...
 
void set_Zoom (float value)
 Get or sets zoom coefficient. Value 1.0 corresponds to 100%. Default value is 1.0. The following example demonstrates how to change zoom of the document pages.

editor.BindPdf("sample.pdf");
editor.Zoom = 0.5f;
More...
 
System::SharedPtr< Aspose::Pdf::PageSizeget_PageSize ()
 Gets the output file's page size. More...
 
void set_PageSize (System::SharedPtr< Aspose::Pdf::PageSize > value)
 Sets the output file's page size. More...
 
Aspose::Pdf::HorizontalAlignment get_HorizontalAlignment ()
 Gets the horizontal alignment of the original PDF content on the result page, default is AlignmentType.Left. More...
 
void set_HorizontalAlignment (Aspose::Pdf::HorizontalAlignment value)
 Sets the horizontal alignment of the original PDF content on the result page, default is AlignmentType.Left. More...
 
Aspose::Pdf::VerticalAlignment get_VerticalAlignmentType ()
 Gets or Sets the vertical alignment of the original PDF content on the result page, default is VerticalAlignmentType.Bottom. More...
 
void set_VerticalAlignmentType (Aspose::Pdf::VerticalAlignment value)
 Gets or Sets the vertical alignment of the original PDF content on the result page, default is VerticalAlignmentType.Bottom. More...
 
 PdfPageEditor ()
 Constructor for PdfPageEditor class. More...
 
 PdfPageEditor (System::SharedPtr< Aspose::Pdf::Document > document)
 Constructor for PdfPageEditor class. More...
 
void MovePosition (float moveX, float moveY)
 Moves the origin from (0, 0) to the point that appointted. The origin is left-bottom and the unit is point(1 inch = 72 points). More...
 
int32_t GetPages ()
 Returns total number of pages. More...
 
System::SharedPtr< Aspose::Pdf::PageSizeGetPageSize (int32_t page)
 Returns the page size of the specified page. More...
 
int32_t GetPageRotation (int32_t page)
 Returns the rotation of specified page. More...
 
System::Drawing::Rectangle GetPageBoxSize (int32_t page, System::String pageBoxName)
 Returns size of specified box in document. More...
 
virtual void Save (System::String outputFile)
 Saves changed document into file. More...
 
virtual void Save (System::SharedPtr< System::IO::Stream > outputStream)
 Saves changed document into stream. More...
 
void ApplyChanges ()
 Apply changes made to the document pages. More...
 
- Public Member Functions inherited from Aspose::Pdf::Facades::Facade
System::SharedPtr< Aspose::Pdf::Documentget_Document () const
 Gets the document facade is working on. More...
 
virtual void BindPdf (System::String srcFile)
 Initializes the facade. More...
 
virtual void BindPdf (System::SharedPtr< System::IO::Stream > srcStream)
 Initializes the facade. More...
 
virtual void BindPdf (System::SharedPtr< Aspose::Pdf::Document > srcDoc)
 Initializes the facade. More...
 
virtual void Close ()
 Disposes Aspose.Pdf.Document bound with a facade. More...
 
void Dispose ()
 Disposes the facade. More...
 
- Public Member Functions inherited from Aspose::Pdf::Facades::IFacade
virtual void BindPdf (System::SharedPtr< Document > srcDoc)=0
 Binds PDF document for editing. 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)
 

Static Public Attributes

static constexpr int32_t SPLITVOUT = 1
 
static constexpr int32_t SPLITHOUT = 2
 
static constexpr int32_t SPLITVIN = 3
 
static constexpr int32_t SPLITHIN = 4
 
static constexpr int32_t BLINDV = 5
 
static constexpr int32_t BLINDH = 6
 
static constexpr int32_t INBOX = 7
 
static constexpr int32_t OUTBOX = 8
 
static constexpr int32_t LRWIPE = 9
 
static constexpr int32_t RLWIPE = 10
 
static constexpr int32_t BTWIPE = 11
 
static constexpr int32_t TBWIPE = 12
 
static constexpr int32_t DISSOLVE = 13
 
static constexpr int32_t LRGLITTER = 14
 
static constexpr int32_t TBGLITTER = 15
 
static constexpr int32_t DGLITTER = 16
 

Additional Inherited Members

- 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...
 
- Protected Member Functions inherited from Aspose::Pdf::Facades::SaveableFacade
 SaveableFacade ()
 The constructor. More...
 
 SaveableFacade (System::SharedPtr< Aspose::Pdf::Document > srcDoc)
 The constructor. More...
 
- Protected Member Functions inherited from Aspose::Pdf::Facades::Facade
 Facade ()
 The constructor. More...
 
 Facade (System::SharedPtr< Aspose::Pdf::Document > srcDoc)
 The constructor. More...
 
virtual void BindPdf (System::String srcFile, System::String password)
 Initializes the facade. More...
 
virtual void BindPdf (System::SharedPtr< System::IO::Stream > srcStream, System::String password)
 Initializes the facade. More...
 
virtual void AssertDocument () const
 Asserts if the facade is initialized. More...
 

Detailed Description

Represents a class to edit the PDF file's page, including rotating page, zooming page, moving position and changing page size.

Constructor & Destructor Documentation

◆ PdfPageEditor() [1/2]

Aspose::Pdf::Facades::PdfPageEditor::PdfPageEditor ( )

Constructor for PdfPageEditor class.

◆ PdfPageEditor() [2/2]

Aspose::Pdf::Facades::PdfPageEditor::PdfPageEditor ( System::SharedPtr< Aspose::Pdf::Document document)

Constructor for PdfPageEditor class.

Parameters
documentDocument object which should be processed.

Member Function Documentation

◆ ApplyChanges()

void Aspose::Pdf::Facades::PdfPageEditor::ApplyChanges ( )

Apply changes made to the document pages.

◆ get_DisplayDuration()

int32_t Aspose::Pdf::Facades::PdfPageEditor::get_DisplayDuration ( )

Gets display duration for pages.

◆ get_HorizontalAlignment()

Aspose::Pdf::HorizontalAlignment Aspose::Pdf::Facades::PdfPageEditor::get_HorizontalAlignment ( )

Gets the horizontal alignment of the original PDF content on the result page, default is AlignmentType.Left.

◆ get_PageRotations()

System::SharedPtr<System::Collections::Generic::Dictionary<int32_t, int32_t> > Aspose::Pdf::Facades::PdfPageEditor::get_PageRotations ( )

A hashtable contains the page number and rotation degree, the key represents the page number, the value of key represents the rotation in degrees.

◆ get_PageSize()

System::SharedPtr<Aspose::Pdf::PageSize> Aspose::Pdf::Facades::PdfPageEditor::get_PageSize ( )

Gets the output file's page size.

◆ get_ProcessPages()

System::ArrayPtr<int32_t> Aspose::Pdf::Facades::PdfPageEditor::get_ProcessPages ( )

Gets the page numbers to be edited. By default, each page would be edited.

◆ get_Rotation()

int32_t Aspose::Pdf::Facades::PdfPageEditor::get_Rotation ( )

Gets the rotation of the pages, the rotation must be 0, 90, 180 or 270. Default value is 0.

◆ get_TransitionDuration()

int32_t Aspose::Pdf::Facades::PdfPageEditor::get_TransitionDuration ( )

Gets duration of the transition effect.

◆ get_TransitionType()

int32_t Aspose::Pdf::Facades::PdfPageEditor::get_TransitionType ( )

Gets transition style to use when moving to this page from another during a presentation.

◆ get_VerticalAlignmentType()

Aspose::Pdf::VerticalAlignment Aspose::Pdf::Facades::PdfPageEditor::get_VerticalAlignmentType ( )

Gets or Sets the vertical alignment of the original PDF content on the result page, default is VerticalAlignmentType.Bottom.

◆ get_Zoom()

float Aspose::Pdf::Facades::PdfPageEditor::get_Zoom ( )

Get or sets zoom coefficient. Value 1.0 corresponds to 100%. Default value is 1.0. The following example demonstrates how to change zoom of the document pages.

editor.BindPdf("sample.pdf");
editor.Zoom = 0.5f;

◆ GetPageBoxSize()

System::Drawing::Rectangle Aspose::Pdf::Facades::PdfPageEditor::GetPageBoxSize ( int32_t  page,
System::String  pageBoxName 
)

Returns size of specified box in document.

Parameters
pagePage index. Document pages are numbered from 1.
pageBoxNameBox type name. Valid values are: "art", "bleed", "crop", "media", "trim".
Returns
Rectangle which contains requested box.

The following example demonstrates how to get media box of the 1st page:

editor.BindPdf("sample.pdf");
System.Drawing.Rectangle rect = editor.GetBoxSize(1, "media");

◆ GetPageRotation()

int32_t Aspose::Pdf::Facades::PdfPageEditor::GetPageRotation ( int32_t  page)

Returns the rotation of specified page.

Parameters
pagePage index. Document pages are numbered from 1.
Returns
Page rotation in degrees.

The following example demonstrates how to get page rotation:

editor.BindPdf("sample.pdf");
int rotation = editor.GetPageSize(1);
Console.WriteLine("Rotation of 1st page : " + rotation + " degrees");

◆ GetPages()

int32_t Aspose::Pdf::Facades::PdfPageEditor::GetPages ( )

Returns total number of pages.

Returns
Number of pages.

The following example demonstrates using of GetPages() method:

editor.BindPdf("sample.pdf");
Console.WriteLine("Document has: " + editor.GetPages());

◆ GetPageSize()

System::SharedPtr<Aspose::Pdf::PageSize> Aspose::Pdf::Facades::PdfPageEditor::GetPageSize ( int32_t  page)

Returns the page size of the specified page.

Parameters
pagePage index. Document pages are numbered from 1.
Returns
Result is instance of PageSize. Use Width and Height properties of the returned object to get page width and height.

The following example demonstrates using of GetPageSize method:

editor.BindPdf("sample.pdf");
PageSize size = editor.GetPageSize(1);
Console.WriteLine("Size of 1st page : " + size.Width + " x " + size.Height);

◆ MovePosition()

void Aspose::Pdf::Facades::PdfPageEditor::MovePosition ( float  moveX,
float  moveY 
)

Moves the origin from (0, 0) to the point that appointted. The origin is left-bottom and the unit is point(1 inch = 72 points).

Parameters
moveXX-coordinate.
moveYY-coordinate.
editor.BindPdf("input.pdf");
editor.MovePosition(-100, 60);
editor.Save("moved.pdf");

◆ Save() [1/2]

virtual void Aspose::Pdf::Facades::PdfPageEditor::Save ( System::String  outputFile)
virtual

Saves changed document into file.

Parameters
outputFilePath to file where document will be saved.

The following sample demonstrates how to save changed PDF document

editor.BindPdf("sample.pdf");
editor.Zoom = 0.5f;
editor.Save("newdocument.pdf");

Reimplemented from Aspose::Pdf::Facades::SaveableFacade.

◆ Save() [2/2]

virtual void Aspose::Pdf::Facades::PdfPageEditor::Save ( System::SharedPtr< System::IO::Stream outputStream)
virtual

Saves changed document into stream.

Parameters
outputStreamStream where changed PDF document will be saved.

The following sample demonstrates how to save changed PDF document into stream.

editor.BindPdf("sample.pdf");
editor.Zoom = 0.5f;
editor.Save("newdocument.pdf");

Reimplemented from Aspose::Pdf::Facades::SaveableFacade.

◆ set_DisplayDuration()

void Aspose::Pdf::Facades::PdfPageEditor::set_DisplayDuration ( int32_t  value)

Sets display duration for pages.

◆ set_HorizontalAlignment()

void Aspose::Pdf::Facades::PdfPageEditor::set_HorizontalAlignment ( Aspose::Pdf::HorizontalAlignment  value)

Sets the horizontal alignment of the original PDF content on the result page, default is AlignmentType.Left.

◆ set_PageRotations()

void Aspose::Pdf::Facades::PdfPageEditor::set_PageRotations ( System::SharedPtr< System::Collections::Generic::Dictionary< int32_t, int32_t >>  value)

A hashtable contains the page number and rotation degree, the key represents the page number, the value of key represents the rotation in degrees.

◆ set_PageSize()

void Aspose::Pdf::Facades::PdfPageEditor::set_PageSize ( System::SharedPtr< Aspose::Pdf::PageSize value)

Sets the output file's page size.

◆ set_ProcessPages()

void Aspose::Pdf::Facades::PdfPageEditor::set_ProcessPages ( System::ArrayPtr< int32_t >  value)

Sets the page numbers to be edited. By default, each page would be edited.

◆ set_Rotation()

void Aspose::Pdf::Facades::PdfPageEditor::set_Rotation ( int32_t  value)

Sets the rotation of the pages, the rotation must be 0, 90, 180 or 270. Default value is 0.

◆ set_TransitionDuration()

void Aspose::Pdf::Facades::PdfPageEditor::set_TransitionDuration ( int32_t  value)

Sets duration of the transition effect.

◆ set_TransitionType()

void Aspose::Pdf::Facades::PdfPageEditor::set_TransitionType ( int32_t  value)

Sets transition style to use when moving to this page from another during a presentation.

◆ set_VerticalAlignmentType()

void Aspose::Pdf::Facades::PdfPageEditor::set_VerticalAlignmentType ( Aspose::Pdf::VerticalAlignment  value)

Gets or Sets the vertical alignment of the original PDF content on the result page, default is VerticalAlignmentType.Bottom.

◆ set_Zoom()

void Aspose::Pdf::Facades::PdfPageEditor::set_Zoom ( float  value)

Get or sets zoom coefficient. Value 1.0 corresponds to 100%. Default value is 1.0. The following example demonstrates how to change zoom of the document pages.

editor.BindPdf("sample.pdf");
editor.Zoom = 0.5f;

Member Data Documentation

◆ BLINDH

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::BLINDH = 6
static

◆ BLINDV

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::BLINDV = 5
static

◆ BTWIPE

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::BTWIPE = 11
static

◆ DGLITTER

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::DGLITTER = 16
static

◆ DISSOLVE

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::DISSOLVE = 13
static

◆ INBOX

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::INBOX = 7
static

◆ LRGLITTER

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::LRGLITTER = 14
static

◆ LRWIPE

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::LRWIPE = 9
static

◆ OUTBOX

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::OUTBOX = 8
static

◆ RLWIPE

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::RLWIPE = 10
static

◆ SPLITHIN

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::SPLITHIN = 4
static

◆ SPLITHOUT

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::SPLITHOUT = 2
static

◆ SPLITVIN

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::SPLITVIN = 3
static

◆ SPLITVOUT

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::SPLITVOUT = 1
static

◆ TBGLITTER

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::TBGLITTER = 15
static

◆ TBWIPE

constexpr int32_t Aspose::Pdf::Facades::PdfPageEditor::TBWIPE = 12
static