knitr::opts_chunk$set(echo = TRUE, collapse = TRUE)
library(r2rtf)
r2rtf:::rtf_convert_format(
  input = list.files("vignettes/rtf/", pattern = "*.rtf", full.names = TRUE),
  output_dir = "vignettes/html",
  format = "html"
)

Overview

r2rtf had an experimental internal function r2rtf:::rtf_convert_format to convert RTF format to PDF, DOCX, or HTML. This feature requires LibreOffice >= 7.1 and was only tested in a Linux environment.

By default, r2rtf:::rtf_convert_format convert RTF file to PDF format. The PDF file will be saved in the same folder with same file name by default.

In example below, ae_example.pdf will be created in the same folder.

r2rtf:::rtf_convert_format(input = "rtf/ae_example.rtf")
r2rtf:::rtf_convert_format(input = list.files("rtf", pattern = "*.rtf"))
r2rtf:::rtf_convert_format(input = "rtf/ae_example.rtf", format = "html")

Limitations

There is one known limitation after RTF file convert to HTML files:

knitr::include_graphics("pdf/border-type.pdf")

````{=html}

xfun::file_string("html/border-type.html")

````



Merck/r2rtf documentation built on April 18, 2024, 11:51 a.m.