pdf-merger 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == 0.1.2 2011-09-26
2
+
3
+ * save_as returns the number of pages in the new file
4
+
1
5
  == 0.1.1 2011-09-10
2
6
 
3
7
  * No code changes. Updated README, Rakefile, Gemfile.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -10,7 +10,7 @@ include FileUtils
10
10
 
11
11
  module PDF
12
12
  class Merger
13
- VERSION = "0.1.1"
13
+ VERSION = "0.1.2"
14
14
 
15
15
  if RUBY_PLATFORM =~ /java/ # ifdef to check if your using JRuby
16
16
  require 'pdf/merger/jruby'
@@ -14,6 +14,7 @@ module PDF
14
14
  class Merger
15
15
 
16
16
  # Saves the PDF into a file defined by path given.
17
+ # return the number of pages in the new file
17
18
  def save_as(output_file_path)
18
19
  filestream = FileOutputStream.new(output_file_path)
19
20
  copy = PdfCopyFields.new(filestream)
@@ -23,6 +24,7 @@ module PDF
23
24
  end
24
25
 
25
26
  copy.close()
27
+ PdfReader.new(output_file_path).getNumberOfPages
26
28
  end
27
29
 
28
30
  end
@@ -19,6 +19,7 @@ module PDF
19
19
  # Check the RJB documentation if you are having issues with this.
20
20
  class Merger
21
21
  # Saves the PDF into a file defined by path given.
22
+ # return the number of pages in the new file
22
23
  def save_as(output_file_path)
23
24
  @pdfreader = Rjb::import('com.lowagie.text.pdf.PdfReader')
24
25
  @pdfcopyfields = Rjb::import('com.lowagie.text.pdf.PdfCopyFields')
@@ -32,6 +33,7 @@ module PDF
32
33
  end
33
34
 
34
35
  copy.close()
36
+ @pdfreader.new(output_file_path).getNumberOfPages
35
37
  end
36
38
 
37
39
  end
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{pdf-merger}
8
- s.version = "0.1.1"
7
+ s.name = "pdf-merger"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Paul Schreiber"]
12
- s.date = %q{2011-09-10}
13
- s.description = %q{Merge multiple PDFs in to one using iText's PdfCopyFile.}
14
- s.email = %q{paulschreiber@gmail.com}
12
+ s.date = "2011-09-26"
13
+ s.description = "Merge multiple PDFs in to one using iText's PdfCopyFile."
14
+ s.email = "paulschreiber@gmail.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.txt"
@@ -32,17 +32,16 @@ Gem::Specification.new do |s|
32
32
  "spec/pdf_merger_spec.rb",
33
33
  "spec/test_template.pdf"
34
34
  ]
35
- s.homepage = %q{http://github.com/paulschreiber/pdf-merger}
35
+ s.homepage = "http://github.com/paulschreiber/pdf-merger"
36
36
  s.licenses = ["MIT"]
37
37
  s.require_paths = ["lib"]
38
- s.rubygems_version = %q{1.3.6}
39
- s.summary = %q{Merge PDFs.}
38
+ s.rubygems_version = "1.8.10"
39
+ s.summary = "Merge PDFs."
40
40
 
41
41
  if s.respond_to? :specification_version then
42
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
43
42
  s.specification_version = 3
44
43
 
45
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
44
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
45
  s.add_development_dependency(%q<shoulda>, [">= 0"])
47
46
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
48
47
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdf-merger
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 31
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 1
9
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - Paul Schreiber
@@ -14,60 +15,67 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-09-10 00:00:00 -04:00
18
- default_executable:
18
+ date: 2011-09-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- prerelease: false
22
- type: :development
23
- name: shoulda
24
21
  version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ none: false
25
23
  requirements:
26
24
  - - ">="
27
25
  - !ruby/object:Gem::Version
26
+ hash: 3
28
27
  segments:
29
28
  - 0
30
29
  version: "0"
31
- requirement: *id001
32
- - !ruby/object:Gem::Dependency
30
+ name: shoulda
33
31
  prerelease: false
34
32
  type: :development
35
- name: bundler
33
+ requirement: *id001
34
+ - !ruby/object:Gem::Dependency
36
35
  version_requirements: &id002 !ruby/object:Gem::Requirement
36
+ none: false
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
+ hash: 23
40
41
  segments:
41
42
  - 1
42
43
  - 0
43
44
  - 0
44
45
  version: 1.0.0
45
- requirement: *id002
46
- - !ruby/object:Gem::Dependency
46
+ name: bundler
47
47
  prerelease: false
48
48
  type: :development
49
- name: jeweler
49
+ requirement: *id002
50
+ - !ruby/object:Gem::Dependency
50
51
  version_requirements: &id003 !ruby/object:Gem::Requirement
52
+ none: false
51
53
  requirements:
52
54
  - - ~>
53
55
  - !ruby/object:Gem::Version
56
+ hash: 7
54
57
  segments:
55
58
  - 1
56
59
  - 6
57
60
  - 4
58
61
  version: 1.6.4
59
- requirement: *id003
60
- - !ruby/object:Gem::Dependency
62
+ name: jeweler
61
63
  prerelease: false
62
64
  type: :development
63
- name: rcov
65
+ requirement: *id003
66
+ - !ruby/object:Gem::Dependency
64
67
  version_requirements: &id004 !ruby/object:Gem::Requirement
68
+ none: false
65
69
  requirements:
66
70
  - - ">="
67
71
  - !ruby/object:Gem::Version
72
+ hash: 3
68
73
  segments:
69
74
  - 0
70
75
  version: "0"
76
+ name: rcov
77
+ prerelease: false
78
+ type: :development
71
79
  requirement: *id004
72
80
  description: Merge multiple PDFs in to one using iText's PdfCopyFile.
73
81
  email: paulschreiber@gmail.com
@@ -93,7 +101,6 @@ files:
93
101
  - pdf-merger.gemspec
94
102
  - spec/pdf_merger_spec.rb
95
103
  - spec/test_template.pdf
96
- has_rdoc: true
97
104
  homepage: http://github.com/paulschreiber/pdf-merger
98
105
  licenses:
99
106
  - MIT
@@ -103,23 +110,27 @@ rdoc_options: []
103
110
  require_paths:
104
111
  - lib
105
112
  required_ruby_version: !ruby/object:Gem::Requirement
113
+ none: false
106
114
  requirements:
107
115
  - - ">="
108
116
  - !ruby/object:Gem::Version
117
+ hash: 3
109
118
  segments:
110
119
  - 0
111
120
  version: "0"
112
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
+ none: false
113
123
  requirements:
114
124
  - - ">="
115
125
  - !ruby/object:Gem::Version
126
+ hash: 3
116
127
  segments:
117
128
  - 0
118
129
  version: "0"
119
130
  requirements: []
120
131
 
121
132
  rubyforge_project:
122
- rubygems_version: 1.3.6
133
+ rubygems_version: 1.8.10
123
134
  signing_key:
124
135
  specification_version: 3
125
136
  summary: Merge PDFs.