Learn R Programming

texor (version 1.5.3)

convert_to_png: convert one single pdf file to png

Description

function to invoke `pdftools:pdf_convert()`

This function is designed to be used internally and is called by `texor::pdf_to_png(file_dir)` function for converting individual of pdf image.

Note : The extensions in LaTeX source code will automatically be changed during pandoc conversion by a lua filter (refer : inst/extdata/image_filter.lua)

Usage

convert_to_png(file_path, dpi = 180)

Value

png file of the same

Arguments

file_path

path to the pdf file

dpi

Set DPI for converting PDF files. default: 180

Examples

Run this code
article_dir <- system.file("examples/pdf_conversion",
                 package = "texor")
dir.create(your_article_folder <- file.path(tempdir(), "tempdir"))
x <- file.copy(from = article_dir, to = your_article_folder,recursive = TRUE,)
your_article_path <- paste(your_article_folder,"pdf_conversion",sep="/")
rmarkdown::pandoc_version()
texor::convert_to_png(paste0(your_article_path,"/normal.pdf"))
unlink(your_article_folder,recursive = TRUE)

Run the code above in your browser using DataLab