html_to_pdf: Convert HTML to PDF

Description Usage Arguments Value Examples

View source: R/html_to_pdf.R

Description

[Experimental]
This is a helper function for knitting Rmd. Due to technological limitation, the output cannot knit to PDF in Rmd directly. It uses the pagedown::chrome_print() in the backend. You must first knit to HTML, then you can use this function to covert them to PDF if you wish. I know this is a workaround to the issue, but the problem is with the latex engine printing unicode character. If you happen to know how to fix it, please let me know.

Usage

1
html_to_pdf(file_path = NULL, dir = NULL, scale = 1, render_exist = FALSE)

Arguments

file_path

file path to the HTML file (can be relative if you are in a R project)

dir

file path to the directory of all HTML files (can be relative if you are in a R project)

scale

the scale of the PDF

render_exist

overwrite exist PDF. Default is FALSE

Value

no return value

Examples

1
2
3
4
5
6
## Not run: 
html_to_pdf(file_path = "html_name.html")
# all HTML files in the my_html_folder will be converted
html_to_pdf(dir = "Users/Desktop/my_html_folder")

## End(Not run)

psycModel documentation built on Sept. 5, 2021, 5:43 p.m.