https://github.com/agilecreativity/pdfs2pdf
Combine multiple pdfs into one with combined bookmarks
https://github.com/agilecreativity/pdfs2pdf
Last synced: over 1 year ago
JSON representation
Combine multiple pdfs into one with combined bookmarks
- Host: GitHub
- URL: https://github.com/agilecreativity/pdfs2pdf
- Owner: agilecreativity
- License: mit
- Created: 2014-04-24T16:40:33.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2018-03-15T03:25:21.000Z (over 8 years ago)
- Last Synced: 2025-03-30T05:01:58.553Z (over 1 year ago)
- Language: Ruby
- Size: 611 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## pdfs2pdf
[](http://badge.fury.io/rb/pdfs2pdf)
[](https://gemnasium.com/agilecreativity/pdfs2pdf)
[](https://codeclimate.com/github/agilecreativity/pdfs2pdf)
Combine multiple PDF files into a single pdf file with combine table of centent using [Ghostscript][].
### What it does?
Says you have the follow pdf files
```
./test/fixtures/samples/demo1_xxx.rb.xhtml.pdf
./test/fixtures/samples/demo2_xxx.rb.xhtml.pdf
./test/fixtures/samples/sub_dir/demo3_xxx.rb.xhtml.pdf
./test/fixtures/samples/sub_dir/demo4_xxx.rb.xhtml.pdf
```
Which have the following content:
- File: `./test/fixtures/samples/demo1_xxx.rb.xhtml.pdf`

- File: `./test/fixtures/samples/demo2_xxx.rb.xhtml.pdf`

- File: `./test/fixtures/samples/sub_dir/demo3_xxx.rb.xhtml.pdf`

- File: `./test/fixtures/samples/sub_dir/demo4_xxx.rb.xhtml.pdf`

When you run the following command:
```
gem install pdfs2pdf
cd ./test/fixtures/samples
pdfs2pdf --recursive
```
Will produce the result like the following
- File: `pdfs2pdf_samples.pdf` (excepted screenshot)

### Requirements
### Mandatory Requirement
[Ghostscript][]
- Please follow the instruction [here](http://ghostscript.com/doc/current/Install.htm) for
installation from source.
- Alternatively, for Ubuntu you can try `sudo apt-get install ghostscript` and under OSX
you can use [Homebrew](https://github.com/Homebrew/homebrew).
### Usage
```sh
gem install pdfs2pdf
```
### Usage/Synopsis:
```
Usage:
pdfs2pdf
Options:
-b, [--base-dir=BASE_DIR] # Base directory
# Default: . (current directory)
-r, [--recursive], [--no-recursive] # Search for files recursively
# Default: true
-v, [--version], [--no-version] # Display version information
Combine multiple pdfs into one file with bookmarks
```
To combine multiple pdfs just try something like
```
cd ./test/fixtures/samples
pdfs2pdf -r
```
This will merge all the pdf files from `test/fixtures/samples` and generate the
`pdfs2pdf_samples.pdf`.
### Contributing
1. Fork it ( http://github.com/agilecreativity/pdfs2pdf/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
[Ghostscript]: http://www.ghostscript.com/
[Semantic Versioning]: http://semver.org