Using Aspose.PDF for Java (version 19.3), I would like to add some text stamps to a previously generated PDF file and GET the text as it is displayed, no matter what the PDF viewer is.
That is, no matter what technology is used to stamp text in the PDF file, PdfFileMend, PdfFileStamp, TextStamp, TextFragment or PdfViewer, when I try to find the text in the generated file, it is selected in the order inserted and not in the order of display.
In particular, I’m creating the first PDF using Aspose.Cells-java and then opening the PDF using a byte array or tmp file, but it’s the same thing.
I attached a project example with different shapes and the only way I found was using: TextStamp & textStamp.setBackground(true) in case the stamp is the first text on the page.
Screen Shot 2022-08-23 at 13.10.18.png (15.4 KB)
aspose-pdf-ocr.zip (246.9 KB)