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

Free Support Forum - aspose.com

The size of PdfFileStamp is wrong

PDFSignTest.zip (253.8 KB)
I try to add a stamp to PDF file using Aspose.PDF for .NET(Aspose.Pdf.dll, v21.3.0.0 https://downloads.aspose.com/pdf/net/new-releases/aspose.pdf-for-.net-21.3-(dlls-only)/).I set the stamp size is 100(both of width and heigt),but I got the real size is about 156.this is my code ,what’s wrong with me please tell me.

        Aspose.Pdf.Document doc = new 
        Aspose.Pdf.Document(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "testin.pdf"));
        Aspose.Pdf.Facades.PdfFileStamp fileStamp = new Aspose.Pdf.Facades.PdfFileStamp(doc);
        Aspose.Pdf.Facades.Stamp stamp = new Aspose.Pdf.Facades.Stamp();
        stamp.SetOrigin(100, 100);
        stamp.SetImageSize(100, 100);
        stamp.PageNumber = 1;
        stamp.Opacity = 1f;
        stamp.IsBackground = true;
        stamp.BindImage(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "stamp.png"));
        fileStamp.AddStamp(stamp);
        fileStamp.Save(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "testout.pdf"));
        fileStamp.Close();

@zlbao

The actual measurement unit in Aspose.PDF for .NET is point where 72 points = 1 inch. Can you please share a screenshot to show us how you are getting the 156 value of height/width of the added stamp? We will further proceed to assist you accordingly.