Hi,
I am trying to apply a text logo stamp to all pages on in a document. According to your documentation by default the stamp is applied to all pages, however I am finding that it is only being applied to the first page:
Pages Property
Aspose.Pdf.Kit Documentation |
Stamp.Pages Property
Sets or gets the page number to indicate on which pages the stamp content is added. By default,stamps each page .
My code (based on your sample) looks like this:
public void CreateWaterMarkedPDF(string fileName, string newFileName, string text)
{
PdfFileInfo fileInfo = new PdfFileInfo(fileName);
Stamp stamp = new Stamp();
//stamp.BindImage(imageFile);
stamp.BindLogo(new FormattedText(text, Color.Red,FontStyle.TimesBold,EncodingType.Winansi,true, 48));
//specifies the Stamp object added as watermark
stamp.IsBackground = false;
//specifies the watermark rotation
stamp.Opacity = 0.5f;
stamp.Rotation = 45;
//specifies the position of stamp
stamp.SetOrigin(fileInfo.GetPageWidth(1) / 2, fileInfo.GetPageHeight(1) / 2);
//set the size of the watermark
stamp.SetImageSize(80, 80);
PdfFileStamp fileStamper = new PdfFileStamp(fileName, newFileName);
fileStamper.AddStamp(stamp);
fileStamper.Close();
}
Thanks,
Nick.