pdf-merger 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ == 0.2.0 2012-04-26
2
+ * add_javascript adds JavaScript to the new file
3
+
1
4
  == 0.1.2 2011-09-26
2
5
 
3
6
  * save_as returns the number of pages in the new file
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2011 Paul Schreiber
1
+ Copyright (c) 2010-2012 Paul Schreiber
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.txt CHANGED
@@ -10,6 +10,7 @@ require "pdf/merger"
10
10
  pdf = PDF::Merger.new
11
11
  pdf.add_file "foo.pdf"
12
12
  pdf.add_file "bar.pdf"
13
+ pdf.add_javascript "this.print(true);"
13
14
  pdf.save_as "combined.pdf"
14
15
 
15
16
  == Encoding
@@ -21,5 +22,5 @@ ENV["LC_ALL"] = "en_US.utf8"
21
22
 
22
23
  == License
23
24
 
24
- Copyright (c) 2011 Paul Schreiber. Released under the MIT License.
25
+ Copyright 2010-12 Paul Schreiber. Released under the MIT License.
25
26
  See LICENSE.txt for further details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.2.0
@@ -1,6 +1,6 @@
1
1
  # = pdf/merger.rb -- PDF merging
2
2
  #
3
- # Copyright (c) 2010 Paul Schreiber
3
+ # Copyright 2010-12 Paul Schreiber
4
4
 
5
5
  require 'rbconfig'
6
6
  require 'fileutils'
@@ -29,6 +29,11 @@ module PDF
29
29
 
30
30
  def initialize
31
31
  @files_to_merge = []
32
+ @js = nil
33
+ end
34
+
35
+ def add_javascript(js)
36
+ @js = js
32
37
  end
33
38
 
34
39
  def add_file(file_path)
@@ -1,6 +1,6 @@
1
1
  # = pdf/merger/rjb.rb -- PDF template stamping.
2
2
  #
3
- # Copyright (c) 2010 Paul Schreiber
3
+ # Copyright 2010-12 Paul Schreiber
4
4
 
5
5
  $:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', 'ext'))
6
6
  require 'java'
@@ -22,6 +22,8 @@ module PDF
22
22
  @files_to_merge.each do |f|
23
23
  copy.addDocument(PdfReader.new(f))
24
24
  end
25
+
26
+ copy.addJavaScript(@js) if @js.present?
25
27
 
26
28
  copy.close()
27
29
  PdfReader.new(output_file_path).getNumberOfPages
@@ -1,6 +1,6 @@
1
1
  # = pdf/merger/rjb.rb -- PDF template stamping.
2
2
  #
3
- # Copyright (c) 2010 Paul Schreiber
3
+ # Copyright 2010-12 Paul Schreiber
4
4
 
5
5
  require 'rubygems'
6
6
  require 'rjb'
@@ -32,6 +32,8 @@ module PDF
32
32
  copy.addDocument(@pdfreader.new(f))
33
33
  end
34
34
 
35
+ copy.addJavaScript(@js) if @js.present?
36
+
35
37
  copy.close()
36
38
  @pdfreader.new(output_file_path).getNumberOfPages
37
39
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "pdf-merger"
8
- s.version = "0.1.2"
8
+ s.version = "0.2.0"
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 = "2011-09-26"
12
+ s.date = "2012-04-26"
13
13
  s.description = "Merge multiple PDFs in to one using iText's PdfCopyFile."
14
14
  s.email = "paulschreiber@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
35
35
  s.homepage = "http://github.com/paulschreiber/pdf-merger"
36
36
  s.licenses = ["MIT"]
37
37
  s.require_paths = ["lib"]
38
- s.rubygems_version = "1.8.10"
38
+ s.rubygems_version = "1.8.15"
39
39
  s.summary = "Merge PDFs."
40
40
 
41
41
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdf-merger
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
8
  - 2
10
- version: 0.1.2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Paul Schreiber
@@ -15,10 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-26 00:00:00 Z
18
+ date: 2012-04-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
21
+ requirement: &id001 !ruby/object:Gem::Requirement
22
22
  none: false
23
23
  requirements:
24
24
  - - ">="
@@ -28,11 +28,11 @@ dependencies:
28
28
  - 0
29
29
  version: "0"
30
30
  name: shoulda
31
- prerelease: false
31
+ version_requirements: *id001
32
32
  type: :development
33
- requirement: *id001
33
+ prerelease: false
34
34
  - !ruby/object:Gem::Dependency
35
- version_requirements: &id002 !ruby/object:Gem::Requirement
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
36
  none: false
37
37
  requirements:
38
38
  - - ~>
@@ -44,11 +44,11 @@ dependencies:
44
44
  - 0
45
45
  version: 1.0.0
46
46
  name: bundler
47
- prerelease: false
47
+ version_requirements: *id002
48
48
  type: :development
49
- requirement: *id002
49
+ prerelease: false
50
50
  - !ruby/object:Gem::Dependency
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ~>
@@ -60,11 +60,11 @@ dependencies:
60
60
  - 4
61
61
  version: 1.6.4
62
62
  name: jeweler
63
- prerelease: false
63
+ version_requirements: *id003
64
64
  type: :development
65
- requirement: *id003
65
+ prerelease: false
66
66
  - !ruby/object:Gem::Dependency
67
- version_requirements: &id004 !ruby/object:Gem::Requirement
67
+ requirement: &id004 !ruby/object:Gem::Requirement
68
68
  none: false
69
69
  requirements:
70
70
  - - ">="
@@ -74,9 +74,9 @@ dependencies:
74
74
  - 0
75
75
  version: "0"
76
76
  name: rcov
77
- prerelease: false
77
+ version_requirements: *id004
78
78
  type: :development
79
- requirement: *id004
79
+ prerelease: false
80
80
  description: Merge multiple PDFs in to one using iText's PdfCopyFile.
81
81
  email: paulschreiber@gmail.com
82
82
  executables: []
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  requirements: []
131
131
 
132
132
  rubyforge_project:
133
- rubygems_version: 1.8.10
133
+ rubygems_version: 1.8.15
134
134
  signing_key:
135
135
  specification_version: 3
136
136
  summary: Merge PDFs.