Aspose::Pdf::Facades::PdfFileStamp Class Referencefinal

Class for adding stamps (watermark or background) to PDF files. More...

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

Public Member Functions

bool get_OptimizeSize ()
 Gets optimization flag. Equal resource streams in resultant file are merged into one PDF object if this flag set. This allows to decrease resultant file size but may cause slower execution and larger memory requirements. Default value: false. More...
 
void set_OptimizeSize (bool value)
 Sets optimization flag. Equal resource streams in resultant file are merged into one PDF object if this flag set. This allows to decrease resultant file size but may cause slower execution and larger memory requirements. Default value: false. More...
 
bool get_KeepSecurity ()
 Keeps security if true. (This feature will be implemented in next versions). More...
 
void set_KeepSecurity (bool value)
 Keeps security if true. (This feature will be implemented in next versions). More...
 
System::String get_InputFile ()
 Gets name and path of input file. More...
 
void set_InputFile (System::String value)
 Sets name and path of input file. More...
 
System::SharedPtr< System::IO::Streamget_InputStream ()
 Gets input stream. More...
 
void set_InputStream (System::SharedPtr< System::IO::Stream > value)
 Sets input stream. More...
 
System::String get_OutputFile ()
 Gets name and path of output file. More...
 
void set_OutputFile (System::String value)
 Sets name and path of output file. More...
 
System::SharedPtr< System::IO::Streamget_OutputStream ()
 Gets output stream. More...
 
void set_OutputStream (System::SharedPtr< System::IO::Stream > value)
 Sets output stream. More...
 
float get_PageNumberRotation ()
 Gets rotation of page number. Rotation is in degrees. Default is 0. More...
 
void set_PageNumberRotation (float value)
 Sets rotation of page number. Rotation is in degrees. Default is 0. More...
 
void set_ConvertTo (PdfFormat value)
 Sets PDF file format. Result file will be saved in specified file format. If this property is not specified then file will be save in default PDF format without conversion. More...
 
float get_PageHeight ()
 Gets height of first page in souorce file. More...
 
float get_PageWidth ()
 Gets width of first page in input file. More...
 
int32_t get_StartingNumber ()
 Gets starting number for first page in input file. Next pages will be numbered starting from this value. For example if StartingNumber is set to 100, document pages will have numbers 100, 101, 102... More...
 
void set_StartingNumber (int32_t value)
 Sets starting number for first page in input file. Next pages will be numbered starting from this value. For example if StartingNumber is set to 100, document pages will have numbers 100, 101, 102... More...
 
Aspose::Pdf::NumberingStyle get_NumberingStyle ()
 Gets pabge numbering style. Possible values: NumeralsArabic, NumeralsRomanUppercase, NumeralsRomanLowercase, LettersAppercase, LettersLowercase More...
 
void set_NumberingStyle (Aspose::Pdf::NumberingStyle value)
 Sets pabge numbering style. Possible values: NumeralsArabic, NumeralsRomanUppercase, NumeralsRomanLowercase, LettersAppercase, LettersLowercase More...
 
int32_t get_StampId ()
 Stamp ID of next added stamp (incluiding page headers/hooters/page numbers). More...
 
void set_StampId (int32_t value)
 Stamp ID of next added stamp (incluiding page headers/hooters/page numbers). More...
 
Aspose::Pdf::ContentDisposition get_ContentDisposition ()
 Gets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline. More...
 
void set_ContentDisposition (Aspose::Pdf::ContentDisposition value)
 Sets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline. More...
 
System::SharedPtr< System::Web::HttpResponseget_Response ()
 Gets Response object where result of operation will be stored. More...
 
void set_Response (System::SharedPtr< System::Web::HttpResponse > value)
 Sets Response object where result of operation will be stored. More...
 
System::SharedPtr< Aspose::Pdf::SaveOptionsget_SaveOptions ()
 Gets save options when result is stored as HttpResponse. Default value: PdfSaveOptions. More...
 
void set_SaveOptions (System::SharedPtr< Aspose::Pdf::SaveOptions > value)
 Sets save options when result is stored as HttpResponse. Default value: PdfSaveOptions. More...
 
System::String get_AttachmentName ()
 Gets name of attachment when result of operation is stored into HttpResponse objects as attachment. More...
 
void set_AttachmentName (System::String value)
 Sets name of attachment when result of operation is stored into HttpResponse objects as attachment. More...
 
 PdfFileStamp (System::String inputFile, System::String outputFile)
 Constructor for PdfFileStamp. More...
 
 PdfFileStamp (System::SharedPtr< System::IO::Stream > inputStream, System::SharedPtr< System::IO::Stream > outputStream)
 Constructor for PdfFileStamp. More...
 
 PdfFileStamp (System::String inputFile, System::String outputFile, bool keepSecurity)
 Constructor for PdfFileStamp. More...
 
 PdfFileStamp (System::SharedPtr< System::IO::Stream > inputStream, System::SharedPtr< System::IO::Stream > outputStream, bool keepSecurity)
 Constructor of PdfFileStamp. More...
 
virtual void Close ()
 Closes opened files and saves changes. Warning. If input or output streams are specified they are not closed by Close() method. More...
 
virtual void Save (System::String destFile)
 Saves result into specified file. More...
 
virtual void Save (System::SharedPtr< System::IO::Stream > destStream)
 Saves document into specified stream. More...
 
void AddStamp (System::SharedPtr< Stamp > stamp)
 Adds stamp to the file. More...
 
void AddPageNumber (System::String formatString)
 Add page number to file. Page number text may contain # sign which will be replaced with number of the page. Page number is placed in the bottom of the page centered horizontally. More...
 
void AddPageNumber (System::SharedPtr< FormattedText > formattedText)
 Adds page number to the page. Page number may contain # sign which will be replaced with page number. Page number is placed in the bottom of the page centered horizontally. More...
 
void AddPageNumber (System::String formatString, int32_t position, float leftMargin, float rightMargin, float topMargin, float bottomMargin)
 Adds page number to the pages of document. More...
 
void AddPageNumber (System::String formatString, float x, float y)
 Adds page number at the specified position on the page. More...
 
void AddPageNumber (System::SharedPtr< FormattedText > formattedText, int32_t position, float leftMargin, float rightMargin, float topMargin, float bottomMargin)
 Adds page number to the pages of document. More...
 
void AddPageNumber (System::SharedPtr< FormattedText > formattedText, float x, float y)
 Adds page number at the specified position on the page. More...
 
void AddHeader (System::SharedPtr< FormattedText > formattedText, float topMargin)
 Adds header to the page. More...
 
void AddHeader (System::SharedPtr< FormattedText > formattedText, float topMargin, float leftMargin, float rightMargin)
 Adds header to the pages of file. More...
 
void AddHeader (System::String imageFile, float topMargin)
 Adds image as header to the pages of the file. More...
 
void AddHeader (System::String imageFile, float topMargin, float leftMargin, float rightMargin)
 Adds image as header on the pages. More...
 
void AddHeader (System::SharedPtr< System::IO::Stream > imageStream, float topMargin)
 Adds image as header on the pages. More...
 
void AddHeader (System::SharedPtr< System::IO::Stream > inputStream, float topMargin, float leftMargin, float rightMargin)
 Adds image at the top of the page. More...
 
void AddFooter (System::SharedPtr< FormattedText > formattedText, float bottomMargin)
 Adds footer to the pages of the document. More...
 
void AddFooter (System::SharedPtr< FormattedText > formattedText, float bottomMargin, float leftMargin, float rightMargin)
 Adds footer to the pages of the document. More...
 
void AddFooter (System::String imageFile, float bottomMargin)
 Adds image as footer to the pages of the document. More...
 
void AddFooter (System::String imageFile, float bottomMargin, float leftMargin, float rightMargin)
 Adds image as footer of the pages. More...
 
void AddFooter (System::SharedPtr< System::IO::Stream > imageStream, float bottomMargin)
 Adds image as footer of the page. More...
 
void AddFooter (System::SharedPtr< System::IO::Stream > imageStream, float bottomMargin, float leftMargin, float rightMargin)
 Adds image as footer of the page. More...
 
void AddPageNumber (System::String formatString, int32_t position)
 Adds page number to the pages. More...
 
void AddPageNumber (System::SharedPtr< FormattedText > formattedText, int32_t position)
 Adds page number to the pages. More...
 
 PdfFileStamp ()
 Constructor of the PdfFileStamp. Input file and output file may be specified via corresponding properties.
PdfFileStamp fileStamp = new PdfFileStamp();
fileStamp.InputFile = "input.pdf";
fileStamp.OutputFile = "output.pdf";
More...
 
 PdfFileStamp (System::SharedPtr< Aspose::Pdf::Document > document)
 Initializes new PdfFileStamp object on base of the document . More...
 
 PdfFileStamp (System::SharedPtr< Aspose::Pdf::Document > document, System::String outputFile)
 Initializes new PdfFileStamp object on base of the document . More...
 
 PdfFileStamp (System::SharedPtr< Aspose::Pdf::Document > document, System::SharedPtr< System::IO::Stream > outputStream)
 Initializes new PdfFileStamp object on base of the document . More...
 
 PdfFileStamp (System::SharedPtr< System::IO::Stream > inputStream, System::SharedPtr< System::Web::HttpResponse > response)
 Creates PdfFileStamp which will save result into HttpResponse object. More...
 
 PdfFileStamp (System::String inputFile, System::SharedPtr< System::Web::HttpResponse > response)
 Creates PdfFileStamp which will save result into HttpResponse object. 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...
 
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 const int32_t PosBottomMiddle
 
static const int32_t PosBottomRight
 
static const int32_t PosUpperRight
 
static const int32_t PosSidesRight
 
static const int32_t PosUpperMiddle
 
static const int32_t PosBottomLeft
 
static const int32_t PosSidesLeft
 
static const int32_t PosUpperLeft
 

Protected Member Functions

void ApplyStamp (System::SharedPtr< Stamp > stamp)
 
- 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...
 

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 for adding stamps (watermark or background) to PDF files.

Constructor & Destructor Documentation

◆ PdfFileStamp() [1/10]

Aspose::Pdf::Facades::PdfFileStamp::PdfFileStamp ( System::String  inputFile,
System::String  outputFile 
)

Constructor for PdfFileStamp.

Deprecated:
Use constructor without destination.
Parameters
inputFileInput file name and path.
outputFileOutput file name and path.
PdfFileStamp stamp = new PdfFileStamp("input.pdf", "output.pdf");

◆ PdfFileStamp() [2/10]

Aspose::Pdf::Facades::PdfFileStamp::PdfFileStamp ( System::SharedPtr< System::IO::Stream inputStream,
System::SharedPtr< System::IO::Stream outputStream 
)

Constructor for PdfFileStamp.

Deprecated:
Use constructor without destination.
Parameters
inputStreamInput stream.
outputStreamOutput stream.
Stream input = new FileStream("input.pdf", FileMode.Open, FileAccess.Read);
Stream output = new FileStream("output.pdf", FileMode.Creat, FileAccess.Write);
PdfFileStamp stamp = new PdfFileStamp(input, output);

◆ PdfFileStamp() [3/10]

Aspose::Pdf::Facades::PdfFileStamp::PdfFileStamp ( System::String  inputFile,
System::String  outputFile,
bool  keepSecurity 
)

Constructor for PdfFileStamp.

Deprecated:
Use constructor without destination.
Parameters
inputFileInput file name and path.
outputFileOutput file name and path.
keepSecurityKeep security if true.

◆ PdfFileStamp() [4/10]

Aspose::Pdf::Facades::PdfFileStamp::PdfFileStamp ( System::SharedPtr< System::IO::Stream inputStream,
System::SharedPtr< System::IO::Stream outputStream,
bool  keepSecurity 
)

Constructor of PdfFileStamp.

Deprecated:
Use constructor without destination.
Parameters
inputStreamInput stream.
outputStreamOutput stream.
keepSecurityKeep security if true.

◆ PdfFileStamp() [5/10]

Aspose::Pdf::Facades::PdfFileStamp::PdfFileStamp ( )

Constructor of the PdfFileStamp. Input file and output file may be specified via corresponding properties.

PdfFileStamp fileStamp = new PdfFileStamp();
fileStamp.InputFile = "input.pdf";
fileStamp.OutputFile = "output.pdf";

◆ PdfFileStamp() [6/10]

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

Initializes new PdfFileStamp object on base of the document .

Parameters
documentPdf document.

◆ PdfFileStamp() [7/10]

Aspose::Pdf::Facades::PdfFileStamp::PdfFileStamp ( System::SharedPtr< Aspose::Pdf::Document document,
System::String  outputFile 
)

Initializes new PdfFileStamp object on base of the document .

Deprecated:
Use constructor without destination.
Parameters
documentPdf document.
outputFileOutput file name and path.

◆ PdfFileStamp() [8/10]

Aspose::Pdf::Facades::PdfFileStamp::PdfFileStamp ( System::SharedPtr< Aspose::Pdf::Document document,
System::SharedPtr< System::IO::Stream outputStream 
)

Initializes new PdfFileStamp object on base of the document .

Deprecated:
Use constructor without destination.
Parameters
documentPdf document.
outputStreamOutput stream.

◆ PdfFileStamp() [9/10]

Aspose::Pdf::Facades::PdfFileStamp::PdfFileStamp ( System::SharedPtr< System::IO::Stream inputStream,
System::SharedPtr< System::Web::HttpResponse response 
)

Creates PdfFileStamp which will save result into HttpResponse object.

Deprecated:
Use constructor without destination.
Parameters
inputStreamStream with input document.
responseHttpResponse object where result will be saved.

◆ PdfFileStamp() [10/10]

Aspose::Pdf::Facades::PdfFileStamp::PdfFileStamp ( System::String  inputFile,
System::SharedPtr< System::Web::HttpResponse response 
)

Creates PdfFileStamp which will save result into HttpResponse object.

Deprecated:
Use constructor without destination.
Parameters
inputFileSource file name.
responseHttpResponse object where result will be saved.

Member Function Documentation

◆ AddFooter() [1/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddFooter ( System::SharedPtr< FormattedText formattedText,
float  bottomMargin 
)

Adds footer to the pages of the document.

Parameters
formattedTextFormattedText object which contains text of the footer and text properties.
bottomMarginMargin at the top of page.
PdfFileStamp stamp = new PdfFileStamp("input.pdf", "output.pdf");
stamp.AddFooter(new FormattedText("Foot of the page"), 10);

◆ AddFooter() [2/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddFooter ( System::SharedPtr< FormattedText formattedText,
float  bottomMargin,
float  leftMargin,
float  rightMargin 
)

Adds footer to the pages of the document.

Parameters
formattedTextFormattedText object which contains footer text and text properties.
bottomMarginMargin at the bottom of the page.
leftMarginMargin at the left side of the page.
rightMarginMargin at the right side of the page.
PdfFileStamp stamp = new PdfFileStamp("input.pdf", "output.pdf");
stamp.AddFooter(new FormattedText("Foot of the page"), 10, 50, 50);

◆ AddFooter() [3/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddFooter ( System::String  imageFile,
float  bottomMargin 
)

Adds image as footer to the pages of the document.

Parameters
imageFileImage file name and path.
bottomMarginMargin at the bottom of the page.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", output.pdf");
Stream input = new FileStream(TestSettings.GetInputFile("test.jpg"), FileMode.Open, FileAccess.Read);
fileStamp.AddFooter("image.jpg", 50);
fileStamp.Close();

◆ AddFooter() [4/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddFooter ( System::String  imageFile,
float  bottomMargin,
float  leftMargin,
float  rightMargin 
)

Adds image as footer of the pages.

Parameters
imageFileIamge file name and path.
bottomMarginMargin at the bottom of the page.
leftMarginMargin at the left side of the page.
rightMarginMargin at the right side of the page.

///

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", output.pdf");
Stream input = new FileStream(TestSettings.GetInputFile("test.jpg"), FileMode.Open, FileAccess.Read);
fileStamp.AddFooter("image.jpg", 50, 100, 100);
fileStamp.Close();

◆ AddFooter() [5/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddFooter ( System::SharedPtr< System::IO::Stream imageStream,
float  bottomMargin 
)

Adds image as footer of the page.

Parameters
imageStreamStream contains image data.
bottomMarginMargin at the bottom of the page.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", output.pdf");
Stream input = new FileStream(TestSettings.GetInputFile("test.jpg"), FileMode.Open, FileAccess.Read);
fileStamp.AddFooter(new FileStream("image.jpg", FileMode.Open, FileAccess.Read), 50);
fileStamp.Close();

◆ AddFooter() [6/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddFooter ( System::SharedPtr< System::IO::Stream imageStream,
float  bottomMargin,
float  leftMargin,
float  rightMargin 
)

Adds image as footer of the page.

Parameters
imageStreamStream contains image data.
bottomMarginMargin at the bottom of the page.
leftMarginMargin at the left side of the page.
rightMarginMargin at the right side of the page.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", output.pdf");
Stream input = new FileStream(TestSettings.GetInputFile("test.jpg"), FileMode.Open, FileAccess.Read);
fileStamp.AddFooter(new FileStream("image.jpg", FileMode.Open, FileAccess.Read), 50, 50, 50);
fileStamp.Close();

◆ AddHeader() [1/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddHeader ( System::SharedPtr< FormattedText formattedText,
float  topMargin 
)

Adds header to the page.

Parameters
formattedTextText for header and properties of the text.
topMarginMargin on the top of page.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddHeader(new FormattedText("Head of the page"), 50);
fileStamp.Close();

◆ AddHeader() [2/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddHeader ( System::SharedPtr< FormattedText formattedText,
float  topMargin,
float  leftMargin,
float  rightMargin 
)

Adds header to the pages of file.

Parameters
formattedTextFormatted text object which contains page text and its properties.
topMarginMargin on the top of the page.
leftMarginMargin on the left of the page.
rightMarginMargin on the right of the page.
PdfFileStamp stamp = new PdfFileStamp("input.pdf", "output.pdf");
stamp.AddHeader(new FormattedText("Head of the page"), 10, 50, 50);

◆ AddHeader() [3/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddHeader ( System::String  imageFile,
float  topMargin 
)

Adds image as header to the pages of the file.

Parameters
imageFilePath to the image file.
topMarginMargin at top of the page.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", output.pdf");
Stream input = new FileStream(TestSettings.GetInputFile("test.jpg"), FileMode.Open, FileAccess.Read);
fileStamp.AddHeader("image.jpg", 50);
fileStamp.Close();

◆ AddHeader() [4/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddHeader ( System::String  imageFile,
float  topMargin,
float  leftMargin,
float  rightMargin 
)

Adds image as header on the pages.

Parameters
imageFilePath to the image file.
topMarginMargin at top of the page.
leftMarginMargin at left side of the page.
rightMarginMargin at right side of the page.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", output.pdf");
Stream input = new FileStream(TestSettings.GetInputFile("test.jpg"), FileMode.Open, FileAccess.Read);
fileStamp.AddHeader("image.jpg", 50, 100, 100);
fileStamp.Close();

◆ AddHeader() [5/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddHeader ( System::SharedPtr< System::IO::Stream imageStream,
float  topMargin 
)

Adds image as header on the pages.

Parameters
imageStreamStream of the image.
topMarginMargin at top of the page.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", output.pdf");
Stream input = new FileStream(TestSettings.GetInputFile("test.jpg"), FileMode.Open, FileAccess.Read);
fileStamp.AddHeader(new FileStream("image.jpg", FileMode.Open, FileAccess.Read), 50);
fileStamp.Close();

◆ AddHeader() [6/6]

void Aspose::Pdf::Facades::PdfFileStamp::AddHeader ( System::SharedPtr< System::IO::Stream inputStream,
float  topMargin,
float  leftMargin,
float  rightMargin 
)

Adds image at the top of the page.

Parameters
inputStreamStream which contains image data.
topMarginMargin at top of the page.
leftMarginMargin at left side of the page.
rightMarginMargin at right side of the page.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", output.pdf");
Stream input = new FileStream(TestSettings.GetInputFile("test.jpg"), FileMode.Open, FileAccess.Read);
fileStamp.AddHeader(new FileStream("image.jpg", FileMode.Open, FileAccess.Read), 50, 100, 100);
fileStamp.Close();

◆ AddPageNumber() [1/8]

void Aspose::Pdf::Facades::PdfFileStamp::AddPageNumber ( System::String  formatString)

Add page number to file. Page number text may contain # sign which will be replaced with number of the page. Page number is placed in the bottom of the page centered horizontally.

Parameters
formatStringText of page number
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber("Page #");
fileStamp.Close();

◆ AddPageNumber() [2/8]

void Aspose::Pdf::Facades::PdfFileStamp::AddPageNumber ( System::SharedPtr< FormattedText formattedText)

Adds page number to the page. Page number may contain # sign which will be replaced with page number. Page number is placed in the bottom of the page centered horizontally.

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber(new FormattedText("Page #"));
fileStamp.Close();
Parameters
formattedTextFormat string for page number representes as FormattedText.

◆ AddPageNumber() [3/8]

void Aspose::Pdf::Facades::PdfFileStamp::AddPageNumber ( System::String  formatString,
int32_t  position,
float  leftMargin,
float  rightMargin,
float  topMargin,
float  bottomMargin 
)

Adds page number to the pages of document.

Parameters
formatStringFormat string for page number.
positionPosition where page number will be placed on the page. 0-bottom middle, 1-bottom right, 2-upper right, 3 - sides right, 4 - upper middle,5 - bottom left,6 - sides left,7 - upper left. You can use the following constants: PosBottomMiddle = 0, PosBottomRight = 1, PosUpperRight = 2, PosSidesRight = 3, PosUpperMiddle, PosBottomLeft = 5, PosSidesLeft, PosUpperLeft
leftMarginMargin on the left edge of the page.
rightMarginMargin on the right edge of the page.
topMarginMargin on the top edge of the page.
bottomMarginMargin on the bottom edge of the page.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber("Page #", PdfFileStamp.PosBottomLeft, 100, 100, 200, 200);
fileStamp.Close();

◆ AddPageNumber() [4/8]

void Aspose::Pdf::Facades::PdfFileStamp::AddPageNumber ( System::String  formatString,
float  x,
float  y 
)

Adds page number at the specified position on the page.

Parameters
formatStringFormat string. Format string can contain # sign which will be replaced with page number.
xX coordinate of page number.
yY coordinate of page number.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber(new FormattedText("Page #"), 123, 357);
fileStamp.Close();

◆ AddPageNumber() [5/8]

void Aspose::Pdf::Facades::PdfFileStamp::AddPageNumber ( System::SharedPtr< FormattedText formattedText,
int32_t  position,
float  leftMargin,
float  rightMargin,
float  topMargin,
float  bottomMargin 
)

Adds page number to the pages of document.

Parameters
formattedTextFormattedText object which represents page number format and properties iof the text.
positionPosition where page number will be placed on the page. 0-bottom middle, 1-bottom right, 2-upper right, 3 - sides right, 4 - upper middle,5 - bottom left,6 - sides left,7 - upper left. You can use the following constants: PosBottomMiddle = 0, PosBottomRight = 1, PosUpperRight = 2, PosSidesRight = 3, PosUpperMiddle, PosBottomLeft = 5, PosSidesLeft, PosUpperLeft
leftMarginMargin on the left edge of the page.
rightMarginMargin on the right edge of the page.
topMarginMargin on the top edge of the page.
bottomMarginMargin on the bottom edge of the page.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber(new FormattedText("Page #"), PdfFileStamp.PosBottomLeft, 100, 100, 200, 200);
fileStamp.Close();

◆ AddPageNumber() [6/8]

void Aspose::Pdf::Facades::PdfFileStamp::AddPageNumber ( System::SharedPtr< FormattedText formattedText,
float  x,
float  y 
)

Adds page number at the specified position on the page.

Parameters
formattedTextFormatted text which represents page number format and properties of the text. Format string can contain # sign which will be replaced with page number.
xX coordinate of page number.
yY coordinate of page number.
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber(new FormattedText("Page #"), 123, 357);
fileStamp.Close();

◆ AddPageNumber() [7/8]

void Aspose::Pdf::Facades::PdfFileStamp::AddPageNumber ( System::String  formatString,
int32_t  position 
)

Adds page number to the pages.

Parameters
formatStringFormat of the page number. This text may contain # which will be replaced with page number.
positionPosition where page number will be placed on the page. 0-bottom middle, 1-bottom right, 2-upper right, 3 - sides right, 4 - upper middle,5 - bottom left,6 - sides left,7 - upper left. You can use the following constants: PosBottomMiddle = 0, PosBottomRight = 1, PosUpperRight = 2, PosSidesRight = 3, PosUpperMiddle, PosBottomLeft = 5, PosSidesLeft, PosUpperLeft
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber("Page #", PdfFileStamp.PosUpperRight);
fileStamp.Close();

◆ AddPageNumber() [8/8]

void Aspose::Pdf::Facades::PdfFileStamp::AddPageNumber ( System::SharedPtr< FormattedText formattedText,
int32_t  position 
)

Adds page number to the pages.

Parameters
formattedTextFormattedText object which contains format of the page number and text properties. This text may contain # which will be replaced with page number.
positionPosition where page number will be placed on the page. 0-bottom middle, 1-bottom right, 2-upper right, 3 - sides right, 4 - upper middle,5 - bottom left,6 - sides left,7 - upper left. You can use the following constants: PosBottomMiddle = 0, PosBottomRight = 1, PosUpperRight = 2, PosSidesRight = 3, PosUpperMiddle, PosBottomLeft = 5, PosSidesLeft, PosUpperLeft
PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.AddPageNumber("Page #", PdfFileStamp.PosUpperRight);
fileStamp.Close();

◆ AddStamp()

void Aspose::Pdf::Facades::PdfFileStamp::AddStamp ( System::SharedPtr< Stamp stamp)

Adds stamp to the file.

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Stamp stamp = new Aspose.Pdf.Facades.Stamp();
stamp.SetOrigin(140, 400);
stamp.SetImageSize(50, 50);
stamp.Opacity = 0.8f;
stamp.IsBackground = true;
stamp.BindImage("image.jpg");
fileStamp.AddStamp(stamp);
fileStamp.Close();
Parameters
stampStamp object which.

◆ ApplyStamp()

void Aspose::Pdf::Facades::PdfFileStamp::ApplyStamp ( System::SharedPtr< Stamp stamp)
protected

◆ Close()

virtual void Aspose::Pdf::Facades::PdfFileStamp::Close ( )
virtual

Closes opened files and saves changes. Warning. If input or output streams are specified they are not closed by Close() method.

PdfFileStamp stamp = new PdfFileStamp("input.pdf", "output.pdf");
//do some work...
stamp.Close();

Reimplemented from Aspose::Pdf::Facades::Facade.

◆ get_AttachmentName()

System::String Aspose::Pdf::Facades::PdfFileStamp::get_AttachmentName ( )

Gets name of attachment when result of operation is stored into HttpResponse objects as attachment.

◆ get_ContentDisposition()

Aspose::Pdf::ContentDisposition Aspose::Pdf::Facades::PdfFileStamp::get_ContentDisposition ( )

Gets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline.

◆ get_InputFile()

System::String Aspose::Pdf::Facades::PdfFileStamp::get_InputFile ( )

Gets name and path of input file.

Deprecated:
Use BindPdf(inputFile) method for facade initialization.

◆ get_InputStream()

System::SharedPtr<System::IO::Stream> Aspose::Pdf::Facades::PdfFileStamp::get_InputStream ( )

Gets input stream.

Deprecated:
Use BindPdf(inputStream) method for facade initialization.

◆ get_KeepSecurity()

bool Aspose::Pdf::Facades::PdfFileStamp::get_KeepSecurity ( )

Keeps security if true. (This feature will be implemented in next versions).

◆ get_NumberingStyle()

Aspose::Pdf::NumberingStyle Aspose::Pdf::Facades::PdfFileStamp::get_NumberingStyle ( )

Gets pabge numbering style. Possible values: NumeralsArabic, NumeralsRomanUppercase, NumeralsRomanLowercase, LettersAppercase, LettersLowercase

◆ get_OptimizeSize()

bool Aspose::Pdf::Facades::PdfFileStamp::get_OptimizeSize ( )

Gets optimization flag. Equal resource streams in resultant file are merged into one PDF object if this flag set. This allows to decrease resultant file size but may cause slower execution and larger memory requirements. Default value: false.

◆ get_OutputFile()

System::String Aspose::Pdf::Facades::PdfFileStamp::get_OutputFile ( )

Gets name and path of output file.

Deprecated:
Use Save(outputFile) method for getting facade results.

◆ get_OutputStream()

System::SharedPtr<System::IO::Stream> Aspose::Pdf::Facades::PdfFileStamp::get_OutputStream ( )

Gets output stream.

Deprecated:
Use Save(outputStream) method for getting facade results.

◆ get_PageHeight()

float Aspose::Pdf::Facades::PdfFileStamp::get_PageHeight ( )

Gets height of first page in souorce file.

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Console.WriteLine("Height = " + fileStamp.PageHeight);
fileStamp.Close();

◆ get_PageNumberRotation()

float Aspose::Pdf::Facades::PdfFileStamp::get_PageNumberRotation ( )

Gets rotation of page number. Rotation is in degrees. Default is 0.

◆ get_PageWidth()

float Aspose::Pdf::Facades::PdfFileStamp::get_PageWidth ( )

Gets width of first page in input file.

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
Console.WriteLine("Width = " + fileStamp.PageWidth);
fileStamp.Close();

◆ get_Response()

System::SharedPtr<System::Web::HttpResponse> Aspose::Pdf::Facades::PdfFileStamp::get_Response ( )

Gets Response object where result of operation will be stored.

◆ get_SaveOptions()

System::SharedPtr<Aspose::Pdf::SaveOptions> Aspose::Pdf::Facades::PdfFileStamp::get_SaveOptions ( )

Gets save options when result is stored as HttpResponse. Default value: PdfSaveOptions.

◆ get_StampId()

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

Stamp ID of next added stamp (incluiding page headers/hooters/page numbers).

◆ get_StartingNumber()

int32_t Aspose::Pdf::Facades::PdfFileStamp::get_StartingNumber ( )

Gets starting number for first page in input file. Next pages will be numbered starting from this value. For example if StartingNumber is set to 100, document pages will have numbers 100, 101, 102...

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.StartingNumber = 100;
fileStamp.AddPageNumber("Page #");
fileStamp.Close();

◆ Save() [1/2]

virtual void Aspose::Pdf::Facades::PdfFileStamp::Save ( System::String  destFile)
virtual

Saves result into specified file.

Parameters
destFilePath to file where document will be saved.

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

◆ Save() [2/2]

virtual void Aspose::Pdf::Facades::PdfFileStamp::Save ( System::SharedPtr< System::IO::Stream destStream)
virtual

Saves document into specified stream.

Parameters
destStreamStream where document will be saved.

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

◆ set_AttachmentName()

void Aspose::Pdf::Facades::PdfFileStamp::set_AttachmentName ( System::String  value)

Sets name of attachment when result of operation is stored into HttpResponse objects as attachment.

◆ set_ContentDisposition()

void Aspose::Pdf::Facades::PdfFileStamp::set_ContentDisposition ( Aspose::Pdf::ContentDisposition  value)

Sets how content will be stored when result of operation is stored into HttpResponse object. Possible value: inline / attachment. Default: inline.

◆ set_ConvertTo()

void Aspose::Pdf::Facades::PdfFileStamp::set_ConvertTo ( PdfFormat  value)

Sets PDF file format. Result file will be saved in specified file format. If this property is not specified then file will be save in default PDF format without conversion.

◆ set_InputFile()

void Aspose::Pdf::Facades::PdfFileStamp::set_InputFile ( System::String  value)

Sets name and path of input file.

Deprecated:
Use BindPdf(inputFile) method for facade initialization.

◆ set_InputStream()

void Aspose::Pdf::Facades::PdfFileStamp::set_InputStream ( System::SharedPtr< System::IO::Stream value)

Sets input stream.

Deprecated:
Use BindPdf(inputStream) method for facade initialization.

◆ set_KeepSecurity()

void Aspose::Pdf::Facades::PdfFileStamp::set_KeepSecurity ( bool  value)

Keeps security if true. (This feature will be implemented in next versions).

◆ set_NumberingStyle()

void Aspose::Pdf::Facades::PdfFileStamp::set_NumberingStyle ( Aspose::Pdf::NumberingStyle  value)

Sets pabge numbering style. Possible values: NumeralsArabic, NumeralsRomanUppercase, NumeralsRomanLowercase, LettersAppercase, LettersLowercase

◆ set_OptimizeSize()

void Aspose::Pdf::Facades::PdfFileStamp::set_OptimizeSize ( bool  value)

Sets optimization flag. Equal resource streams in resultant file are merged into one PDF object if this flag set. This allows to decrease resultant file size but may cause slower execution and larger memory requirements. Default value: false.

◆ set_OutputFile()

void Aspose::Pdf::Facades::PdfFileStamp::set_OutputFile ( System::String  value)

Sets name and path of output file.

Deprecated:
Use Save(outputFile) method for getting facade results.

◆ set_OutputStream()

void Aspose::Pdf::Facades::PdfFileStamp::set_OutputStream ( System::SharedPtr< System::IO::Stream value)

Sets output stream.

Deprecated:
Use Save(outputStream) method for getting facade results.

◆ set_PageNumberRotation()

void Aspose::Pdf::Facades::PdfFileStamp::set_PageNumberRotation ( float  value)

Sets rotation of page number. Rotation is in degrees. Default is 0.

◆ set_Response()

void Aspose::Pdf::Facades::PdfFileStamp::set_Response ( System::SharedPtr< System::Web::HttpResponse value)

Sets Response object where result of operation will be stored.

◆ set_SaveOptions()

void Aspose::Pdf::Facades::PdfFileStamp::set_SaveOptions ( System::SharedPtr< Aspose::Pdf::SaveOptions value)

Sets save options when result is stored as HttpResponse. Default value: PdfSaveOptions.

◆ set_StampId()

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

Stamp ID of next added stamp (incluiding page headers/hooters/page numbers).

◆ set_StartingNumber()

void Aspose::Pdf::Facades::PdfFileStamp::set_StartingNumber ( int32_t  value)

Sets starting number for first page in input file. Next pages will be numbered starting from this value. For example if StartingNumber is set to 100, document pages will have numbers 100, 101, 102...

PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf");
fileStamp.StartingNumber = 100;
fileStamp.AddPageNumber("Page #");
fileStamp.Close();

Member Data Documentation

◆ PosBottomLeft

const int32_t Aspose::Pdf::Facades::PdfFileStamp::PosBottomLeft
static

◆ PosBottomMiddle

const int32_t Aspose::Pdf::Facades::PdfFileStamp::PosBottomMiddle
static

◆ PosBottomRight

const int32_t Aspose::Pdf::Facades::PdfFileStamp::PosBottomRight
static

◆ PosSidesLeft

const int32_t Aspose::Pdf::Facades::PdfFileStamp::PosSidesLeft
static

◆ PosSidesRight

const int32_t Aspose::Pdf::Facades::PdfFileStamp::PosSidesRight
static

◆ PosUpperLeft

const int32_t Aspose::Pdf::Facades::PdfFileStamp::PosUpperLeft
static

◆ PosUpperMiddle

const int32_t Aspose::Pdf::Facades::PdfFileStamp::PosUpperMiddle
static

◆ PosUpperRight

const int32_t Aspose::Pdf::Facades::PdfFileStamp::PosUpperRight
static