book: Bind PDF Book

View source: R/book.R

bookR Documentation

Bind PDF Book

Description

Bind book from many PDF files.

Usage

book(directory, merge = TRUE, redistill = TRUE)

Arguments

directory

where the PDF files are.

merge

whether to merge the chapters - otherwise return cmd.

redistill

whether to redistill ‘out.pdf’ (pdftk output) to ‘_out.pdf’ (Ghostscript output).

Value

Shell command string used to merge PDF files with pdftk.

Warning

The final Ghostscript redistillation is launched with wait = FALSE, so the best way to see if it is finished is to check if any Ghostscript processes are active.

Note

The PDF files should be named something like ‘0.pdf 1.pdf 27.pdf 42.pdf ... 397.pdf 413a.pdf 413b.pdf’.

Before this function is called, unnecessary pages can be peeled out of ‘0.pdf’, and the last file often needs splitting, e.g. ‘413.pdf’ into ‘413a.pdf’ and ‘413b.pdf’.

Three files are written to directory: ‘_’ (blank page of right size), ‘out.pdf’ (book merged with pdftk), and ‘_out.pdf’ (‘out.pdf’ redistilled with Ghostscript).

After this function is called, one should check ‘out.pdf’ to see whether pages are correctly numbered, and ‘out_.pdf’ to see whether the Ghostscript-redistilled document is smaller while retaining intact images and no red borders around links


arnima-github/arni documentation built on Oct. 28, 2023, 6:18 p.m.