columnOf: Determine in which column in a page a node is located.

columnOfR Documentation

Determine in which column in a page a node is located.

Usage

columnOf(node, cols = getColPositions(xmlParent(node)))

Arguments

node

the XML node whose column is to be identified

cols

the positions of the columns on the page, i.e., where each column starts. These are calculated from the node's page. However it can be useful to specify the values either from contextual knowledge or by precomputing them to avoid repeating this calculation each time, or to customize the calculations of these positions.

Value

An integer vector.

Author(s)

Duncan Temple Lang

Examples


doc = readPDFXML(system.file("samples/3Column.xml", package = "ReadPDF"))
library(XML)
getNodeSet(doc, "//text[contains(., 'Column')]")
nodes = getNodeSet(doc, "//text[contains(., 'Column')]")

sapply(nodes, columnOf)

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