Package {html2pdfR}


Type: Package
Title: Convert Local 'HTML' and 'XHTML' Files to 'PDF'
Version: 0.1.0
Description: Provides functions for converting local 'HTML' and 'XHTML' files to 'PDF' using an external backend. The package includes helper functions for backend setup, file conversion, and an optional 'Tk' graphical interface.
License: GPL-3
Encoding: UTF-8
Imports: utils, tools, tcltk
Suggests: roxygen2, testthat
URL: https://github.com/Lijin-5673/html2pdfR
BugReports: https://github.com/Lijin-5673/html2pdfR/issues
NeedsCompilation: no
Config/roxygen2/version: 8.0.0
Packaged: 2026-05-09 15:01:02 UTC; lijin
Author: Lijin Arakkandathil Thekkathil [aut, cre]
Maintainer: Lijin Arakkandathil Thekkathil <lijin5673@gmail.com>
Repository: CRAN
Date/Publication: 2026-05-13 19:20:02 UTC

Get backend config file path

Description

Get backend config file path

Usage

backend_config_file()

Value

Path to the config file storing backend executable location.


Get default backend directory

Description

Get default backend directory

Usage

backend_default_dir()

Value

Path to the default backend installation directory.


Get default backend executable path

Description

Get default backend executable path

Usage

backend_default_exe()

Value

Path to the default converter executable.


Backend release URL

Description

Backend release URL

Usage

backend_release_url()

Value

URL to the backend zip file hosted on GitHub Releases.


Get backend root directory

Description

Get backend root directory

Usage

backend_root()

Value

Path to the package user data directory.


Convert local 'HTML' or 'XHTML' file to 'PDF'

Description

Convert local 'HTML' or 'XHTML' file to 'PDF'

Usage

convert_html_to_pdf(input, verbose = FALSE)

Arguments

input

Path to a local HTML, HTM, or XHTML file.

verbose

Logical; show progress messages.

Value

Invisibly returns the expected output PDF path.

Examples

## Not run: 
convert_html_to_pdf("C:/path/to/file.xhtml")

## End(Not run)

Ensure backend is available

Description

Ensure backend is available

Usage

ensure_html2pdf_backend(ask = interactive(), verbose = FALSE)

Arguments

ask

Logical; ask before downloading when interactive.

verbose

Logical; show progress messages.

Value

Path to the backend executable.


Find configured backend executable

Description

Find configured backend executable

Usage

find_html2pdf_backend()

Value

Path to backend executable, or an empty string if not found.


Install external backend from GitHub Releases

Description

Install external backend from GitHub Releases

Usage

install_html2pdf_backend(
  url = backend_release_url(),
  ask = interactive(),
  overwrite = FALSE,
  timeout = 300,
  verbose = FALSE
)

Arguments

url

Optional URL to a backend zip file. If omitted, the default GitHub Releases URL is used.

ask

Logical; ask before downloading. Defaults to interactive().

overwrite

Logical; overwrite an existing backend installation.

timeout

Download timeout in seconds.

verbose

Logical; show progress messages.

Value

Invisibly returns the installed executable path.


Launch graphical converter application

Description

Launch graphical converter application

Usage

launch_html2pdf_app()

Value

Opens a 'Tk' graphical interface for file selection and conversion.


Set backend executable path

Description

Set backend executable path

Usage

set_html2pdf_backend(path)

Arguments

path

Path to the backend executable.

Value

Invisibly returns the normalized backend path.