Free Support Forum - aspose.com

Problem with Stamping

Hello,
I am using the Stamp class in order to stamp PDF's. Here are the property values I'm using:

IsBackground = false;
Rotation = 0;
SetOrigin(50, 7);
Opacity = 0.5f;

I also call BindImage()/BindLogo() depending on what I'm trying to stamp.

The problem is that some of the pages of the PDF are stamped while others are not. The PDF I am stamping is a mixture of pages that were scanned and pages that were converted from MS Word. What is the problem? Please help.

Thanks,
Philip

Hi Philip,

Firstly please be sure that you are using the latest version of Aspose.Pdf.Kit which produced this error.

Secondly please refer to the post below which could provide help info.

<A href="</A>.</P> <P>If you are still chocked by this isse, please provide all resources that can reproduce the same error. We will investigate it and reply to you soon.</P> <P> </P>

Hello,

I am using the latest version(2.1.3.0). After looking further into the problem I have determined that the stamper is not stamping scanned documents. I have attached a file I have been using to test the problem.

Here is the code I'm using:

Stamp imageStamp = new Stamp();

imageStamp.BindImage(Filename);

imageStamp.Rotation = 0;

imageStamp.Opacity = 0.5f;

imageStamp.SetOrigin(1, 1);

imageStamp.IsBackground = false;

InStream.Seek(0, SeekOrigin.Begin);

Stream outStream = new MemoryStream();

PdfFileStamp stamper2 = new PdfFileStamp(InStream, outStream);

stamper2.AddStamp(imageStamp);

stamper2.Close();

outStream.Seek(0, SeekOrigin.Begin);

return outStream;

Thanks,
Philip

Hi Philip,

After I reproduced the same error and a disscussion with our developers, I confirmed that you can not stamp an image on a scanned pdf document with the latest version of Aspose.Pdf.Kit.

Sorry for your inconvenience.

Hello,

Is the problem going to be fixed? If so, any idea when it will be fixed?

-Philip

Hi ,

This issue can not be fixed in three monthes because of some tough technical problems.

I have tested this issue using the “Add Watermark & Backgroud” in Adobe Acrobat6.0 Professional and found that the stamp also was not shown.
This is a problem about PDF specification and we could not solve it now.

Okay. Thanks for the information. I tested Adobe tool you mentioned in Adobe Acrobat 7.0 Professional and although the adding a background did not, for obvious reasons, I was able to add text to the top of the document using it.

While trying to come up with a workaround using Pdf.Kit, I ran into an issue of the coordinate system being "shifted" when I tried to add anything to the page. What I mean is that (0,0) was no longer the lower-left hand corner of the page but was apparently well below the bottom of the page. Also the coordinate (0, PageHeight) was right below the scanned image.

I will check the issue you mentioned and reply you in serveral days.