We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

BackgroundImage property

Hi,

Due to the type of PDF documents I am producing, they can often be many pages (a few hundred) and each page must be a new section.

Sometimes, I need to set a background image. I see that Section has a BackgroundImage property, which will display that image for every page in that section. Would it be possible to have a similar property for the whole document, so that the image is displayed on every page in the whole document?

Thanks,

Chris

Hello Chris,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

You can add background image on every section of Pdf file, by using the following code snippet, before saving the Pdf file.

foreach (Aspose.Pdf.Section sec1 in pdf11.Sections)

{
sec1.BackgroundImageFile = @"c:\pdftest\Product+Categories+Source.001.jpeg";
sec1.BackgroundImageType = Aspose.Pdf.ImageFileType.Jpeg;
}

If it does not satisfy your requirement, please feel free to share.

Or You can also use Watermarks property of Pdf class to add watermarks upon each page of the page. For more information please visit Watermarks. You need to add floatingbox objects into the collection of Watermarks, also visit Working with Floating Box

Yes, this is what I do currently.

Watermarks, however, seem to do what I was after, thanks.