convert_to_png {texor} | R Documentation |
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)
Arguments
file_path |
path to the pdf file |
dpi |
Set DPI for converting PDF files. default: 180 |
Value
png file of the same
Note
If you find inconsistencies in the raster image generated from PDF using this function. Please update poppler utils to newer versions (possibly latest one).
Examples
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)
[Package texor version 1.3.0 Index]