Skip to content

Instantly share code, notes, and snippets.

@jansim
Created April 24, 2024 09:00
Show Gist options
  • Save jansim/063e2f70c556a9a5fd5cf2f28c669a1e to your computer and use it in GitHub Desktop.
Save jansim/063e2f70c556a9a5fd5cf2f28c669a1e to your computer and use it in GitHub Desktop.
R Script to embed fonts in PDFs
# Set the directory containing the PDF files
pdf_directory <- "path/to/dir/with/pdfs"
# Get a list of all PDF files in the directory
pdf_files <- list.files(path = pdf_directory, pattern = "\\.pdf$", full.names = TRUE)
# Iterate through each PDF file and embed fonts
for (pdf_file in pdf_files) {
print(paste("Embedding fonts in:", pdf_file))
embedFonts(pdf_file)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment