Created
November 3, 2017 12:41
-
-
Save apoorv74/cf085aa356a84c8cd8e6f23c1f82b304 to your computer and use it in GitHub Desktop.
Merging PDF's
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(plotflow) | |
library(reports) | |
## make a folder to store the pdfs | |
folder(deleteMe) | |
## paste the paths to pdfs together in one string w/ spaces | |
plotflow:::mergePDF( | |
in.file=paste(file.path("deleteMe", dir("deleteMe")), collapse=" "), | |
file="merged.pdf" | |
) | |
## delete MWE | |
delete('deleteMe') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To reduce PDF size - use this ghostscript utility
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=mydocsmaller.pdf UNDP\ India\ -\ Technical\ Proposal.pdf
file size or image quality can be manipulated by adjusting the PDFSETTINGS parameter, eg:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dColorImageResolution=200 \-dNOPAUSE -dQUIET -dBATCH -sOutputFile=mydocsmaller.pdf UNDP\ India\ -\ Technical\ Proposal.pdf
SO: https://stackoverflow.com/questions/10450120/optimize-pdf-files-with-ghostscript-or-other