Class RenderedElementLocation


  • public class RenderedElementLocation
    extends Object
    Represents the rendered location of an HTML element within a PDF document.

    Returned by PdfDocument.getElementLocations() after rendering HTML with ChromePdfRenderOptions.setElementQuerySelectors(String[]) configured.

    Mirrors IronPdf.RenderedElementLocation on the C# side.

    • Constructor Detail

      • RenderedElementLocation

        public RenderedElementLocation()
        Default constructor.
      • RenderedElementLocation

        public RenderedElementLocation​(String text,
                                       int pageIndex,
                                       Rectangle2D.Double rectangle,
                                       int elementIndex)
        Full constructor.
        Parameters:
        text - The text content of the matched element
        pageIndex - The zero-based page index where the element was rendered
        rectangle - The bounding rectangle of the annotation marker on the page
        elementIndex - The original document-order index of the element among all matched elements
    • Method Detail

      • getText

        public String getText()
        Returns:
        The text content of the matched element.
      • setText

        public void setText​(String text)
      • getPageIndex

        public int getPageIndex()
        Returns:
        The zero-based page index where the element was rendered.
      • setPageIndex

        public void setPageIndex​(int pageIndex)
      • getRectangle

        public Rectangle2D.Double getRectangle()
        Returns:
        The bounding rectangle of the annotation marker on the page, in PDF points (1/72 inch). Coordinate origin is the bottom-left corner of the page. The rectangle corresponds to the injected anchor marker placed at the start of the matched element.
      • getElementIndex

        public int getElementIndex()
        Returns:
        The original index of the element in document order among all matched elements.
      • setElementIndex

        public void setElementIndex​(int elementIndex)