Thumbnail of a document
Convert a file into an image (magick image) where the pages are arranged in rows, each row can contain one to several pages.
The result can be saved as a png file.
to_miniature( filename, row = NULL, width = NULL, border_color = "#ccc", border_geometry = "2x2", fileout = NULL, use_docx2pdf = FALSE )
filename |
input filename, a 'Microsoft Word' or a 'Microsoft Word' or a 'PDF' document. |
row |
row index for every pages. 0 are to be used to drop the page from the final minature.
|
width |
width of a single image, recommanded values are:
|
border_color |
border color, see |
border_geometry |
border geometry to be added around
images, see |
fileout |
if not NULL, result is saved in a png file whose filename is defined by this argument. |
use_docx2pdf |
if TRUE (and if 'Microsoft Word' executable can be found as well as 'docx2pdf'), docx2pdf will be used to convert 'Word' documents to PDF. This makes it possible to have a PDF identical to the 'Word' display whereas with 'LibreOffice', this is not always the case. |
a magick image object as returned by image_read()
.
library(locatexec) docx_file <- system.file( package = "doconv", "doc-examples/example.docx" ) if(exec_available("python") && docx2pdf_available()) to_miniature(docx_file, use_docx2pdf = TRUE) pptx_file <- system.file( package = "doconv", "doc-examples/example.pptx" ) if(exec_available("libreoffice") && check_libreoffice_export()) to_miniature(pptx_file)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.