Aspose::Pdf::Facades::Stamp Class Referencefinal

Class represeting stamp. More...

Inherits System::Object.

Public Member Functions

int32_t get_StampId ()
 Gets identifier of stamp. More...
 
void set_StampId (int32_t value)
 Sets identifier of stamp. More...
 
int32_t get_Quality ()
 Gets quality of image stamp in percent. Valiued values 0..100%. More...
 
void set_Quality (int32_t value)
 Sets quality of image stamp in percent. Valiued values 0..100%. More...
 
float get_Opacity ()
 Gets opacity of the stamp. More...
 
void set_Opacity (float value)
 Sets opacity of the stamp. More...
 
int32_t get_PageNumber ()
 Gets page number. More...
 
void set_PageNumber (int32_t value)
 Sets page number. More...
 
System::ArrayPtr< int32_t > get_Pages ()
 Gets array with numbers of pages which will be affected by stamp. If Pages = null all pages of the document are affected. More...
 
void set_Pages (System::ArrayPtr< int32_t > value)
 Sets array with numbers of pages which will be affected by stamp. If Pages = null all pages of the document are affected. More...
 
float get_Rotation ()
 Gets rotation of the stamp in degrees. More...
 
void set_Rotation (float value)
 Sets rotation of the stamp in degrees. More...
 
bool get_IsBackground ()
 Gets background status. If true stamp will be placed as background of the spamped page. By default is set to false. More...
 
void set_IsBackground (bool value)
 Sets background status. If true stamp will be placed as background of the spamped page. By default is set to false. More...
 
BlendingColorSpace get_BlendingSpace ()
 Gets a BlendingColorSpace value that defines a color space that is used to perform transparency and blending operations on the page. More...
 
void set_BlendingSpace (BlendingColorSpace value)
 Sets a BlendingColorSpace value that defines a color space that is used to perform transparency and blending operations on the page. More...
 
 Stamp ()
 Constructor for Stamp object. More...
 
void BindPdf (System::String pdfFile, int32_t pageNumber)
 Sets PDF file and number of page which will be used as stamp. More...
 
void BindPdf (System::SharedPtr< System::IO::Stream > pdfStream, int32_t pageNumber)
 Sets PDF file and number of page which will be used as stamp. More...
 
void BindImage (System::String imageFile)
 Sets image as a stamp. More...
 
void BindLogo (System::SharedPtr< FormattedText > formattedText)
 Sets text as stamp. More...
 
void BindTextState (System::SharedPtr< Aspose::Pdf::Text::TextState > textState)
 Sets text state of stamp text. More...
 
void SetOrigin (float originX, float originY)
 Sets position on page where stamp will be placed. More...
 
void SetImageSize (float width, float height)
 Sets size of image stamp. Image will be scaled according to the specified values. More...
 
void BindImage (System::SharedPtr< System::IO::Stream > image)
 Sets image which will be used as stamp. 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

System::SharedPtr< Aspose::Pdf::Stamptranslate ()
 Translates Stamp into corresponding Aspose.Pdf.Stamp descendant (TextStamp / ImageStamp / PdfPageStamp ) More...
 

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...
 

Detailed Description

Class represeting stamp.

Constructor & Destructor Documentation

◆ Stamp()

Aspose::Pdf::Facades::Stamp::Stamp ( )

Constructor for Stamp object.

Member Function Documentation

◆ BindImage() [1/2]

void Aspose::Pdf::Facades::Stamp::BindImage ( System::String  imageFile)

Sets image as a stamp.

Parameters
imageFileImage file name and path.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Stamp stamp = new Stamp();
stamp.BindImage("image.jpg");
fileStamp.AddStamp(stamp);
fileStamp.Close();

◆ BindImage() [2/2]

void Aspose::Pdf::Facades::Stamp::BindImage ( System::SharedPtr< System::IO::Stream image)

Sets image which will be used as stamp.

Parameters
imageStream which contains image data.

◆ BindLogo()

void Aspose::Pdf::Facades::Stamp::BindLogo ( System::SharedPtr< FormattedText formattedText)

Sets text as stamp.

Parameters
formattedTextFormattedText object which specifies text and text properties.

◆ BindPdf() [1/2]

void Aspose::Pdf::Facades::Stamp::BindPdf ( System::String  pdfFile,
int32_t  pageNumber 
)

Sets PDF file and number of page which will be used as stamp.

Parameters
pdfFilePath to PDF file.
pageNumberNumber of page in PDF file
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Stamp stamp = new Stamp();
//First page will be used as stamp.
stamp.BindPdf("stamp.pdf", 1);
stamp.IsBackground = true;
fileStamp.AddStamp(stamp);
fileStamp.Close();

◆ BindPdf() [2/2]

void Aspose::Pdf::Facades::Stamp::BindPdf ( System::SharedPtr< System::IO::Stream pdfStream,
int32_t  pageNumber 
)

Sets PDF file and number of page which will be used as stamp.

Parameters
pdfStreamStream which contains PDF document.
pageNumberPage index of the document whihc will be used as stamp.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Stamp stamp = new Stamp();
//First page will be used as stamp.
Stream stream = new FileStream("stamp.pdf", FileMode.Open, FileAccess.Read);
stamp.BindPdf(stream, 1);
fileStamp.AddStamp(stamp);
fileStamp.Close();

◆ BindTextState()

void Aspose::Pdf::Facades::Stamp::BindTextState ( System::SharedPtr< Aspose::Pdf::Text::TextState textState)

Sets text state of stamp text.

Parameters
textStateTextState object which specifies text properties.

◆ get_BlendingSpace()

BlendingColorSpace Aspose::Pdf::Facades::Stamp::get_BlendingSpace ( )

Gets a BlendingColorSpace value that defines a color space that is used to perform transparency and blending operations on the page.

◆ get_IsBackground()

bool Aspose::Pdf::Facades::Stamp::get_IsBackground ( )

Gets background status. If true stamp will be placed as background of the spamped page. By default is set to false.

///

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Stamp stamp = new Stamp();
stamp.BindLogo(new FormattedText("STAMP"));
stamp.IsBackground = true;
fileStamp.AddStamp(stamp);
fileStamp.Close();

◆ get_Opacity()

float Aspose::Pdf::Facades::Stamp::get_Opacity ( )

Gets opacity of the stamp.

◆ get_PageNumber()

int32_t Aspose::Pdf::Facades::Stamp::get_PageNumber ( )

Gets page number.

◆ get_Pages()

System::ArrayPtr<int32_t> Aspose::Pdf::Facades::Stamp::get_Pages ( )

Gets array with numbers of pages which will be affected by stamp. If Pages = null all pages of the document are affected.

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Stamp stamp = new Aspose.Pdf.Facades.Stamp();
stamp.BindLogo(new FormattedText(text));
//put stamp only on 1st, 4th and 6th page.
stamp.Pages = new int[] { 1, 4, 6 };
fileStamp.AddStamp(stamp);
fileStamp.Close();

◆ get_Quality()

int32_t Aspose::Pdf::Facades::Stamp::get_Quality ( )

Gets quality of image stamp in percent. Valiued values 0..100%.

◆ get_Rotation()

float Aspose::Pdf::Facades::Stamp::get_Rotation ( )

Gets rotation of the stamp in degrees.

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Stamp stamp = new Stamp();
stamp.BindLogo(new FormattedText("STAMP"));
stamp.Rotation = 90;
fileStamp.AddStamp(stamp);
fileStamp.Close();

◆ get_StampId()

int32_t Aspose::Pdf::Facades::Stamp::get_StampId ( )

Gets identifier of stamp.

◆ set_BlendingSpace()

void Aspose::Pdf::Facades::Stamp::set_BlendingSpace ( BlendingColorSpace  value)

Sets a BlendingColorSpace value that defines a color space that is used to perform transparency and blending operations on the page.

◆ set_IsBackground()

void Aspose::Pdf::Facades::Stamp::set_IsBackground ( bool  value)

Sets background status. If true stamp will be placed as background of the spamped page. By default is set to false.

///

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Stamp stamp = new Stamp();
stamp.BindLogo(new FormattedText("STAMP"));
stamp.IsBackground = true;
fileStamp.AddStamp(stamp);
fileStamp.Close();

◆ set_Opacity()

void Aspose::Pdf::Facades::Stamp::set_Opacity ( float  value)

Sets opacity of the stamp.

◆ set_PageNumber()

void Aspose::Pdf::Facades::Stamp::set_PageNumber ( int32_t  value)

Sets page number.

◆ set_Pages()

void Aspose::Pdf::Facades::Stamp::set_Pages ( System::ArrayPtr< int32_t >  value)

Sets array with numbers of pages which will be affected by stamp. If Pages = null all pages of the document are affected.

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Stamp stamp = new Aspose.Pdf.Facades.Stamp();
stamp.BindLogo(new FormattedText(text));
//put stamp only on 1st, 4th and 6th page.
stamp.Pages = new int[] { 1, 4, 6 };
fileStamp.AddStamp(stamp);
fileStamp.Close();

◆ set_Quality()

void Aspose::Pdf::Facades::Stamp::set_Quality ( int32_t  value)

Sets quality of image stamp in percent. Valiued values 0..100%.

◆ set_Rotation()

void Aspose::Pdf::Facades::Stamp::set_Rotation ( float  value)

Sets rotation of the stamp in degrees.

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Stamp stamp = new Stamp();
stamp.BindLogo(new FormattedText("STAMP"));
stamp.Rotation = 90;
fileStamp.AddStamp(stamp);
fileStamp.Close();

◆ set_StampId()

void Aspose::Pdf::Facades::Stamp::set_StampId ( int32_t  value)

Sets identifier of stamp.

◆ SetImageSize()

void Aspose::Pdf::Facades::Stamp::SetImageSize ( float  width,
float  height 
)

Sets size of image stamp. Image will be scaled according to the specified values.

Parameters
widthImage width.
heightImage height.

◆ SetOrigin()

void Aspose::Pdf::Facades::Stamp::SetOrigin ( float  originX,
float  originY 
)

Sets position on page where stamp will be placed.

Parameters
originXX coordinate of the stamp.
originYY coordinate of the stamp.

◆ translate()

System::SharedPtr<Aspose::Pdf::Stamp> Aspose::Pdf::Facades::Stamp::translate ( )
protected

Translates Stamp into corresponding Aspose.Pdf.Stamp descendant (TextStamp / ImageStamp / PdfPageStamp )

Returns