Class FreeSpaceFinder
Finds empty areas of a page, e.g. to place a signature or a stamp where it does not cover content. Occupied are text (word boxes), images, painted vector graphics (bounding boxes) and – optionally – annotations. The result consists of maximal free rectangles (they may overlap), largest first.
public static class FreeSpaceFinder
- Inheritance
-
FreeSpaceFinder
- Inherited Members
Methods
Find(PdfPage, double, double, bool)
Maximal free rectangles of at least minWidth x minHeight points within the
crop box of page, largest first.
public static IReadOnlyList<PdfRectangle> Find(PdfPage page, double minWidth, double minHeight, bool includeAnnotations = true)
Parameters
pagePdfPageThe page to analyze.
minWidthdoubleMinimum width of a free rectangle in points.
minHeightdoubleMinimum height of a free rectangle in points.
includeAnnotationsboolTreat the rectangles of annotations as occupied (popup and hidden annotations are ignored).
Returns
Find(PdfRectangle, IEnumerable<PdfRectangle>, double, double)
Maximal free rectangles inside area that do not intersect any occupied rectangle.
public static IReadOnlyList<PdfRectangle> Find(PdfRectangle area, IEnumerable<PdfRectangle> occupied, double minWidth, double minHeight)
Parameters
areaPdfRectangleoccupiedIEnumerable<PdfRectangle>minWidthdoubleminHeightdouble