|
||
| Home Products Purchase Downloads Demos Forums Blogs Ticket Wiki API Corporate | ||
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aspose.pdf.kit.PdfFileStamp
Represents a class for adding watermark or logo at (x,y) on each page of Pdf file. The logo is a string of characters.
| Constructor Summary | |
PdfFileStamp(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
Creates a PdfFileStamp object instance. |
|
PdfFileStamp(java.lang.String inputFile,
java.lang.String outputFile)
Creates a PdfFileStamp object instance. |
|
| Method Summary | |
void |
addLogomark(FormattedText logo,
float x,
float y)
Adds a logo on each page of the Pdf fila at (x,y). |
void |
addWatermark(java.lang.String imageFile,
float x,
float y)
Adds a watermark on each page of the Pdf file at (x,y). |
void |
close()
Closes the PdfFileStamp object,writes the watermark and logo to the Pdf document. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PdfFileStamp(java.lang.String inputFile,
java.lang.String outputFile)
throws java.io.IOException,
PdfKitException
inputFile - String Source input Pdf file.outputFile - String Output Pdf file.
java.io.IOException
PdfKitException
public PdfFileStamp(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
throws java.io.IOException,
PdfKitException
inputStream - InputStream Source input Pdf Stream.outputStream - OutputStream Output Pdf Stream.
java.io.IOException
PdfKitException| Method Detail |
public void addWatermark(java.lang.String imageFile,
float x,
float y)
throws java.io.IOException,
com.aspose.pdf.kit.BadElementException,
java.net.MalformedURLException
imageFile - String The path of image, the types supported are JPG,PNG,GIF.x - float Horizon position.y - float Vertical position.
java.io.IOException
BadElementException
java.net.MalformedURLException
public void addLogomark(FormattedText logo,
float x,
float y)
logo - FormattedText The logo with font,encoding and size format.x - float The X position.y - float The Y position.
public void close()
throws PdfKitException,
java.io.IOException
[SampleCode]
String inFile = "example2.pdf";
String outFile = "kitOut.pdf";
PdfFileStamp fileStamp = new PdfFileStamp(inFile, outFile);
FormattedText logo1 = new FormattedText("Evaluation Only. Created with Aspose.Pdf.Kit. Copyright 2002-2005 Aspose Pty Ltd",new FontColor(0, 20, 180),
FontStyle.TimesRoman,EncodingType.Winansi, false, 12);
FormattedText logo2 = new FormattedText("Aspose.Pdf.Kit",new FontColor(10, 30, 100),FontStyle.HelveticaOblique,
EncodingType.Winansi, false, 20);
fileStamp.addLogomark(logo1, 20, 50);
fileStamp.addLogomark(logo2, 20, 70);
fileStamp.addWatermark("imgLogoPDF.gif", 100,100);
fileStamp.close();
PdfKitException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||