Free Support Forum - aspose.com

Stamping PDF Documents

We use PDF.Kit to put a time stamp on all documents filed via our website. We have some documents filed that do not get the time stamp and I cannot figure out why this happens. I have attached one of the files that did not get stamped.

Hi,

Thank you for considering Aspose.

I have checked your file and found that the problem is that there is no Text part in your Pdf. Everything is image. You can check this by selecting the Text Tool from toolbar and you will find that you can't select anything in Pdf. Hence the stamping is not done. I will discuss this with the developers and will let you know it's solution as soon as possible.

Thanks.

That was my 1st thought also. But I was able to stamp another pdf that has no text. It is attached.

Hi,

Thanks for more information. I have intimated the developer, he will check and will let you know as soon as solution is found.

Thanks.

Hi,

I have tested it and reproduce the error. It’s a realy strange problem and I think it may take us more time to solve this error.

Regards.

Hi,

I have logged this as PDFKITNET-3900. We will try our best to resolve this issue as soon as possible.


Regards.


hi vaughnrk,

I have test your sample pdf document( eFiled Doc No TS.pdf) that can not be stamped. But I have get the right result. my code is as below.The attachment is the result stamped with time. Please notice the red part.

string path1 = @"gemini_3900\eFile Doc No TS.pdf";
string path2 = @"gemini_3900\Stamp.pdf";
Stamp logoStamp = new Stamp();
DateTime dt1=DateTime.Now;
logoStamp.BindLogo(new FormattedText(dt1.ToLongTimeString(),System.Drawing.Color.FromArgb(180,0,0),FontStyle.TimesItalic,EncodingType.Winansi,false,50));
logoStamp.Rotation = 45;
logoStamp.Opacity = 0.5f;
logoStamp.IsBackground=false;
logoStamp.SetOrigin(60,500);
PdfFileStamp _stamp = new PdfFileStamp(path1, path2);
_stamp.AddStamp(logoStamp);
_stamp.Close();

If you still does not not get the right result, please post the code you used, which can help us to solve the problem.

I don't see any significant differences between our code. But mine is still not working. I tried chaning the embedded field in formattedtext from true to flase but it made no differnce. Below is the code I am using:

Dim Stamper As PdfFileStamp, FileStamp As Stamp = New Stamp

Dim sFiledText As FormattedText

sFiledText = New FormattedText("Filed " & sDateFiled & " ET Office of the Judges of Compensation Claims.", New FontColor(0, 0, 200), FontStyle.HelveticaBoldOblique, EncodingType.Winansi, True, 10)

Stamper = New PdfFileStamp(sInFile, sOutFile)

FileStamp.BindLogo(sFiledText)

FileStamp.IsBackground = False

FileStamp.Pages = New Integer() {1}

FileStamp.SetOrigin(75, 10)

Stamper.AddStamp(FileStamp)

Stamper.Close()

I tries the code you supplied and it worked. Upon checking further it seems the problem lies with the SetOrigin statement. I was using FileStamp.SetOrigin(75, 10) which did not work but FileStamp.SetOrigin(75, 450) and FileStamp.SetOrigin(75, 500) both work. We wnat the stamp as close to the bottom of the page as we can get so I tried FileStamp.SetOrigin(75, 400) but this did not work. Seems that the y-origin for pdfs are calculated differently. I tried FileStamp.SetOrigin(75, 450) on another pdf (one that had no problem with FileStamp.SetOrigin(75, 10)) and it placed the stamp in the middle on the document. Why would it be different on the different documents?

Hi vaughnrk,

The first pdf document you provided is strange, I have a test of adding a stamp in the top, but the stamp is the middle of the pdf document. I have test many other samples, the result are right. So i have not comprehend the cause. We will continue to investigate this problem , but it maybe not be solved in a short time.

hi,

I have check the pdf document carefully, and found the MediaBox of this document was different from other documents. I will do some work to solve this problem. It requires two days. When it does work, I will inform you.

Please try hotfix 2.6.4.0.

I downloaded and installed version 2.6.4 and now I get the following message:

"The subscription included in this license allows free upgrades until 02 Nov 2006, but this version of the product was released on 28 Oct 2007. Please renew the subscription or use a previous version of the product."

What now?

Hi,

I think your license got expired. Please contact sales for the renewal of your licenses.

Thanks.

OK. I contacted sales and got the license problem taken care of. The new version corrected the problem with the stamp not being applied to the document in question (or applied in a location off the document so that it was not seen). Now I have another document that appears not to get the stamp (it is attached). I tried stamping it with the old version of PDF.kit we were using and it does get stamped, but the document is inverted (turned upside down) and it changes from protrait to landscape.

Please advise

Thanks

Russ

Hi,

I have checked this problem, and will solve it ASAP.

Any progress on this problem?

Hi,

Sorry for the inconvenience. I will ask the developer working on this to give you an ETA.

Thanks.

Hi,

This problem has been solved, we will release a version in recent day.