Stamp

Inheritance: java.lang.Object, com.aspose.pdf.facades.Stamp

public final class Stamp extends Object

Class represeting stamp.

Constructors

ConstructorDescription
StampConstructor for Stamp object.

Methods

MethodDescription
bindImageSets image which will be used as stamp.
bindImage

Sets image as a stamp.


 PdfFileStamp fileStamp = new PdfFileStamp(“input.pdf”, “output.pdf”); Stamp stamp = new Stamp(); stamp.bindImage(“image.jpg”); fileStamp.addStamp(stamp); fileStamp.close(); 
bindLogoSets text as stamp.
bindPdf

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


 PdfFileStamp fileStamp = new PdfFileStamp(“input.pdf”, “output.pdf”); Stamp stamp = new Stamp(); //First page will be used as stamp. InputStream stream = new FileInputStream(“stamp.pdf”); stamp.bindPdf(stream, 1); fileStamp.addStamp(stamp); fileStamp.close(); 
bindPdf

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


 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(); 
bindTextStateSets text state of stamp text.
closeCloses this instance
getBlendingSpaceGets a BlendingColorSpace value that defines a color space that is used to perform transparency and blending operations on the page.
getOpacityGets opacity of the stamp.
getPageNumberGets page number.
getPagesGets array with numbers of pages which will be affected by stamp.
getQualityGets quality of image stamp in percent. Valiued values 0..100%.
getRotationGets rotation of the stamp in degrees.
getStampIdGets identifier of stamp.
isBackgroundGets background status. If true stamp will be placed as background of the spamped page. By default is set to false.
setBackgroundSets background status. If true stamp will be placed as background of the spamped page. By default is set to false.
setBlendingSpaceSets a BlendingColorSpace value that defines a color space that is used to perform transparency and blending operations on the page.
setImageSizeSets size of image stamp. Image will be scaled according to the specified values.
setOpacitySets opacity of the stamp.
setOriginSets position on page where stamp will be placed.
setPageNumberSets page number.
setPages

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

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

Gets or sets rotation of the stamp in degrees.

setStampIdSets identifier of stamp.

Stamp

public Stamp()

Constructor for Stamp object.

bindImage

Sets image which will be used as stamp.

bindImage

Sets image as a stamp.


 PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf"); Stamp stamp = new Stamp(); stamp.bindImage("image.jpg"); fileStamp.addStamp(stamp); fileStamp.close(); 

bindLogo

Sets text as stamp.

bindPdf

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


 PdfFileStamp fileStamp = new PdfFileStamp("input.pdf", "output.pdf"); Stamp stamp = new Stamp(); //First page will be used as stamp. InputStream stream = new FileInputStream("stamp.pdf"); stamp.bindPdf(stream, 1); fileStamp.addStamp(stamp); fileStamp.close(); 

bindPdf

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


 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(); 

bindTextState

Sets text state of stamp text.

close

public void close()

Closes this instance

getBlendingSpace

public BlendingColorSpace getBlendingSpace()

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

Returns: int value @see BlendingColorSpace

getOpacity

public float getOpacity()

Gets opacity of the stamp.

Returns: float value

getPageNumber

public int getPageNumber()

Gets page number.

Returns: int value

getPages

public int[] getPages()

Gets array with numbers of pages which will be affected by stamp.

Returns: int array

getQuality

public int getQuality()

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

Returns: int value

getRotation

public float getRotation()

Gets rotation of the stamp in degrees.

Returns: float value

getStampId

public int getStampId()

Gets identifier of stamp.

Returns: int value

isBackground

public boolean isBackground()

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

Returns: boolean value

setBackground

public void setBackground(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean value

setBlendingSpace

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

setImageSize

public void setImageSize(float width, float height)

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

Parameters:

ParameterTypeDescription
widthImage width.
heightImage height.

setOpacity

public void setOpacity(float value)

Sets opacity of the stamp.

Parameters:

ParameterTypeDescription
valuefloat value

setOrigin

public void setOrigin(float originX, float originY)

Sets position on page where stamp will be placed.

Parameters:

ParameterTypeDescription
originXX coordinate of the stamp.
originYY coordinate of the stamp.

setPageNumber

public void setPageNumber(int value)

Sets page number.

Parameters:

ParameterTypeDescription
valueint value

setPages

public void setPages(int[] value)

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

Parameters:

ParameterTypeDescription
valueint array
 PdfFileStamp fileStamp = new PdfFileStamp(“input.pdf”, “output.pdf”); Stamp stamp = new com.aspose.pdf.facades.Stamp(); stamp.bindLogo(new FormattedText(text)); //put stamp only on 1st, 4th and 6th page. stamp.setPages(new int[] { 1, 4, 6 }); fileStamp.addStamp(stamp); fileStamp.close(); 

setQuality

public void setQuality(int value)

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

Parameters:

ParameterTypeDescription
valueint value

setRotation

public void setRotation(float value)

Gets or sets rotation of the stamp in degrees.

Parameters:

ParameterTypeDescription
valuefloat value
 PdfFileStamp fileStamp = new PdfFileStamp(“input.pdf”, “output.pdf”); Stamp stamp = new Stamp(); stamp.bindLogo(new FormattedText(“STAMP”)); stamp.setRotation(90); fileStamp.addStamp(stamp); fileStamp.close(); 

setStampId

public void setStampId(int value)

Sets identifier of stamp.

Parameters:

ParameterTypeDescription
valueint value