pdfs2pdf 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOGS.md +7 -0
- data/README.md +10 -18
- data/config/initializers/pdfs2pdf.rb +2 -1
- data/lib/pdfs2pdf/configuration.rb +3 -3
- data/lib/pdfs2pdf/pdfs2pdf.rb +2 -1
- data/lib/pdfs2pdf/version.rb +1 -1
- data/pdfs2pdf.gemspec +1 -0
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1aa6f81f518a13a0a07858293396cc9d8693d9c3
|
4
|
+
data.tar.gz: 3a264a4e84c530cdb7c1684f7c5ca492b0bc5400
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6d1f1c0b42f667b9ca5c27c71fbbe37fe658791230521baaf0ab311e900bcaa22d574e417129828ba23e45f5a5a49852b12fbe801375ae45b38d008ec29f0b9
|
7
|
+
data.tar.gz: e1b2f62672321522b79d1231ed5a187668ea403dc11e5ee7ccaea0dc01f19eb0d38d46d66ac277c2707b98e204b08af283b7f3fe1935635e5f61a933fc5ef7f0
|
data/CHANGELOGS.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
### Changelogs
|
2
2
|
|
3
|
+
#### 0.0.8
|
4
|
+
|
5
|
+
- Add the 'gs_binary' to configurable options in `config/initializers/pdfs2pdf.rb`
|
6
|
+
- Remove the 'gs_binary' from configurable options in `config/initializers/pdfs2pdf.rb`
|
7
|
+
- Improve README.md
|
8
|
+
- Add the missing 'awesome_print' from gemspec file
|
9
|
+
|
3
10
|
#### 0.0.7
|
4
11
|
|
5
12
|
- Simplify the api by removing some of the options
|
data/README.md
CHANGED
@@ -4,19 +4,9 @@
|
|
4
4
|
[](https://gemnasium.com/agilecreativity/pdfs2pdf)
|
5
5
|
[](https://codeclimate.com/github/agilecreativity/pdfs2pdf)
|
6
6
|
|
7
|
-
Combine multiple PDF files into one file with simple bookmarks support.
|
7
|
+
Combine multiple PDF files into one file with simple bookmarks support using [Ghostscript][].
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
- [Ghostscript][] - for combining multiple pdf files
|
12
|
-
- [Wkhtmltopdf][] - for converting file to PDF
|
13
|
-
|
14
|
-
and it is built on top of my other gems
|
15
|
-
|
16
|
-
- [agile_utils][] gem
|
17
|
-
- [code_lister][] gem
|
18
|
-
|
19
|
-
## What it does?
|
9
|
+
### What it does?
|
20
10
|
|
21
11
|
Says you have the follow pdf files (included inside the test fixtures)
|
22
12
|
|
@@ -65,12 +55,17 @@ Will produce the result like the following
|
|
65
55
|
|
66
56
|

|
67
57
|
|
68
|
-
###
|
58
|
+
### Requirements
|
69
59
|
|
70
60
|
### Mandatory Requirement
|
71
61
|
|
72
|
-
|
73
|
-
|
62
|
+
[Ghostscript][]
|
63
|
+
|
64
|
+
- Please follow the instruction [here](http://ghostscript.com/doc/current/Install.htm) for
|
65
|
+
installation from source.
|
66
|
+
|
67
|
+
- Alternatively, for Ubuntu you can try `sudo apt-get install ghostscript` and under OSX
|
68
|
+
you can use [Homebrew](https://github.com/Homebrew/homebrew).
|
74
69
|
|
75
70
|
## Usage
|
76
71
|
|
@@ -135,6 +130,3 @@ letters, numbers and/or underscore characters. Any other characters like
|
|
135
130
|
5. Create new Pull Request
|
136
131
|
|
137
132
|
[Ghostscript]: http://www.ghostscript.com/
|
138
|
-
[Wkhtmltopdf]: http://wkhtmltopdf.org/
|
139
|
-
[agile_utils]: https://github.com/agilecreativity/agile_utils
|
140
|
-
[code_lister]: https://github.com/agilecreativity/code_lister
|
@@ -6,7 +6,8 @@ module Pdfs2Pdf
|
|
6
6
|
def update_config
|
7
7
|
Pdfs2Pdf.configure do |config|
|
8
8
|
# Note: add your custom config here
|
9
|
-
# config.
|
9
|
+
# config.gs_binary = '/usr/bin/gs'
|
10
|
+
#
|
10
11
|
# config.default_options = {
|
11
12
|
# paper_size: 'Letter',
|
12
13
|
# ..
|
@@ -3,7 +3,7 @@ module Pdfs2Pdf
|
|
3
3
|
class Configuration
|
4
4
|
attr_accessor :default_options,
|
5
5
|
:pdfmarks_meta,
|
6
|
-
:
|
6
|
+
:gs_binary
|
7
7
|
|
8
8
|
def initialize
|
9
9
|
# see: http://wkhtmltopdf.org/usage/wkhtmltopdf.txt
|
@@ -25,7 +25,7 @@ module Pdfs2Pdf
|
|
25
25
|
| /DOCINFO pdfmark
|
26
26
|
END
|
27
27
|
|
28
|
-
@
|
28
|
+
@gs_binary = (defined?(Bundler::GemfileError) ? `bundle exec which gs` : `which gs`).chomp
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -39,7 +39,7 @@ module Pdfs2Pdf
|
|
39
39
|
#
|
40
40
|
# Pdfs2pdf.configure do |config|
|
41
41
|
# # set the path to wkhtmltopdf
|
42
|
-
# config.
|
42
|
+
# config.gs_binary = '/usr/bin/gs'
|
43
43
|
# end
|
44
44
|
def configuration
|
45
45
|
@configuration ||= Configuration.new
|
data/lib/pdfs2pdf/pdfs2pdf.rb
CHANGED
@@ -35,8 +35,9 @@ module Pdfs2Pdf
|
|
35
35
|
# @param [String] output_file the output pdf file
|
36
36
|
def merge_pdfs(list, pdfmarks = 'pdfmarks', output_file = 'output.pdf')
|
37
37
|
paper_size = Pdfs2Pdf.configuration.default_options[:paper_size]
|
38
|
+
gs_binary = Pdfs2Pdf.configuration.gs_binary
|
38
39
|
_stdin, _stderr, status = Open3.capture3(
|
39
|
-
|
40
|
+
gs_binary,
|
40
41
|
'-q',
|
41
42
|
'-dNOPAUSE',
|
42
43
|
'-dBATCH',
|
data/lib/pdfs2pdf/version.rb
CHANGED
data/pdfs2pdf.gemspec
CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_runtime_dependency 'agile_utils', '~> 0.0.9'
|
29
29
|
spec.add_runtime_dependency 'code_lister', '~> 0.0.9'
|
30
30
|
spec.add_runtime_dependency 'pdf-reader', '~> 1.3.3'
|
31
|
+
spec.add_development_dependency 'awesome_print', '~> 1.2.0'
|
31
32
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
32
33
|
spec.add_development_dependency 'gem-ctags', '~> 1.0'
|
33
34
|
spec.add_development_dependency 'guard-minitest', '~> 2.2'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdfs2pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burin Choomnuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.3.3
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: awesome_print
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.2.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.2.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: bundler
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -247,10 +261,10 @@ signing_key:
|
|
247
261
|
specification_version: 4
|
248
262
|
summary: Combine multiple pdfs into one pdf with proper bookmarks for easy navigation
|
249
263
|
test_files:
|
250
|
-
- test/fixtures/samples/demo1_xxx.rb.xhtml.pdf
|
251
|
-
- test/fixtures/samples/demo2_xxx.rb.xhtml.pdf
|
252
|
-
- test/fixtures/samples/sub_dir/demo3_xxx.rb.xhtml.pdf
|
253
|
-
- test/fixtures/samples/sub_dir/demo4_xxx.rb.xhtml.pdf
|
254
264
|
- test/lib/pdfs2pdf/test_pdfs2pdf.rb
|
255
265
|
- test/test_helper.rb
|
266
|
+
- test/fixtures/samples/demo2_xxx.rb.xhtml.pdf
|
267
|
+
- test/fixtures/samples/sub_dir/demo4_xxx.rb.xhtml.pdf
|
268
|
+
- test/fixtures/samples/sub_dir/demo3_xxx.rb.xhtml.pdf
|
269
|
+
- test/fixtures/samples/demo1_xxx.rb.xhtml.pdf
|
256
270
|
has_rdoc:
|