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

Free Support Forum - aspose.com

Stamp Facades transparency issue if isBackground=false and page background is white

Hi,

We are trying to place stamps on top right of pdfs generated using code below -

 Document pdfDocument = new Document(mergedPdf);
            PdfFileStamp fileStamp = new PdfFileStamp(pdfDocument);
            FileStream imageStream = new FileStream(imgPath, FileMode.Open);
            Aspose.Pdf.Facades.Stamp stamp = new Aspose.Pdf.Facades.Stamp();
            stamp.BindImage(imageStream);

          
            stamp.SetOrigin(430, 680);
          
            stamp.IsBackground = false;
            fileStamp.AddStamp(stamp);
             imageStream.Close();
            pdfDocument.Save(mergedPdf); 

Requirement : We want the stamp to be in the foreground and we want to be able to see the text in the background.
Our stamp image is png and pdf background is white , as a result we cant see the text in the background .

Please suggest how should go ahead .

@supam,

Kindly send us your source PDF and image. We will investigate and share our findings with you.

Hi attaching the pdfs (both with and without stamp)… I want the stamp to be on top right and infront of the text (in a translucent fashion), so that the text under the stamp is still visible.courtstamp.png (24.6 KB)

withoutStamp.pdf (337.8 KB)
withstamp.pdf (753.9 KB)

@supam,

The said problem does not occur with the latest version 17.10. Please download and try the latest version 17.10 of Aspose.Pdf for .NET API. This is the output PDF: Output17.10.pdf (364.6 KB)

Hi @imran.rafique ,

Please see attached the snapshot of the stamp from your output file. It hides the text below it. This isn’t expected. We want the text to be visible and stamp to be on top of it , kindof like what happens in physically stamped pages.

Please suggest a solution to implement this.

Thanks
issue.PNG (190.1 KB)

@supam,

Please try the Opacity member of the Stamp class as follows:

[C#]

stamp.Opacity = 0.7f;

This is the output PDF: Output17.10_Opt0.7.pdf (364.6 KB)

Hi Aspose Team,

We have further extend the functionality for Sample.png (228.1 KB)
printing stamp on scanned pdf(top right). but stamp got cut (Y-axis of the stamp got affected) in between two pages.

i refer the thread of aspose and found one old link [Aspose Old Link](https://forum.aspose.com/t/problem-with-stamping/133401). is this link make any sense or this issue is fixed now. i am using Aspose.pdf version[17.3.0.0]

Please suggest how to add stamp on scanned PDF.

Thanks in advance.

@supam

We are looking into the scenario and will get back to you shortly.

@supam,

It is quite an old thread. Kindly send the complete details of the scenario, including source PDF and code. We will test your extended scenario in our environment, and share our findings with you. Your response is awaited.

Hi team,

Here you go with the code.

Document pdfDocument = new Document(mergedPdf);
PdfFileStamp fileStamp = new PdfFileStamp(pdfDocument);
FileStream imageStream = new FileStream(imgPath, FileMode.Open);
Aspose.Pdf.Facades.Stamp stamp = new Aspose.Pdf.Facades.Stamp();
stamp.BindImage(imageStream);
stamp.SetOrigin(480, 771);
stamp.SetImageSize(50.0f, 50.0f);
stamp.IsBackground = false;
fileStamp.AddStamp(stamp);
imageStream.Close();
pdfDocument.Save(mergedPdf);

@imran.rafique @asad.ali
https://drive.google.com/file/d/1bi_mQGxaOGdcFONyx9plncXB5v4Rq45Z/view?usp=sharing

File which is having problem.

Code which we are using for adding stamp on uploaded file. this code is working fine for normal PDF but for scanned PDF stamp got corrupted between 2 pages.

C# Code
Document pdfDocument = new Document(mergedPdf);
PdfFileStamp fileStamp = new PdfFileStamp(pdfDocument);
FileStream imageStream = new FileStream(imgPath, FileMode.Open);
Aspose.Pdf.Facades.Stamp stamp = new Aspose.Pdf.Facades.Stamp();
stamp.BindImage(imageStream);
stamp.SetOrigin(480, 771);
stamp.SetImageSize(50.0f, 50.0f);
stamp.IsBackground = false;
fileStamp.AddStamp(stamp);
imageStream.Close();
pdfDocument.Save(mergedPdf);

@sharash,

We managed to replicate the problem of displaced image in our environment. It has been logged under the ticket ID PDFNET-44578 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates. Furthermore, we recommend our clients share all resources of the scenario. Please send us your source image file.

@imran.rafique
https://drive.google.com/file/d/1cUcINBpCgk4q0Q-DaPVSQZrlRnJc-Snp/view?usp=sharing

stamp file.

@sharash,

Thank you for sharing an image. We have logged this image under the same ticket ID PDFNET-44578, and will let you know once a significant progress has been made in this regard.

Dear Team,

Any update on this bug - PDFNET-44578 that was logged as part of our query, we need to get it fixed asap. Thanks in advance.

Regards,
Suprith

@supam

I am afraid that no significant progress has been made against resolution of your issue because of other pending issues in the queue. Since your issue has been reported and logged under free support model, it will be investigated and resolved on first come first serve basis. We will surely let you know in case we make some progress towards its resolution. Please spare us little time.

I regretfully share that the issue resolution may take months and even long due to long queue of pending issues which were logged prior to your issue. In case your issue is a blocker and needs to be resolved on urgent basis, you can please check paid support option where issues have high priority and are resolved on urgent basis.

We are sorry for the inconvenience.