| Title: | Graphical User Interface for Manipulating PDF and Image Files |
| Version: | 1.9.9 |
| Maintainer: | Steve Choy <steve.choy@outlook.com> |
| Description: | A 'shiny' app that supports merging of PDF and/or image files with page selection, removal, or rotation options. It is a fast, free, and secure alternative to commercial software or various online websites which require users to sign-up, and it avoids any potential risks associated with uploading files elsewhere. |
| License: | MIT + file LICENSE |
| URL: | https://github.com/stevechoy/pdfcombiner, https://lagom.shinyapps.io/pdfcombiner/ |
| BugReports: | https://github.com/stevechoy/pdfcombiner/issues |
| Encoding: | UTF-8 |
| Imports: | shiny, pdftools, qpdf, |
| Suggests: | bslib, rJava, staplr, testthat (≥ 3.0.0), magick, officer, openxlsx, shinythemes |
| Depends: | R (≥ 3.5.0) |
| Config/testthat/edition: | 3 |
| Config/roxygen2/version: | 8.0.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-09-30 23:46:11 UTC; magnu |
| Author: | Steve Choy |
| Repository: | CRAN |
| Date/Publication: | 2026-10-01 01:10:02 UTC |
Convert to Excel
Description
Convert to Excel
Usage
convert_to_excel(pdf_path, output_path)
Arguments
pdf_path |
Path of input PDF |
output_path |
Path to save new Excel file to |
Value
a Excel workbook (as a side effect)
Convert a PDF to PNG images
Description
Renders each page of a PDF as a PNG. Must be called inside a Shiny
withProgress() block because it updates the progress bar.
Usage
convert_to_images(pdf_path, output_dir, dpi = 300)
Arguments
pdf_path |
Path to the input PDF. |
output_dir |
Directory in which a temporary working folder is created. |
dpi |
Rendering resolution in dots per inch. Default is 300. |
Value
Path to the output file: the PNG itself if the PDF has one page, otherwise a ZIP archive containing one PNG per page. Errors if no pages are converted.
Convert to PowerPoint
Description
Convert to PowerPoint
Usage
convert_to_powerpoint(pdf_path, output_path)
Arguments
pdf_path |
Path of input PDF |
output_path |
Path to save new PowerPoint file to |
Value
a print statement (as a side effect)
Convert to Word
Description
Convert to Word
Usage
convert_to_word(pdf_path, output_path)
Arguments
pdf_path |
Path of input PDF |
output_path |
Path to save new Word file to |
Value
print statement (as a side effect)
Format a file size in KB
Description
Rounds to 0 decimal places and adds comma separators.
Usage
format_kb(x)
Arguments
x |
Numeric size in kilobytes. |
Value
A character string, e.g. format_kb(1131.987) returns "1,132".
Convert an image to a PDF
Description
Flattens any transparency onto a white background and writes the image to a PDF. Multi-frame images (e.g. GIF, TIFF) become one page per frame.
Usage
image_to_pdf(img_path, pdf_path, dpi = 72)
Arguments
img_path |
Path to the input image. |
pdf_path |
Path for the output PDF. |
dpi |
Resolution used to set page size (pixels / dpi = inches). Default is 72. |
Value
The path to the PDF that was written (pdf_path).
Check if a Number is a Non-Negative Numeric
Description
This internal function checks whether the input is a non-negative numeric scalar. It can optionally throw an error if the input is invalid.
Usage
is_non_negative_numeric(x, name_of_func, throw_error = TRUE)
Arguments
x |
The input to check. Should be a single numeric value. |
name_of_func |
Name of function to return as error message |
throw_error |
Logical. If |
Details
This function is intended for internal use within the package to validate numeric inputs. It ensures that the input is numeric, has a length of 1, and is greater than 0.
Value
A logical value:
-
TRUEifxis a non-negative numeric scalar. -
FALSEifxis not a non-negative numeric scalar'.
Parse Pages of a PDF
Description
Parse Pages of a PDF
Usage
parse_pages_to_remove(input_string)
Arguments
input_string |
String containing pages to remove |
Value
a numeric vector containing pages to remove
Launches PDF Combiner
Description
Launches the PDF Combiner shiny App. Instructions on usage are
included on the left hand side of the page. By default it uses the bootstrap theme,
allowing minimization of the sidebar. Set argument boostrap_theme = FALSE to turn this
off.
Usage
pdfcombiner(
max_file_size = 500,
bootstrap_theme = TRUE,
sidebar_width = 700,
defaultwm_fontsize = 50,
defaultwm_col = "gray80",
defaultwm_alpha = 0.6,
defaultwm_rot = 45,
defaultwm_fontface = "bold",
defaultwm_height = 11,
defaultwm_width = 8.5,
image_dpi = 300,
compact_level = "ebook",
linearize = FALSE,
verbose = TRUE
)
Arguments
max_file_size |
Max upload file size in MB, change if needed |
bootstrap_theme |
When TRUE, uses bslib bootstrap theme to allow minimizing sidebar |
sidebar_width |
Only applicable when bootstrap theme is used, in pixels |
defaultwm_fontsize |
Default Watermark font size |
defaultwm_col |
Default Watermark color |
defaultwm_alpha |
Default Watermark alpha |
defaultwm_rot |
Default Watermark rotation angle |
defaultwm_fontface |
Default Watermark fontface (one of "plain", "italic", "bold", "bold.italic") |
defaultwm_height |
Default Watermark height in inches (US letter size = 11, A4 = 11.69) |
defaultwm_width |
Default Watermark width in inches (US letter size = 8.5, A4 = 8.27) |
image_dpi |
Dots per inch for use when converting to images |
compact_level |
One of "none" (not used), "printer" (300dpi), "ebook" (150dpi), "screen" (72dpi), only applicable if Ghostscript is installed |
linearize |
Default FALSE. When TRUE, optimizes PDF for web-viewing (loads first page quickly) |
verbose |
Prints out working messages in console |
Details
The user is highly recommended to also install the staplr package as it supports bookmarks, however it uses Java so you may need to install Java separately if your system does not currently have it. In addition, the magick package is recommended for supporting uploading of image files.
Value
a Shiny App
Note
All PDF files are stored locally in a per-session temporary directory, given by the tempdir() function.
See Also
https://github.com/stevechoy/pdfcombiner, pdftools, qpdf
Examples
if (interactive()) {
pdfcombiner(bootstrap_theme = FALSE) # Do not use bootstrap theme (if `shiny` version is < 1.7.4)
}
Sanitize File names
Description
Sanitize File names
Usage
sanitize_filename(filename)
Arguments
filename |
String containing a user-provided file name |
Value
a sanitized character for the file name
Sums up disk spaces used for PDF files
Description
Sums up disk spaces used for PDF files
Usage
sum_disk_space(file_list)
Arguments
file_list |
Names list of PDF files |
Value
A character containing total size in kilobytes
Watermark Stamp
Description
Watermark Stamp
Usage
watermark_stamp(
input_pdf,
output_pdf,
watermark_text,
watermark_fontsize = 50,
watermark_col = "gray80",
fallback_col = "gray80",
watermark_alpha = 0.6,
watermark_rot = 45,
watermark_fontface = "bold",
watermark_height = 11,
watermark_width = 8.5
)
Arguments
input_pdf |
Path of input PDF |
output_pdf |
Path of output PDF |
watermark_text |
Watermark text |
watermark_fontsize |
Watermark fontsize |
watermark_col |
Watermark color |
fallback_col |
Fallback color to use |
watermark_alpha |
Watermark alpha |
watermark_rot |
Watermark rotation angle |
watermark_fontface |
Watermark fontface (one of "plain", "bold", "italic", "bold.italic") |
watermark_height |
Watermark overlay height (inches) |
watermark_width |
Watermark overlay width (inches) |
Value
a path of output PDF