showPage: Plot the contents of a PDF page

showPageR Documentation

Plot the contents of a PDF page

Description

This displays the elements of a PDF page where they appear on the page and mimic the elementary display of a PDF page. This is helpful for visualizing where specific elements are.

Usage

showPage(f, pageNum = 1, doc = xmlParse(f), page = getNodeSet(doc, "//page")[[pageNum]], ...)

Arguments

f

the name of the file containing the PDF document or the converted PDF to XML, or alternatively a PDF page extracted from an XML representation.

pageNum

the index of the page in the file if f is a file name.

doc
page
...

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (f, pageNum = 1, doc = xmlParse(f), page = getNodeSet(doc, 
    "//page")[[pageNum]], ...) 
{
    if (is(f, "XMLInternalDocument") && missing(doc)) 
        doc = f
    else if (missing(pageNum) && is(f, "XMLInternalElementNode") && 
        xmlName(f) == "page") 
        page = f
    renderPage(page, ...)
  }

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