Title: Graphical User Interface for Manipulating PDF and Image Files
Version: 1.9.8
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
RoxygenNote: 7.3.2
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
NeedsCompilation: no
Packaged: 2025-09-04 05:21:25 UTC; choysiuf
Author: Steve Choy ORCID iD [aut, cre, cph]
Repository: CRAN
Date/Publication: 2025-09-09 14:00:08 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 to Images

Description

Convert to Images

Usage

convert_to_images(pdf_path, output_dir, dpi = 300)

Arguments

pdf_path

Path of input PDF

output_dir

Path to save new PowerPoint file to

dpi

dots per inch for .png files, default 300

Value

a path to either a .zip file (if multiple images) or a single .png file


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)


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 TRUE, the function throws an error when the input is invalid. Defaults to FALSE, in which case the function returns FALSE for invalid inputs.

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:


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