Aspose.PDF for .NET stamp is behind Word graphics

Hi,

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:

  1. 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%)
  1. 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.

Any ideas on this?

Regards from Germany

Manuel

@vdkde

Thank you for contacting support.

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.

Hi Farhan Raza,

attached you find our file tor the code above.

Regards from Germany

Manuelvdk_aspose_sup.zip (2.4 MB)

@vdkde

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 are sorry for the inconvenience.

Hi Raza,

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?

Regards from Germany

ManuelE1.pdf (2.3 MB)

@vdkde

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.

Hi Farhan,

here Details I am using:

  • OS: Win7 SP1
  • VS: Visual Studio 2010
  • Visual Studio: Console Application with .NET Framework 4.0

Regards from Germany

Manuel

@vdkde

Thank you for sharing requested details.

We are investigating it in our environment and we will get back to you with our findings soon.

@vdkde

Thank you for being patient.

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.