Learn R Programming

LJexm

LJexm is an R package designed to automate the process of extracting ZIP files, converting 'Word', 'Excel', and 'HTML/HTM' files to PDFs, and merging PDF files in a structured order.

Installation

To install LJexm from source, run:

# Install from source  
install.packages("LJexm", repos = NULL, type = "source")  

Usage

Load the package and run the application:

library(LJexm)  
run_app()  

Error Handling

  • Errors and status messages are logged in conversion_log.txt during execution.
  • After processing, messages are printed using message() in R.

Manually Checking Errors (If Needed)

If you need to check errors manually before running the script, you can view the log file:

log_file <- file.path("path/to/your/folder", "conversion_log.txt")  
if (file.exists(log_file)) {  
  log_content <- readLines(log_file)  
  message(log_content, appendLF = TRUE)  
}  

Features

  • Extracts ZIP files in a given directory.
  • Converts .docx and .xlsx files to PDFs using VBScript.
  • Converts .html and .htm files to PDFs using webshot and PhantomJS.
  • Merges PDF files in alphabetical order, ensuring correct sequencing.
  • Case-insensitive processing for .docx, .xlsx, .pdf, .html, and .htm files.
  • Automatically logs errors and prints them in R using message().
  • Works in both RStudio and Base R.

Dependencies

This package requires the following dependencies:

  • fs
  • pdftools
  • rstudioapi
  • utils
  • webshot

These dependencies will be automatically installed when you install LJexm.

License

This package is licensed under GPL-3.

Copy Link

Version

Install

install.packages('LJexm')

Monthly Downloads

155

Version

1.0.5

License

GPL (>= 3)

Maintainer

Lijin Arakkandathil Thekkathil

Last Published

March 30th, 2025

Functions in LJexm (1.0.5)

merge_pdfs

Merge PDFs in Alphabetical Order
convert_files_to_pdf

Convert Word & Excel Files to PDFs using 'VBScript'
run_app

Run the Full Process: Extract, Convert, and Merge PDFs
extract_zip_files

Extract ZIP Files in a Given Folder
convert_html_to_pdf

Convert HTML/HTM Files to PDF Automatically installs 'PhantomJS' if missing.