I need to find some text in a pdf document and put an image there, such as: "My car" in a document and place the image below / next to that text.
{.....
BufferedImage image = resizeImage(base64Picture, pictureScaling);
PDDocument document = PDDocument.load(base64Pdf);
int lastPage = document.getNumberOfPages()-1;
PDPage page = document.getPage(lastPage);
PDImageXObject pdImage = LosslessFactory.createFromImage(doc, image);
PDPageContentStream contents = new PDPageContentStream(doc, page, PDPageContentStream.AppendMode.APPEND, false);
// find location of "My car"
contents.drawImage(); // draw image below / next to "My car"
.....}