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

Free Support Forum - aspose.com

Stamp or watermark

I want add a stamp or watermark to my in-memory Generator.PDF object. I found this, but this is for an existing PDF:


I have one PDF that is my company’s letterhead, and I want to use it as a watermark/stamp for all PDF’s that I create.

Thank you for considering Aspose.Pdf for .NET.

I think you can check the following sample code to add PDF Stamp / Watermark to a new document using Aspose.Pdf for .NET.

//Create a new Document.

Document pdfDocument = new Document();


//create page stamp
PdfPageStamp pageStamp = new PdfPageStamp("E:\\AP Data\\Dec2011\\empty.pdf",1);

pageStamp.Background = true;
pageStamp.XIndent = 100;
pageStamp.YIndent = 100;

//add stamp to particular page
//save output document
pdfDocument.Save("E:\\AP Data\\Dec2011\\Stamp_Test.pdf");

You can also check following link for more details and samples regarding adding stamps and watermarks.

http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/working-with-stamps-and-watermarks.html<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p></o:p>

Thank You & Best Regards,

but I am not using: Document pdfDocument = new Document();

I’m using: Dim pdfDocument As New Generator.Pdf.

These are two different object.

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

Well, Aspose.Pdf.Generator namespace does not support the feature of adding PDF pages as Stamps / Watermarks. You can use Aspose.Pdf DOM (Document class) to get your desired results. Also, Aspose.Pdf DOM allows both creating new files and modifying existing files. So, please use Aspose.Pdf DOM Document class as per your requirement.

Thank You & Best Regards,

I converted my PDF to a JPG and now I’m using BackgroundImageFile to set it.

Followup question: BackgroundImageFile is per section. How do I set the Background Image File for just the first page? I know I could add multiple sections, but what if I have a report where there is data on multiple pages?