When you want to create a visible signature using PDFBox you need to create a Rectangle2D object.
Rectangle2D humanRect = new Rectangle2D.Float(100, 200, 150, 50);
I would like to know if it is possible to find all the white spaces(rectangles) in the document(or from the first/last page) of a certain size (width x height). I would like to choose one of these positions for my signature form.
I would like to use it as in the following example:
Rectangle2D humanRect = new Rectangle2D.Float(foundX, foundY, width, height);
CodePudding user response:
As already confirmed in a comment to the question, you essentially are looking for a port of the functionality of the
Comparing to the analogous screen shot for the iText variant, we see that we get more possible rectangles here.
This is due to the iText solution using the font-level ascender and descender while we here use the individual glyph bounding boxes.