Add Background

Skip to end of metadata
Go to start of metadata
Add Background

Background is a lay behind pages. Adding background is supported since Aspose.Pdf.Kit v1.7.0.

Note: Adding background is supported since Aspose.Pdf.Kit for Java v1.4.

To add a background in Java, just follow these steps:

  • Create an object of Stamp class,bind an image or a FormattedText object and set isBackground equal to true.
  • Create an object of PdfFileStamp class by passing the input and output PDF files as file names or streams.
  • Call addStamp method and pass the Stamp object.
  • Close the PdfFileStamp object.
[Java]
fileStamp = new PdfFileStamp(inFile, outFile);
Stamp backgroundStamp = new Stamp();
backgroundStamp.bindImage(path + "butterfly.jpg");
backgroundStamp.setImageSize(100,100);
backgroundStamp.setOrigin(200,200);
backgroundStamp.isBackground(true);
fileStamp.addStamp(backgroundStamp);
fileStamp.close();
 
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.