getBBox: Get the bounding box of a collection of nodes

getBBoxR Documentation

Get the bounding box of a collection of nodes

Description

This function computes the top-left location and the width and height of each node to give its locations.

Usage

getBBox(nodes, asDataFrame = FALSE, color = FALSE, diffs = FALSE, dropCropMarks = TRUE)

Arguments

nodes
asDataFrame
color
diffs
dropCropMarks

Value

A matrix or a data.frame depending on asDataFrame. The difference between the matrix and the data.frame is that the matrix does not contain the text in a column, but as row names; the data.frame contains a column named text giving the text. (Adding a column of text to the matrix would cause all columns to be character strings.)

If diffs is TRUE, the standard/always-present columns are left, top, width and height. Recall that the values increase from top down as the origin of a PDF page is the top-left corner.

If diffs is FALSE, the columns give the top-left and bottom right locations as x0, y0, x1, y1. Here bottom means down the page so a larger y value. So y1 is greater than y0.

If color is TRUE, the color of each node is added as a column in the data.frame (not if returning a matrix).

Author(s)

Duncan Temple Lang


dsidavis/ReadPDF documentation built on June 12, 2025, 6:39 a.m.