we use ASPOSE.PDF for .NET 17.2 to add a stamp (PNG-image) to existing PDFs.
For adding the stamp we use the following code:
...
Dim PDFName As String = "C:\vdk_man\da1.PDf"
Dim PDFOutputName as String = "c:\vdk\E1.PDF"
Dim outpng As String = "C:\vdk_man\E1.png"
Dim pdfDoc = New Aspose.Pdf.Document(PDFName)
Dim imageStamp As New Aspose.Pdf.ImageStamp(outpng)
imageStamp.Background = False
imageStamp.XIndent = 200
imageStamp.YIndent = 680
imageStamp.Zoom = 1
imageStamp.Opacity = 0.5
pdfDoc.Pages(1).AddStamp(imageStamp)
pdfDoc.Save(PDFOutputName)
...
But there are 2 problems with this:
Zooming
The added Stempel.png has a different zoom-factor than the original PNG (if you open it in MSPAINT for example), but imageStamp.Zoom-Property is set to 1 (=100%)
Background
The added Stempel.png is placed behind a graphic embedded in the PDF-document, but imagestamp.background-property is set to false, so the stamp should always be in foregroud on top of the page.
I would like to request you to please share the source and generated PDF files along with the PNG image so that we may investigate further to help you out. Before you share requested data, please make sure that you are using Aspose.Pdf for .NET 18.1 in your environment.
I have worked with the data shared by you and have noticed the problem with zoom only. As the stamp is not placed behind the graphic. I have attached generated PDF file for your kind reference E1_18.1.PDF . Please try using Aspose.Pdf for .NET 18.1 in your environment. A ticket with ID PDFNET-44027 has been logged in our issue management system for further investigation and resolution of this issue. The issue ID has been linked with this thread so that you will receive notification as soon as the issue is resolved.
we made an upgrade to Version 18.1 of Aspose.Pdf 18.1 and our result is better than in Version 17.2, but different from your result.
The stamp-image now is placed on top of the pdf, but opacity-parameter seem to be not working than in your result PDF (see new attachement).
Have you done any additional changse in my sourcode above to generate your result-PDF?
We are glad to know that things have improved in your environment. I am using exact code as shared by you and the opacity parameter is working fine. Please share your environment details (OS details, .NET framework, Application Type etc) with us so that we may investigate further to sort it out.
I have worked with the data shared by you in exactly the same environment as specified by you. However, I have not been able to reproduce the issue with opacity. I have attached generated PDF file for your kind reference E1_Test.PDF. Kindly share a narrowed down sample application reproducing this issue so that we may investigate further to help you out.