Learn R Programming

psycModel (version 0.5.0)

html_to_pdf: Convert HTML to PDF

Description

[Experimental]
This is a helper function for knitting Rmd. Due to technological limitation, the output cannot knit to PDF in Rmd directly (the problem is with the latex engine printing unicode character). Therefore, to bypass this problem, you will first need to knit to html file first, then use this function to convert it to a PDF file.

Usage

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

Value

no return value

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

Examples

Run this code
if (FALSE) {
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")
}

Run the code above in your browser using DataLab