All Projects β†’ pridiltal β†’ Staplr

pridiltal / Staplr

PDF Toolkit. πŸ“Ž πŸ”¨ πŸ”§ βœ‚οΈ πŸ“‘ πŸ“πŸ“Ž πŸ”– 🚧 πŸ‘·

Programming Languages

java
68154 projects - #9 most used programming language
r
7636 projects

Projects that are alternatives of or similar to Staplr

Ibm Z Zos
The helpful and handy location for finding and sharing z/OS files, which are not included in the product.
Stars: ✭ 198 (-10.41%)
Mutual labels:  pdf
Gscholar
Query Google Scholar with Python
Stars: ✭ 209 (-5.43%)
Mutual labels:  pdf
Bedops
πŸ”¬ BEDOPS: high-performance genomic feature operations
Stars: ✭ 215 (-2.71%)
Mutual labels:  toolkit
Awesome Books
πŸ“š εΌ€ε‘θ€…ζŽ¨θι˜…θ―»ηš„δΉ¦η±
Stars: ✭ 2,740 (+1139.82%)
Mutual labels:  pdf
Grim
Tool for extracting pages from pdf as images and text as strings.
Stars: ✭ 208 (-5.88%)
Mutual labels:  pdf
Libagar
Cross-Platform GUI Toolkit (stable)
Stars: ✭ 212 (-4.07%)
Mutual labels:  toolkit
Hiddeneye Legacy
Modern Phishing Tool With Advanced Functionality And Multiple Tunnelling Services [ Android-Support-Available ]
Stars: ✭ 2,568 (+1061.99%)
Mutual labels:  toolkit
Xrtk Core
The Official Mixed Reality Framework for Unity
Stars: ✭ 219 (-0.9%)
Mutual labels:  toolkit
Pdfium Binaries
πŸ“° Binary distribution of PDFium
Stars: ✭ 208 (-5.88%)
Mutual labels:  pdf
Yarg
Yet Another Report Generator - CUBA Platform reporting engine
Stars: ✭ 215 (-2.71%)
Mutual labels:  pdf
Fe Books
πŸ“– πŸ“– 前端书籍pdf整理
Stars: ✭ 206 (-6.79%)
Mutual labels:  pdf
Mola
A Modular Optimization framework for Localization and mApping (MOLA)
Stars: ✭ 206 (-6.79%)
Mutual labels:  toolkit
Paperwork
Personal document manager (Linux/Windows) -- Moved to Gnome's Gitlab
Stars: ✭ 2,392 (+982.35%)
Mutual labels:  pdf
Pdfgen
Simple C PDF Writer/Generation library
Stars: ✭ 200 (-9.5%)
Mutual labels:  pdf
Spiceypy
SpiceyPy: a Pythonic Wrapper for the SPICE Toolkit.
Stars: ✭ 218 (-1.36%)
Mutual labels:  toolkit
React Native Pdfview
πŸ“š PDF viewer for React Native
Stars: ✭ 198 (-10.41%)
Mutual labels:  pdf
Luminoth
Deep Learning toolkit for Computer Vision.
Stars: ✭ 2,386 (+979.64%)
Mutual labels:  toolkit
Asciidoctor Web Pdf
Convert AsciiDoc documents to PDF using web technologies
Stars: ✭ 219 (-0.9%)
Mutual labels:  pdf
Phonia
Phonia Toolkit is one of the most advanced toolkits to scan phone numbers using only free resources. The goal is to first gather standard information such as country, area, carrier and line type on any international phone numbers with a very good accuracy.
Stars: ✭ 221 (+0%)
Mutual labels:  toolkit
Pandoc Book Template
A simple Pandoc template to build documents and ebooks.
Stars: ✭ 214 (-3.17%)
Mutual labels:  pdf

staplr

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Licence Build Status


CRAN_Status_Badge


Last-changedate

staplr

This package provides functions to manipulate PDF files:

  • fill out PDF forms: get_fields() and set_fields()
  • merge multiple PDF files into one: staple_pdf()
  • remove selected pages from a file: remove_pages()
  • rename multiple files in a directory: rename_files()
  • rotate entire pdf document: rotate_pdf()
  • rotate selected pages of a pdf file: rotate_pages()
  • Select pages from a file: select_pages()
  • splits single input PDF document into individual pages: split_pdf()
  • splits single input PDF document into parts from given points: split_from()

This package is still under development and this repository contains a development version of the R package staplr.

Installation

staplr requires a Java installation on your system. You can get the latest version of java from here. OpenJDK also works.

You can install the stable version from CRAN.

install.packages('staplr', dependencies = TRUE)

You can install staplr from github with:

# install.packages("devtools")
devtools::install_github("pridiltal/staplr")

Example

library(staplr)
# Merge multiple PDF files into one
staple_pdf()

# This command prompts the user to select the file interactively. 
# Remove page 2 and 3 from the selected file.
remove_pages(rmpages = c(2,3))

# This function selects pages from a file;
select_pages(selpages = c(1,3))

# This function splits a single input PDF document into individual pages
split_pdf()

# This function writes renamed files back to directory
#if the directory contains 3 PDF files
rename_files(new_names = paste("file",1:3))

# These functions are to fill out pdf forms
get_fields() 
set_fields()
# This includes 2 external functions `get_fields` and `set_fields` 
# and files to use as examples.
# This is what the example file looks like
# If you get path to this file by
pdfFile = system.file('testForm.pdf',package = 'staplr')

# And do
fields = get_fields(pdfFile)
# You'll get a list of fields that the pdf contains 
# along with some additional information about the fields.

# You make modifications in any of the fields by
fields$TextField1$value = 'this is text'
set_fields(pdfFile, 'newFile.pdf', fields)

# This will create a filled pdf file

Troubleshooting and 2.11.0 changes

  • As of version 2.11.0, the package uses pdftk-java instead of using the original pdftk. pdftk-java is included with the package so if you have a working java installation, you shouldn’t have any problems.

  • While default java options should be enough for most use cases, if you need to, you can change java options that is used to run pdftk by doing

options('staplr_java_options' = '-Xmx512m') 

This option is not affected by rJava settings.

  • If you don’t have a working java installation, your installation will fail since you can’t install rJava. Make sure you follow the proper instructions for java installation. For openJDK on linux make sure you get both jdk and jre and run javareconf.
sudo apt update -y
sudo apt install -y openjdk-8-jdk openjdk-8-jre
sudo R CMD javareconf

Also restart your R session after javareconf

  • pdftk-java is built as a faithful representation of the original pdftk so there shouldn’t be any major differences between the outputs. However, for any reason you’d prefer to run a local installation of pdftk rather than using the version that is shipped with the package, do
# set staplr_custom_pdftk to the path to local installation
# just setting to pdftk will do if it's already in your path
 options('staplr_custom_pdftk' = 'pdftk') 

If you want to do this, you can get the original version of pdftk from here. Note that MacOS users with a version higher than β€œHigh Sierra” should use this version instead.

Make sure to set the option back to NULL if you want to use the built in pdftk later.

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].