Removing Watermark added as Stamp

Hi,

I've follwed the examples to Add a watermark to existing .pdf files using the PdfFileStamp object .AddStamp() for two Stamp.BindLogo(FormattedText) objects. This works great. I now need to remove and re-add this watermark or Replace it. I can't find an example of how to do this. Can someone point me in the right direction? Thanks,

Shannon

Hi Shannon,

I’m sorry to inform you that currently it is not possible to remove or update an existing stamp, however I have logged a new feature request as PDFKITNET-15200 in our issue tracking system. Our team will look into this requirement and you’ll be updated via this forum thread once it is supported.

We’re sorry for the inconvenience.
Regards,

Ok, I need this within a few weeks. I"m assuming it will be longer than that before it is addressed and ready. Is there another way I can add the equivalent of a watermark so that I can later find it and remove/replace it?

Thanks,

Shannon

Hi Shannon,

Our team is currently working on some related functionality (PDFKITNET-14865) which will allow you to remove or replace an image stamp. However, this functionality will probably be available in our monthly release due at the end of April (next month). I’m afraid, there is no other workaround for this issue at the moment.

We’re sorry for the inconvenience.
Regards,



The issues you have found earlier (filed as 14865;15200) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Great. Now, how do I get/remove/replace a watermark stamp? I cannot find an appropriate method in the Stamp, PdfFileStamp, PdfFileEditor, or any other likely class.

Thanks!

Shannon

Hi Shannon,

Our team has built this feature based on the existing features. You can now use replace text feature to remove or replace a stamp. Please try the following code snippet at your end:


PdfFileStamp fileStamp = new PdfFileStamp(“input.pdf”, “withStamp.pdf”);

Stamp stamp = new Stamp();

stamp.SetOrigin(200, 200);

stamp.BindLogo(new FormattedText(“my stamp”));

stamp.PageNumber = 1;

fileStamp.AddStamp(stamp);

fileStamp.Close();


PdfContentEditor editor = new PdfContentEditor();

editor.BindPdf(“withStamp.pdf”);

editor.ReplaceText(“my stamp”, “my NEW stamp”);

editor.Save(“withNewStamp.pdf”);


I hope this helps. If you have any further questions, please do let us know.
Regards,

To Delete do I just do a replace with a null or empty string? Also, will the replace match on any text within the document? So if my watermark text was say "ARCHIVED", and I wanted it removed, would content text within the document that happed to be the same also be removed or replaced?

Also, I am using the stamp as a watermark to Stamp a document "Pending" "Archived" or "Active" along with a timestamp. Is there a regEx or Wildcard search expression support for searching for the text to replace? Otherwise there is no way I will know the timestamp part of the text.

thanks,

Shannon

Hi Shannon,

In order to remove a string you can replace it with empty string. Also, the text in the document and the watermark are treated the same, so while replacing the text first occurrence of the string will be replaced.

As far as your other requirement is concerned, please share a sample document to help us understand your requirement. You’ll be updated accordingly.

We’re sorry for the inconvenience.
Regards,


Well, all your other products, Cells, Word, Slides, all treat the watermarks or shapes separately so I was a little surprised to find for PDF's that text and shapes(stamps) are treated the same. I cannot attach a sample due to sensitivity, but I think I can explain it. If not I will get approval or generate a sample I can attach.

We have a document library maintained through Sharepoint. When a document is furst added it gets a watermark added "Pending {current timestamp}, when approved we automatically update the watermark to "Active {new timestamp} and when a new revision is added we then update the watermark to "Archive {another new timestamp}". This work brilliantly for all our Office dicuments. The problem is half our docs are PDF's and from what you are telling me, I can think of no way to search and replace text, where the text includes a timestamp, because I will not know the value of the timestamp.

thanks,

Shannon

Hi Shannon,

I’m afraid, currently Aspose.Pdf.Kit doesn’t allow to identify Watermark as separate object, however I have logged this issue as PDFKITNET-16973 in our issue tracking system. Our team will investigate this requirement in detail.

As far as your second requirement is concerned, I’m afraid that is not supported at the moment either; however I have logged it as PDFKITNET-16975 in our issue tracking system. We’ll try to provide this feature in our future versions.

We’re sorry for the inconvenience.
Regards,

Thank you. Any idea on a timeline? I convinced management to wait when I first identified this issue when I was informed it was being addressed in your April hotfix release. I do not know if I can stall much longer.

Shannon

Hi Shannon,

I’m afraid, previously we tried to provide a solution based on the existing features to provide you a resolution on urgent basis. However, to further investigate this requirement and provide support for these new features our team require some time. Moreover, as you know these new features have been recently logged, our team still needs to investigate in detail. Please spare us some time before we could be able to share the ETA.

We’re sorry for the inconvenience.
Regards,

While you are investigating this, can you tell me if there is a good way to add a non-visible piece of metadata to the pdf with the watermark text so I can look up the watermark text and then do a replace on that string?

Thanks,

Shannon

Hi Shannon,

I’m sorry to inform you that currently there is no way to attach some non-visible metadata to watermark text.

We’re sorry for the inconvenience. If you have any further questions, please do let us know.
Regards,

Is this still on the radar? I’ve noticed quite a few updates to the PDF.Kit product but no mention of this item?


thanks,

Shannon

Hi Shannon,

I’m sorry to inform you that these issues are not yet resolved. However, I have asked our development team to share the ETA. You’ll be updated via this forum thread once I receive a response from our team.

We’re sorry for the inconvenience and appreciate your patience.
Regards,

The issues you have found earlier (filed as 16975;16973) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

This is great, but I'm not sure how to leverage this fix? I'm looking at the 5.0 component and I can't find any obvious method/object for setting and looking up the identifier for a stamp(watermark)?

Can someone point me in the right direction?

thanks -Shannon

Hi Shannon,

You can find the details regarding getting stamp information and deleting stamps by IDs in this article. Moreover, you can use StampID property of the Stamp class to specify stamp id while adding stamp to a PDF file.

I hope this helps. If you find any further questions, please do let us know.
Regards,