Package 'oxview'

Title: Local Canvas Preview for xlsx, docx, and pptx Files
Description: Renders .xlsx, .docx, and .pptx files using the bundled '@silurus/ooxml' JavaScript/WebAssembly viewer, served locally via 'httpuv' and shown in the RStudio Viewer pane or default browser.
Authors: Jan Marvin Garbuszus [aut, cre], Yuki Yokotani [cph] (Author of included ooxml library)
Maintainer: Jan Marvin Garbuszus <[email protected]>
License: MIT + file LICENSE
Version: 0.6.9
Built: 2026-09-29 16:12:30 UTC
Source: https://github.com/JanMarvin/oxview

Help Index


Start (or reuse) the local oxview preview server

Description

Called automatically by ox_view_*(). Exposed for advance use, e.g. warming up the server before the first preview.

Usage

ox_start_server()

Stop the local oxview preview server

Description

Stop the local oxview preview server

Usage

ox_stop_server()

Preview an xlsx, docx, or pptx file

Description

Dispatches to ox_view_xlsx, ox_view_docx, or ox_view_pptx based on type if given, otherwise on x's file extension (or, for an openxlsx2 wbWorkbook object, always to the xlsx viewer).

Usage

ox_view(
  x,
  interactive = NA,
  browser = FALSE,
  debug = FALSE,
  type = NULL,
  zoom = NULL,
  select = NULL
)

Arguments

x

Path or URL to an .xlsx/.xlsm/.docx/.pptx file, or an openxlsx2 wbWorkbook object.

interactive

Whether to actually open the viewer. Defaults to interactive(); set explicitly to avoid depending on session state.

browser

If TRUE, force opening in the system browser instead of the RStudio Viewer pane.

debug

If TRUE, show the in-viewer debug panel (dump the viewer instance, list its methods, call any method with an argument).

type

Optionally force the format ("xlsx", "docx", or "pptx") instead of guessing it from x's extension. Useful when x is a URL that doesn't end in the actual file extension (e.g. a download endpoint with an opaque or query-string path).

zoom

Initial zoom as a scale multiplier, e.g. 1.5 for 150%.

select

What to select/open initially - forwarded to the format-specific parameter that makes sense: sheet name/1-based index (sheet) for xlsx, or a 1-based page/slide number (page/slide) for docx/pptx. For finer control (e.g. xlsx's separate cell parameter), call ox_view_xlsx()/ox_view_docx()/ox_view_pptx() directly instead.


Preview a .docx file

Description

Preview a .docx file

Usage

ox_view_docx(
  x,
  page = NULL,
  zoom = NULL,
  background = NULL,
  interactive = NA,
  browser = FALSE,
  debug = FALSE
)

Arguments

x

Path or URL to an existing .docx file.

page

Page to open initially (1-based).

zoom

Initial zoom as a scale multiplier, e.g. 1.5 for 150%.

background

Background color behind the page (any valid CSS color).

interactive

Whether to actually open the viewer. Defaults to interactive(); set explicitly to avoid depending on session state.

browser

If TRUE, force opening in the system browser instead of the RStudio Viewer pane.

debug

If TRUE, show the in-viewer debug panel (dump the viewer instance, list its methods, call any method with an argument).


Preview a .pptx file

Description

Preview a .pptx file

Usage

ox_view_pptx(
  x,
  slide = NULL,
  zoom = NULL,
  background = NULL,
  interactive = NA,
  browser = FALSE,
  debug = FALSE
)

Arguments

x

Path or URL to an existing .pptx file.

slide

Slide to open initially (1-based).

zoom

Initial zoom as a scale multiplier, e.g. 1.5 for 150%.

background

Background color behind the page (any valid CSS color).

interactive

Whether to actually open the viewer. Defaults to interactive(); set explicitly to avoid depending on session state.

browser

If TRUE, force opening in the system browser instead of the RStudio Viewer pane.

debug

If TRUE, show the in-viewer debug panel (dump the viewer instance, list its methods, call any method with an argument).


Preview an .xlsx / .xlsm file or openxlsx2 workbook

Description

Opens a live spreadsheet preview (RStudio Viewer pane, or the default browser with browser = TRUE) with a formula bar, cell reference box, sheet-name search, and a status bar showing count/sum/average for the current selection.

Usage

ox_view_xlsx(
  x,
  sheet = NULL,
  cell = NULL,
  zoom = NULL,
  interactive = NA,
  browser = FALSE,
  debug = FALSE
)

Arguments

x

Path to an existing .xlsx/.xlsm file, or an openxlsx2 wbWorkbook object.

sheet

Sheet to open initially: a sheet name, or a 1-based index. If NULL (the default) and x is a wbWorkbook, the workbook's current sheet is used automatically via openxlsx2's private current_sheet/get_sheet_index R6 fields - this reaches into another package's undocumented internals (there's no public accessor for this), so it may break across openxlsx2 versions without notice; pass sheet explicitly to sidestep it entirely.

cell

A cell reference (e.g. "B2" or "B2:D5") to select and scroll to on open.

zoom

Initial zoom as a scale multiplier, e.g. 1.5 for 150%.

interactive

Whether to actually open the viewer. Defaults to interactive(); set explicitly to avoid depending on session state.

browser

If TRUE, force opening in the system browser instead of the RStudio Viewer pane.

debug

If TRUE, show the in-viewer debug panel (dump the viewer instance, list its methods, call any method with an argument).