Aspose TextStamp

Code.docx (3.8 KB)
Hello,

We are using Aspose PDF version 22.6 for JAVA and we apply a stamp to all the incoming document. However, we have a requirement to overwrite the previous stamp in some cases and if the new stamp length is shorter than the one that is already on the document, we can see a part of the old stamp. Upon looking at your website we see an option to replace stamp by id but we are not creating any id when we apply stamp. Are there any alternate options to achieve the same? We would want to make the entire area blank and then apply the new stamp or add a plain white stamp that could eliminate the previous text.

Attached the code and documents for your reference.
TestDoc.pdf - Original document without any stamp
TestDocWithFirstStamp.pdf​ - After applying the first stamp​
TestDocWithReStamp.pdf​ - After reapplying a new stamp. The word “Confidential” in the first stamp was replaced with “Test”. You can see part of the previous stamp

Thanks,
B
TestDocWithReStamp.pdf (35.8 KB)
TestDocWithFirstStamp.pdf (34.0 KB)
TestDoc.pdf (33.4 KB)

@judiciary

This feature needs to be further investigated and for the sake of analysis, we have logged a ticket as PDFJAVA-42243 in our issue tracking system. We will look into its details and feasibility and let you know as soon as the ticket is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hello, is there any update on this?

Thanks,
B

@judiciary

The ticket has recently been logged in our issue tracking system and will be resolved on a first come first serve basis. We will let you know via this forum thread as soon as we have some updates in this regard. Please give us some time.

We apologize for the inconvenience.

@judiciary

For the case of adding TextStamp to a document without ID - it will be placed as regular text after saving. There is no such instance as TextStamp in the pdf standard, this abstraction was created for the convenient editing of a pdf document.

The following code can be used to clear the area and to make the desired area blank.

Use it to prepare the initial document with an old stamp for example for page 1.

Document pdfDocument = new Document(name);
Page page = pdfDocument.getPages().get_Item(1);
Rectangle rect = page.getMediaBox();
double width = rect.getWidth();
double height = rect.getHeight();
int heightOfArea = 20;
RedactionAnnotation annotation = new RedactionAnnotation(page, new Rectangle(0,height, width, height- heightOfArea));
annotation.setFillColor(Color.getWhite());
annotation.setColor(Color.getWhite());
page.getAnnotations().add(annotation);
annotation.redact();