public final class Stamp extends Object
Class represeting stamp.
Constructor and Description |
---|
Stamp()
Constructor for Stamp object.
|
Modifier and Type | Method and Description |
---|---|
void |
bindImage(String imageFile)
Sets image as a stamp.
|
void |
bindLogo(FormattedText formattedText)
Sets text as stamp.
|
void |
bindPdf(com.aspose.ms.System.IO.Stream pdfStream,
int pageNumber)
Sets PDF file and number of page which will be used as stamp.
|
void |
bindPdf(String pdfFile,
int pageNumber)
Sets PDF file and number of page which will be used as stamp.
|
void |
close() |
int |
getBlendingSpace()
Gets a BlendingColorSpace value that defines a color space
that is used to perform transparency and blending operations on the page.
|
float |
getOpacity()
Gets opacity of the stamp.
|
int |
getPageNumber()
Gets page number.
|
int[] |
getPages()
Gets array with numbers of pages which will be affected by stamp.
|
float |
getRotation()
Gets rotation of the stamp in degrees.
|
int |
getStampId()
Gets or sets identifier of stamp.
|
boolean |
isBackground()
Gets background status.
|
void |
isBackground(boolean value)
Sets background status.
|
void |
setBlendingSpace(int value)
Sets a BlendingColorSpace value that defines a color space
that is used to perform transparency and blending operations on the page.
|
void |
setOpacity(float value)
Sets opacity of the stamp.
|
void |
setOrigin(float originX,
float originY)
Sets position on page where stamp will be placed.
|
void |
setPageNumber(int value)
Sets page number.
|
void |
setPages(int[] value)
Sets array with numbers of pages which will be affected by stamp.
|
void |
setRotation(float value)
Gets or sets rotation of the stamp in degrees.
|
void |
setStampId(int value) |
public int getStampId()
Gets or sets identifier of stamp.
public void setStampId(int value)
public float getOpacity()
Gets opacity of the stamp.
public void setOpacity(float value)
Sets opacity of the stamp.
public int getPageNumber()
Gets page number.
public void setPageNumber(int value)
Sets page number.
public int[] getPages()
Gets array with numbers of pages which will be affected by stamp.
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.
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();
public float getRotation()
Gets rotation of the stamp in degrees.
public void setRotation(float value)
Gets or 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.setRotation(90); fileStamp.addStamp(stamp); fileStamp.close();
public boolean isBackground()
Gets background status. If true stamp will be placed as background of the spamped page. By default is set to false.
public void isBackground(boolean value)
Sets background status. If true stamp will be placed as background of the spamped page. By default is set to false.
public int getBlendingSpace()
Gets a BlendingColorSpace value that defines a color space that is used to perform transparency and blending operations on the page.
public void setBlendingSpace(int value)
Sets a BlendingColorSpace value that defines a color space that is used to perform transparency and blending operations on the page.
public void bindPdf(String pdfFile, int pageNumber)
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();
pdfFile
- Path to PDF file.pageNumber
- Number of page in PDF filepublic void bindPdf(com.aspose.ms.System.IO.Stream pdfStream, int pageNumber)
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. Stream stream = new FileInputStream("stamp.pdf", FileMode.Open, FileAccess.Read); stamp.bindPdf(stream, 1); fileStamp.AddStamp(stamp); fileStamp.Close();
pdfStream
- Stream which contains PDF document.pageNumber
- Page index of the document whihc will be used as stamp.public void bindImage(String imageFile)
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();
imageFile
- Image file name and path.public void bindLogo(FormattedText formattedText)
Sets text as stamp.
formattedText
- FormattedText object which specifies text and text properties.public void setOrigin(float originX, float originY)
Sets position on page where stamp will be placed.
originX
- X coordinate of the stamp.originY
- Y coordinate of the stamp.public void close()
Copyright © 2017 Aspose. All Rights Reserved.