dragonfly_pdf 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +14 -0
- data/CHANGELOG.md +5 -0
- data/README.md +5 -15
- data/dragonfly_pdf.gemspec +2 -2
- data/lib/dragonfly_pdf/analysers/pdf_properties.rb +34 -113
- data/lib/dragonfly_pdf/plugin.rb +4 -11
- data/lib/dragonfly_pdf/processors/page.rb +11 -31
- data/lib/dragonfly_pdf/processors/page_thumb.rb +17 -35
- data/lib/dragonfly_pdf/processors/subset_fonts.rb +2 -5
- data/lib/dragonfly_pdf/version.rb +1 -1
- data/lib/dragonfly_pdf.rb +1 -2
- data/samples/sample_pages_with_bleed.pdf +0 -0
- data/test/dragonfly_pdf/analysers/pdf_properties_test.rb +22 -201
- data/test/dragonfly_pdf/plugin_test.rb +11 -9
- data/test/dragonfly_pdf/processors/page_test.rb +9 -61
- data/test/dragonfly_pdf/processors/page_thumb_test.rb +10 -57
- data/test/dragonfly_pdf/processors/subset_fonts.rb +3 -6
- metadata +12 -13
- data/samples/sample_spreads.pdf +0 -0
- data/samples/sample_spreads_back.pdf +0 -0
- data/samples/sample_spreads_cover.pdf +0 -0
- data/samples/sample_spreads_cover_back.pdf +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2750c91307336a07aaadcbb6ff558becd185dd43
|
4
|
+
data.tar.gz: 45dc9c8d207ef6a5df210012bea76f5b70c621f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 202b5f48965ab0182b5988209057c4383b3b6401b994eac9e07e2d4ef373b390b074f9e175a8ea711fb7f9e576d4f6f13520266c34d42a7d78621aa0d3d6f34a
|
7
|
+
data.tar.gz: 19562c74566b4f386876d331e61d981b5cae9d533be5ca6f30bcb24a1355b149ae656af0decf512a0976043b95011997955dcc4fa12044864464bf406603b116
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -32,14 +32,6 @@ Dragonfly.app.configure do
|
|
32
32
|
end
|
33
33
|
```
|
34
34
|
|
35
|
-
### Spreads
|
36
|
-
|
37
|
-
PDFs that contain spreads (as when saving with the spreads option in InDesign) require setting the `spreads` [metadata](http://markevans.github.io/dragonfly/models/#meta-data) attribute to `true`:
|
38
|
-
|
39
|
-
```ruby
|
40
|
-
pdf.meta['spreads'] = true
|
41
|
-
```
|
42
|
-
|
43
35
|
## Analysers
|
44
36
|
|
45
37
|
### PDF properties
|
@@ -55,16 +47,14 @@ It returns a hash of properties:
|
|
55
47
|
```ruby
|
56
48
|
{
|
57
49
|
page_count: 4,
|
58
|
-
|
59
|
-
page_numbers: [
|
60
|
-
widths: [
|
61
|
-
heights: [
|
62
|
-
aspect_ratios: [
|
50
|
+
page_dimensions: [[210.0, 297.0], [210.0, 297.0], [210.0, 297.0], [210.0, 297.0]],
|
51
|
+
page_numbers: [1, 2, 3, 4],
|
52
|
+
widths: [210.0, 210.0, 210.0, 210.0],
|
53
|
+
heights: [297.0, 297.0, 297.0, 297.0],
|
54
|
+
aspect_ratios: [0.71, 0.71, 0.71, 0.71]
|
63
55
|
}
|
64
56
|
```
|
65
57
|
|
66
|
-
When the `spreads` metadata is set to `true`, the analyser assumes the PDF contains 2 real pages per one PDF page and recalculates the PDF properties accordingly (including situations where the PDF begins or ends with a single page). All page arrays (`page_numbers`, `widths`, `heights`, `aspect_ratios`) are then two dimensional (as illustrated above), representing spreads and nested individual pages.
|
67
|
-
|
68
58
|
## Processors
|
69
59
|
|
70
60
|
### Page
|
data/dragonfly_pdf.gemspec
CHANGED
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency "dragonfly", "~> 1.0"
|
22
|
-
spec.add_dependency "pdf-reader", "~> 1.3"
|
23
22
|
|
24
|
-
spec.add_development_dependency "
|
23
|
+
spec.add_development_dependency "pdf-reader"
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
25
25
|
spec.add_development_dependency "rake"
|
26
26
|
spec.add_development_dependency "guard"
|
27
27
|
spec.add_development_dependency "guard-minitest"
|
@@ -3,147 +3,68 @@ require 'pdf-reader'
|
|
3
3
|
module DragonflyPdf
|
4
4
|
module Analysers
|
5
5
|
class PdfProperties
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
pdf = PDF::Reader.new(content.file)
|
11
|
-
|
6
|
+
def call(content, options = {})
|
7
|
+
@content = content
|
8
|
+
@use_cropbox = options.fetch :use_cropbox, true
|
9
|
+
@use_trimbox = options.fetch :use_trimbox, true
|
12
10
|
{
|
13
|
-
aspect_ratios: aspect_ratios
|
14
|
-
heights: heights
|
15
|
-
page_count: page_count
|
16
|
-
|
17
|
-
|
18
|
-
widths: widths
|
11
|
+
aspect_ratios: aspect_ratios,
|
12
|
+
heights: heights,
|
13
|
+
page_count: page_count,
|
14
|
+
page_dimensions: page_dimensions,
|
15
|
+
page_numbers: page_numbers,
|
16
|
+
widths: widths
|
19
17
|
}
|
20
18
|
end
|
21
19
|
|
22
20
|
private # =============================================================
|
23
21
|
|
24
|
-
def
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
return pdf_page_widths unless spreads
|
31
|
-
|
32
|
-
res = []
|
33
|
-
i = 0
|
34
|
-
spread = []
|
35
|
-
page_numbers(pdf, spreads).each do |s|
|
36
|
-
if s.count == 1
|
37
|
-
spread << pdf_page_widths[i]
|
38
|
-
else
|
39
|
-
spread << pdf_page_widths[i]/2
|
40
|
-
spread << pdf_page_widths[i]/2
|
22
|
+
def page_dimensions
|
23
|
+
@page_dimensions ||= begin
|
24
|
+
res = @content.shell_eval do |path|
|
25
|
+
"#{identify_command} -format '%Wx%H,' #{path}"
|
41
26
|
end
|
42
|
-
res
|
43
|
-
|
44
|
-
i = i+1
|
45
|
-
end
|
46
|
-
res
|
47
|
-
end
|
48
|
-
|
49
|
-
# ---------------------------------------------------------------------
|
50
|
-
|
51
|
-
def heights pdf, spreads
|
52
|
-
pdf_page_heights = pdf.pages.map do |page|
|
53
|
-
media_box = page.attributes[:MediaBox]
|
54
|
-
pt2mm(media_box[3] - media_box[1]).round(2)
|
55
|
-
end
|
56
|
-
|
57
|
-
return pdf_page_heights unless spreads
|
58
|
-
|
59
|
-
res = []
|
60
|
-
i = 0
|
61
|
-
spread = []
|
62
|
-
page_numbers(pdf, spreads).each do |s|
|
63
|
-
if s.count == 1
|
64
|
-
spread << pdf_page_heights[i]
|
65
|
-
else
|
66
|
-
spread << pdf_page_heights[i]
|
67
|
-
spread << pdf_page_heights[i]
|
27
|
+
res.to_s.split(/\s*,\s*/).compact.map do |page|
|
28
|
+
page = page.split(/\s*x\s*/).map(&:to_f).map { |n| pt2mm(n) }
|
68
29
|
end
|
69
|
-
res << spread
|
70
|
-
spread = []
|
71
|
-
i = i+1
|
72
30
|
end
|
73
|
-
res
|
74
31
|
end
|
75
32
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
pdf_aspect_ratios = widths(pdf, false).zip(heights(pdf, false)).map do |width, height|
|
80
|
-
(width / height)
|
33
|
+
def widths
|
34
|
+
page_dimensions.inject([]) do |res, page|
|
35
|
+
res << page[0]
|
81
36
|
end
|
37
|
+
end
|
82
38
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
i = 0
|
87
|
-
spread = []
|
88
|
-
page_numbers(pdf, spreads).each do |s|
|
89
|
-
if s.count == 1
|
90
|
-
spread << pdf_aspect_ratios[i]
|
91
|
-
else
|
92
|
-
spread << pdf_aspect_ratios[i]/2
|
93
|
-
spread << pdf_aspect_ratios[i]/2
|
94
|
-
end
|
95
|
-
res << spread
|
96
|
-
spread = []
|
97
|
-
i = i+1
|
39
|
+
def heights
|
40
|
+
page_dimensions.inject([]) do |res, page|
|
41
|
+
res << page[1]
|
98
42
|
end
|
99
|
-
res
|
100
43
|
end
|
101
44
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
return pdf.pages.collect { |p| p.number } unless spreads
|
106
|
-
|
107
|
-
page_widths = widths(pdf, false)
|
108
|
-
single_page_width = page_widths.uniq.count == 1 ? -9999999 : widths(pdf, false).min
|
109
|
-
|
110
|
-
i = 1
|
111
|
-
res = []
|
112
|
-
spread = []
|
113
|
-
|
114
|
-
page_widths.each do |page_width|
|
115
|
-
if page_width > single_page_width
|
116
|
-
spread << i
|
117
|
-
i = i+1
|
118
|
-
spread << i
|
119
|
-
else
|
120
|
-
spread << i
|
121
|
-
end
|
122
|
-
res << spread
|
123
|
-
spread = []
|
124
|
-
i = i+1
|
45
|
+
def aspect_ratios
|
46
|
+
page_dimensions.inject([]) do |res, page|
|
47
|
+
res << page[0] / page[1]
|
125
48
|
end
|
126
|
-
|
127
|
-
res
|
128
49
|
end
|
129
50
|
|
130
|
-
|
131
|
-
|
132
|
-
def page_count pdf, spreads
|
133
|
-
page_numbers(pdf, spreads).flatten.count
|
51
|
+
def page_numbers
|
52
|
+
(1..page_count).to_a
|
134
53
|
end
|
135
54
|
|
136
|
-
def
|
137
|
-
|
138
|
-
page_numbers(pdf, spreads).count
|
55
|
+
def page_count
|
56
|
+
page_dimensions.count
|
139
57
|
end
|
140
58
|
|
141
59
|
# =====================================================================
|
142
60
|
|
143
|
-
def pt2mm
|
61
|
+
def pt2mm(pt)
|
144
62
|
(pt / 72.0) * 25.4
|
145
63
|
end
|
146
64
|
|
65
|
+
def identify_command
|
66
|
+
"identify -define pdf:use-cropbox=#{@use_cropbox} -define pdf:use-trimbox=#{@use_trimbox}"
|
67
|
+
end
|
147
68
|
end
|
148
69
|
end
|
149
70
|
end
|
data/lib/dragonfly_pdf/plugin.rb
CHANGED
@@ -1,12 +1,10 @@
|
|
1
1
|
require 'dragonfly_pdf/analysers/pdf_properties'
|
2
|
-
|
3
2
|
require 'dragonfly_pdf/processors/page'
|
4
3
|
require 'dragonfly_pdf/processors/page_thumb'
|
5
4
|
require 'dragonfly_pdf/processors/subset_fonts'
|
6
5
|
|
7
6
|
module DragonflyPdf
|
8
7
|
class Plugin
|
9
|
-
|
10
8
|
def call app, opts={}
|
11
9
|
app.add_analyser :pdf_properties, DragonflyPdf::Analysers::PdfProperties.new
|
12
10
|
|
@@ -14,14 +12,14 @@ module DragonflyPdf
|
|
14
12
|
content.analyse(:pdf_properties)[:page_count]
|
15
13
|
end
|
16
14
|
|
17
|
-
app.add_analyser :spread_count do |content|
|
18
|
-
content.analyse(:pdf_properties)[:spread_count]
|
19
|
-
end
|
20
|
-
|
21
15
|
app.add_analyser :page_numbers do |content|
|
22
16
|
content.analyse(:pdf_properties)[:page_numbers]
|
23
17
|
end
|
24
18
|
|
19
|
+
app.add_analyser :page_dimensions do |content|
|
20
|
+
content.analyse(:pdf_properties)[:page_dimensions]
|
21
|
+
end
|
22
|
+
|
25
23
|
app.add_analyser :widths do |content|
|
26
24
|
content.analyse(:pdf_properties)[:widths]
|
27
25
|
end
|
@@ -34,17 +32,12 @@ module DragonflyPdf
|
|
34
32
|
attrs = content.analyse(:pdf_properties)[:aspect_ratios]
|
35
33
|
end
|
36
34
|
|
37
|
-
app.add_analyser :info do |content|
|
38
|
-
attrs = content.analyse(:pdf_properties)[:info]
|
39
|
-
end
|
40
|
-
|
41
35
|
# ---------------------------------------------------------------------
|
42
36
|
|
43
37
|
app.add_processor :page_thumb, DragonflyPdf::Processors::PageThumb.new
|
44
38
|
app.add_processor :page, DragonflyPdf::Processors::Page.new
|
45
39
|
app.add_processor :subset_fonts, DragonflyPdf::Processors::SubsetFonts.new
|
46
40
|
end
|
47
|
-
|
48
41
|
end
|
49
42
|
end
|
50
43
|
|
@@ -5,46 +5,26 @@ require_relative '../analysers/pdf_properties'
|
|
5
5
|
module DragonflyPdf
|
6
6
|
module Processors
|
7
7
|
class Page
|
8
|
+
def call(content, page_number = 1, _opts = {})
|
9
|
+
@content = content
|
10
|
+
@page_number = page_number
|
8
11
|
|
9
|
-
|
10
|
-
spreads = content.meta['spreads'] || false
|
11
|
-
pdf_page_number = page_number
|
12
|
-
crop_args = ''
|
12
|
+
fail DragonflyPdf::PageNotFound unless pdf_properties[:page_numbers].include?(page_number)
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
raise DragonflyPdf::PageNotFound unless pdf_properties[:page_numbers].flatten.include?(page_number)
|
17
|
-
|
18
|
-
if spreads
|
19
|
-
spread = pdf_properties[:page_numbers].detect{ |s| s.include?(page_number) }
|
20
|
-
spread_number = pdf_properties[:page_numbers].index(spread)
|
21
|
-
spread_side = spread.index(page_number)
|
22
|
-
|
23
|
-
pdf_page_number = spread_number+1
|
24
|
-
|
25
|
-
pdf = PDF::Reader.new(content.path)
|
26
|
-
box = pdf.pages[spread_number].attributes[:MediaBox] || pdf.pages[spread_number].attributes[:CropBox]
|
27
|
-
|
28
|
-
crop_box = box
|
29
|
-
crop_box[2] = crop_box[2]/2
|
30
|
-
crop_box[0] += crop_box[2] * spread_side
|
31
|
-
crop_box[2] += crop_box[2] * spread_side
|
32
|
-
|
33
|
-
crop_args = "-c '[/CropBox [#{crop_box.join(' ')}] /PAGES pdfmark'"
|
34
|
-
end
|
35
|
-
|
36
|
-
content.shell_update(ext: :pdf) do |old_path, new_path|
|
37
|
-
"#{gs_command} -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dFirstPage=#{pdf_page_number} -dLastPage=#{pdf_page_number} -o #{new_path} #{crop_args} -f #{old_path}"
|
14
|
+
@content.shell_update(ext: :pdf) do |old_path, new_path|
|
15
|
+
"#{gs_command} -dFirstPage=#{@page_number} -dLastPage=#{@page_number} -o #{new_path} -f #{old_path}"
|
38
16
|
end
|
39
17
|
end
|
40
18
|
|
41
|
-
|
42
19
|
private # =============================================================
|
43
|
-
|
20
|
+
|
44
21
|
def gs_command
|
45
|
-
'gs'
|
22
|
+
'gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH'
|
46
23
|
end
|
47
24
|
|
25
|
+
def pdf_properties
|
26
|
+
@pdf_properties ||= DragonflyPdf::Analysers::PdfProperties.new.call(@content)
|
27
|
+
end
|
48
28
|
end
|
49
29
|
end
|
50
30
|
end
|
@@ -3,40 +3,23 @@ require_relative '../analysers/pdf_properties'
|
|
3
3
|
module DragonflyPdf
|
4
4
|
module Processors
|
5
5
|
class PageThumb
|
6
|
+
def call(content, page_number = 1, opts = {})
|
7
|
+
@content = content
|
8
|
+
@page_number = page_number
|
9
|
+
@format = opts['format'] || :png
|
10
|
+
@density = opts['density'] || 150
|
6
11
|
|
7
|
-
|
8
|
-
format = opts['format'] || :png
|
9
|
-
density = opts['density'] || 150
|
10
|
-
spreads = content.meta['spreads'] || false
|
12
|
+
fail DragonflyPdf::PageNotFound unless pdf_properties[:page_numbers].include?(@page_number)
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
pdf_properties = DragonflyPdf::Analysers::PdfProperties.new.call(content)
|
16
|
-
|
17
|
-
raise DragonflyPdf::PageNotFound unless pdf_properties[:page_numbers].flatten.include?(page_number)
|
18
|
-
|
19
|
-
if spreads
|
20
|
-
spread = pdf_properties[:page_numbers].detect{ |s| s.include?(page_number) }
|
21
|
-
spread_number = pdf_properties[:page_numbers].index(spread)
|
22
|
-
spread_side = spread.index(page_number)
|
23
|
-
page_to_delete = 1-spread_side
|
24
|
-
|
25
|
-
pdf_page_number = spread_number
|
26
|
-
crop_args = "-crop 50%x100% -delete #{page_to_delete}"
|
27
|
-
else
|
28
|
-
pdf_page_number = page_number-1
|
14
|
+
content.shell_update(ext: @format) do |old_path, new_path|
|
15
|
+
"#{convert_command} #{old_path}[#{pdf_page_number}] #{new_path}"
|
29
16
|
end
|
30
17
|
|
31
|
-
content.
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
content.meta['format'] = format.to_s
|
36
|
-
content.ext = format
|
18
|
+
@content.meta['format'] = @format.to_s
|
19
|
+
@content.ext = @format
|
37
20
|
end
|
38
21
|
|
39
|
-
def update_url
|
22
|
+
def update_url(attrs, page_number, opts = {})
|
40
23
|
format = opts['format']
|
41
24
|
attrs.page_number = page_number
|
42
25
|
attrs.ext = format if format
|
@@ -44,18 +27,17 @@ module DragonflyPdf
|
|
44
27
|
|
45
28
|
private # =============================================================
|
46
29
|
|
47
|
-
def
|
48
|
-
|
30
|
+
def pdf_properties
|
31
|
+
@pdf_properties ||= DragonflyPdf::Analysers::PdfProperties.new.call(@content)
|
49
32
|
end
|
50
33
|
|
51
|
-
def
|
52
|
-
|
34
|
+
def convert_command
|
35
|
+
"convert -alpha deactivate -background white -colorspace sRGB -density #{@density}x#{@density} -define pdf:use-cropbox=true -define pdf:use-trimbox=true"
|
53
36
|
end
|
54
37
|
|
55
|
-
def
|
56
|
-
|
38
|
+
def pdf_page_number
|
39
|
+
@page_number - 1
|
57
40
|
end
|
58
|
-
|
59
41
|
end
|
60
42
|
end
|
61
43
|
end
|
@@ -1,20 +1,17 @@
|
|
1
1
|
module DragonflyPdf
|
2
2
|
module Processors
|
3
3
|
class SubsetFonts
|
4
|
-
|
5
4
|
def call content, opts={}
|
6
5
|
content.shell_update(ext: :pdf) do |old_path, new_path|
|
7
|
-
"#{gs_command} -
|
6
|
+
"#{gs_command} -o #{new_path} -f #{old_path}"
|
8
7
|
end
|
9
8
|
end
|
10
9
|
|
11
|
-
|
12
10
|
private # =============================================================
|
13
11
|
|
14
12
|
def gs_command
|
15
|
-
|
13
|
+
"gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSubsetFonts=true"
|
16
14
|
end
|
17
|
-
|
18
15
|
end
|
19
16
|
end
|
20
17
|
end
|
data/lib/dragonfly_pdf.rb
CHANGED
Binary file
|
@@ -3,235 +3,56 @@ require 'test_helper'
|
|
3
3
|
module DragonflyPdf
|
4
4
|
module Analysers
|
5
5
|
describe PdfProperties do
|
6
|
-
|
7
6
|
let(:app) { test_app.configure_with(:pdf) }
|
8
7
|
let(:analyser) { DragonflyPdf::Analysers::PdfProperties.new }
|
8
|
+
let(:sample_pages) { app.fetch_file(SAMPLES_DIR.join('sample_pages.pdf')) }
|
9
|
+
let(:sample_pages_with_bleed) { app.fetch_file(SAMPLES_DIR.join('sample_pages_with_bleed.pdf')) }
|
9
10
|
|
10
|
-
|
11
|
-
let(:spreads) { app.fetch_file(SAMPLES_DIR.join('sample_spreads.pdf')) }
|
12
|
-
let(:spreads_back) { app.fetch_file(SAMPLES_DIR.join('sample_spreads_back.pdf')) }
|
13
|
-
let(:spreads_cover) { app.fetch_file(SAMPLES_DIR.join('sample_spreads_cover.pdf')) }
|
14
|
-
let(:spreads_cover_back) { app.fetch_file(SAMPLES_DIR.join('sample_spreads_cover_back.pdf')) }
|
15
|
-
|
16
|
-
before do
|
17
|
-
spreads.meta['spreads'] = true
|
18
|
-
spreads_cover.meta['spreads'] = true
|
19
|
-
spreads_back.meta['spreads'] = true
|
20
|
-
spreads_cover_back.meta['spreads'] = true
|
21
|
-
end
|
22
|
-
|
23
|
-
describe 'call' do
|
24
|
-
let(:pdf_properties) { analyser.call(single_pages) }
|
11
|
+
# =====================================================================
|
25
12
|
|
26
|
-
|
27
|
-
|
28
|
-
end
|
13
|
+
it 'returns Hash' do
|
14
|
+
analyser.call(sample_pages).must_be_kind_of Hash
|
29
15
|
end
|
30
16
|
|
31
|
-
# ---------------------------------------------------------------------
|
32
|
-
|
33
17
|
describe '#page_numbers' do
|
34
|
-
|
35
|
-
|
36
|
-
analyser.call(single_pages)[:page_numbers].must_equal [1,2,3,4,5,6,7,8,9,10]
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe 'for PDF with spreads' do
|
41
|
-
it 'returns two-dimensional array' do
|
42
|
-
analyser.call(spreads)[:page_numbers].must_equal [[1,2],[3,4],[5,6],[7,8]]
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe 'for PDF with spreads and a cover' do
|
47
|
-
it 'returns two-dimensional array' do
|
48
|
-
analyser.call(spreads_cover)[:page_numbers].must_equal [[1],[2,3],[4,5],[6,7],[8,9]]
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
describe 'for PDF with spreads and a back cover' do
|
53
|
-
it 'returns two-dimensional array' do
|
54
|
-
analyser.call(spreads_back)[:page_numbers].must_equal [[1,2],[3,4],[5,6],[7,8],[9]]
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
describe 'for PDF with spreads and a front and a back cover' do
|
59
|
-
it 'returns two-dimensional array' do
|
60
|
-
analyser.call(spreads_cover_back)[:page_numbers].must_equal [[1],[2,3],[4,5],[6,7],[8,9],[10]]
|
61
|
-
end
|
18
|
+
it 'returns one-dimensional array' do
|
19
|
+
analyser.call(sample_pages)[:page_numbers].must_equal (1..10).to_a
|
62
20
|
end
|
63
21
|
end
|
64
22
|
|
65
|
-
# ---------------------------------------------------------------------
|
66
|
-
|
67
23
|
describe '#page_count' do
|
68
|
-
|
69
|
-
|
70
|
-
analyser.call(single_pages)[:page_count].must_equal 10
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
describe 'for PDF with spreads' do
|
75
|
-
it 'returns correct page count' do
|
76
|
-
analyser.call(spreads)[:page_count].must_equal 8
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
describe 'for PDF with spreads and a cover' do
|
81
|
-
it 'returns correct page count' do
|
82
|
-
analyser.call(spreads_cover)[:page_count].must_equal 9
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
describe 'for PDF with spreads and a back cover' do
|
87
|
-
it 'returns correct page count' do
|
88
|
-
analyser.call(spreads_back)[:page_count].must_equal 9
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
describe 'for PDF with spreads and a front and a back cover' do
|
93
|
-
it 'returns correct page count' do
|
94
|
-
analyser.call(spreads_cover_back)[:page_count].must_equal 10
|
95
|
-
end
|
24
|
+
it 'returns correct page count' do
|
25
|
+
analyser.call(sample_pages)[:page_count].must_equal 10
|
96
26
|
end
|
97
27
|
end
|
98
28
|
|
99
|
-
#
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
it 'returns correct page count' do
|
104
|
-
analyser.call(single_pages)[:spread_count].must_equal 0
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
describe 'for PDF with spreads' do
|
109
|
-
it 'returns correct page count' do
|
110
|
-
analyser.call(spreads)[:spread_count].must_equal 4
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
describe 'for PDF with spreads and a cover' do
|
115
|
-
it 'returns correct page count' do
|
116
|
-
analyser.call(spreads_cover)[:spread_count].must_equal 5
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
describe 'for PDF with spreads and a back cover' do
|
121
|
-
it 'returns correct page count' do
|
122
|
-
analyser.call(spreads_back)[:spread_count].must_equal 5
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
describe 'for PDF with spreads and a front and a back cover' do
|
127
|
-
it 'returns correct page count' do
|
128
|
-
analyser.call(spreads_cover_back)[:spread_count].must_equal 6
|
129
|
-
end
|
29
|
+
describe '#page_dimensions' do
|
30
|
+
it 'returns widths' do
|
31
|
+
analyser.call(sample_pages)[:page_dimensions].map{ |p| p.map(&:round) }.must_equal [[210, 297]].cycle.take(10)
|
32
|
+
analyser.call(sample_pages_with_bleed)[:page_dimensions].map{ |p| p.map(&:round) }.must_equal [[210, 297]].cycle.take(10)
|
130
33
|
end
|
131
34
|
end
|
132
35
|
|
133
|
-
# ---------------------------------------------------------------------
|
134
|
-
|
135
36
|
describe '#widths' do
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
describe 'for PDF with spreads' do
|
143
|
-
it 'returns widths' do
|
144
|
-
analyser.call(spreads)[:widths].must_equal [[210.0, 210.0], [210.0, 210.0], [210.0, 210.0], [210.0, 210.0]]
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
describe 'for PDF with spreads and a cover' do
|
149
|
-
it 'returns correct widths' do
|
150
|
-
analyser.call(spreads_cover)[:widths].must_equal [[210.0], [210.0, 210.0], [210.0, 210.0], [210.0, 210.0], [210.0, 210.0]]
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
describe 'for PDF with spreads and a back cover' do
|
155
|
-
it 'returns correct widths' do
|
156
|
-
analyser.call(spreads_back)[:widths].must_equal [[210.0, 210.0], [210.0, 210.0], [210.0, 210.0], [210.0, 210.0], [210.0]]
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
describe 'for PDF with spreads and a front and a back cover' do
|
161
|
-
it 'returns correct widths' do
|
162
|
-
analyser.call(spreads_cover_back)[:widths].must_equal [[210.0], [210.0, 210.0], [210.0, 210.0], [210.0, 210.0], [210.0, 210.0], [210.0]]
|
163
|
-
end
|
37
|
+
it 'returns widths' do
|
38
|
+
analyser.call(sample_pages)[:widths].map(&:round).must_equal [210].cycle.take(10)
|
39
|
+
analyser.call(sample_pages_with_bleed)[:widths].map(&:round).must_equal [210].cycle.take(10)
|
164
40
|
end
|
165
41
|
end
|
166
42
|
|
167
|
-
# ---------------------------------------------------------------------
|
168
|
-
|
169
43
|
describe '#heights' do
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
|
-
describe 'for PDF with spreads' do
|
177
|
-
it 'returns heights' do
|
178
|
-
analyser.call(spreads)[:heights].must_equal [[297.0, 297.0], [297.0, 297.0], [297.0, 297.0], [297.0, 297.0]]
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
describe 'for PDF with spreads and a cover' do
|
183
|
-
it 'returns correct heights' do
|
184
|
-
analyser.call(spreads_cover)[:heights].must_equal [[297.0], [297.0, 297.0], [297.0, 297.0], [297.0, 297.0], [297.0, 297.0]]
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
|
-
describe 'for PDF with spreads and a back cover' do
|
189
|
-
it 'returns correct heights' do
|
190
|
-
analyser.call(spreads_back)[:heights].must_equal [[297.0, 297.0], [297.0, 297.0], [297.0, 297.0], [297.0, 297.0], [297.0]]
|
191
|
-
end
|
192
|
-
end
|
193
|
-
|
194
|
-
describe 'for PDF with spreads and a front and a back cover' do
|
195
|
-
it 'returns correct heights' do
|
196
|
-
analyser.call(spreads_cover_back)[:heights].must_equal [[297.0], [297.0, 297.0], [297.0, 297.0], [297.0, 297.0], [297.0, 297.0], [297.0]]
|
197
|
-
end
|
44
|
+
it 'returns heights' do
|
45
|
+
analyser.call(sample_pages)[:heights].map(&:round).must_equal [297].cycle.take(10)
|
46
|
+
analyser.call(sample_pages_with_bleed)[:heights].map(&:round).must_equal [297].cycle.take(10)
|
198
47
|
end
|
199
48
|
end
|
200
49
|
|
201
|
-
# ---------------------------------------------------------------------
|
202
|
-
|
203
50
|
describe '#aspect_ratios' do
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
end
|
208
|
-
end
|
209
|
-
|
210
|
-
describe 'for PDF with spreads' do
|
211
|
-
it 'returns aspect ratios' do
|
212
|
-
analyser.call(spreads)[:aspect_ratios].map{ |i| i.is_a?(Array) ? i.map{ |j| j.round(2) } : i.round(2) }.must_equal [[0.71, 0.71], [0.71, 0.71], [0.71, 0.71], [0.71, 0.71]]
|
213
|
-
end
|
214
|
-
end
|
215
|
-
|
216
|
-
describe 'for PDF with spreads and a cover' do
|
217
|
-
it 'returns correct aspect ratios' do
|
218
|
-
analyser.call(spreads_cover)[:aspect_ratios].map{ |i| i.is_a?(Array) ? i.map{ |j| j.round(2) } : i.round(2) }.must_equal [[0.71], [0.71, 0.71], [0.71, 0.71], [0.71, 0.71], [0.71, 0.71]]
|
219
|
-
end
|
220
|
-
end
|
221
|
-
|
222
|
-
describe 'for PDF with spreads and a back cover' do
|
223
|
-
it 'returns correct aspect ratios' do
|
224
|
-
analyser.call(spreads_back)[:aspect_ratios].map{ |i| i.is_a?(Array) ? i.map{ |j| j.round(2) } : i.round(2) }.must_equal [[0.71, 0.71], [0.71, 0.71], [0.71, 0.71], [0.71, 0.71], [0.71]]
|
225
|
-
end
|
226
|
-
end
|
227
|
-
|
228
|
-
describe 'for PDF with spreads and a front and a back cover' do
|
229
|
-
it 'returns correct aspect ratios' do
|
230
|
-
analyser.call(spreads_cover_back)[:aspect_ratios].map{ |i| i.is_a?(Array) ? i.map{ |j| j.round(2) } : i.round(2) }.must_equal [[0.71], [0.71, 0.71], [0.71, 0.71], [0.71, 0.71], [0.71, 0.71], [0.71]]
|
231
|
-
end
|
51
|
+
it 'returns aspect ratios' do
|
52
|
+
analyser.call(sample_pages)[:aspect_ratios].map{ |i| i.round(2) }.must_equal [0.71].cycle.take(10)
|
53
|
+
analyser.call(sample_pages_with_bleed)[:aspect_ratios].map{ |i| i.round(2) }.must_equal [0.71].cycle.take(10)
|
232
54
|
end
|
233
55
|
end
|
234
|
-
|
235
56
|
end
|
236
57
|
end
|
237
58
|
end
|
@@ -2,7 +2,6 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module DragonflyPdf
|
4
4
|
describe Plugin do
|
5
|
-
|
6
5
|
let(:app) { test_app.configure_with(:pdf) }
|
7
6
|
let(:pdf) { app.fetch_file(SAMPLES_DIR.join('sample_pages.pdf')) }
|
8
7
|
|
@@ -12,30 +11,34 @@ module DragonflyPdf
|
|
12
11
|
it 'adds #pdf_properties' do
|
13
12
|
pdf.must_respond_to :pdf_properties
|
14
13
|
end
|
14
|
+
|
15
15
|
it 'allows an options parameter on #pdf_properties' do
|
16
16
|
pdf.pdf_properties.must_be_kind_of Hash
|
17
17
|
end
|
18
|
+
|
18
19
|
it 'adds #page_count' do
|
19
20
|
pdf.must_respond_to :page_count
|
20
21
|
end
|
21
|
-
|
22
|
-
pdf.must_respond_to :spread_count
|
23
|
-
end
|
22
|
+
|
24
23
|
it 'adds #page_numbers' do
|
25
24
|
pdf.must_respond_to :page_numbers
|
26
25
|
end
|
26
|
+
|
27
|
+
it 'adds #page_dimensions' do
|
28
|
+
pdf.must_respond_to :page_dimensions
|
29
|
+
end
|
30
|
+
|
27
31
|
it 'adds #widths' do
|
28
32
|
pdf.must_respond_to :widths
|
29
33
|
end
|
34
|
+
|
30
35
|
it 'adds #heights' do
|
31
36
|
pdf.must_respond_to :heights
|
32
37
|
end
|
38
|
+
|
33
39
|
it 'adds #aspect_ratios' do
|
34
40
|
pdf.must_respond_to :aspect_ratios
|
35
41
|
end
|
36
|
-
it 'adds #info' do
|
37
|
-
pdf.must_respond_to :info
|
38
|
-
end
|
39
42
|
end
|
40
43
|
|
41
44
|
# ---------------------------------------------------------------------
|
@@ -48,6 +51,5 @@ module DragonflyPdf
|
|
48
51
|
pdf.must_respond_to :page_thumb
|
49
52
|
end
|
50
53
|
end
|
51
|
-
|
52
54
|
end
|
53
|
-
end
|
55
|
+
end
|
@@ -4,88 +4,36 @@ require 'pdf-reader'
|
|
4
4
|
module DragonflyPdf
|
5
5
|
module Processors
|
6
6
|
describe Page do
|
7
|
-
|
8
7
|
let(:app) { test_app.configure_with(:pdf) }
|
9
8
|
let(:processor) { DragonflyPdf::Processors::Page.new }
|
10
|
-
|
11
|
-
let(:single_pages) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_pages.pdf')) }
|
12
|
-
let(:spreads) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_spreads.pdf')) }
|
13
|
-
let(:spreads_back) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_spreads_back.pdf')) }
|
14
|
-
let(:spreads_cover) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_spreads_cover.pdf')) }
|
15
|
-
let(:spreads_cover_back) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_spreads_cover_back.pdf')) }
|
16
|
-
|
17
|
-
before do
|
18
|
-
spreads.meta['spreads'] = true
|
19
|
-
spreads_cover.meta['spreads'] = true
|
20
|
-
spreads_back.meta['spreads'] = true
|
21
|
-
spreads_cover_back.meta['spreads'] = true
|
22
|
-
end
|
9
|
+
let(:sample_pages) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_pages.pdf')) }
|
23
10
|
|
24
11
|
# =====================================================================
|
25
12
|
|
26
13
|
it 'returns PDF by default' do
|
27
|
-
processor.call(
|
28
|
-
get_mime_type(
|
14
|
+
processor.call(sample_pages, 1)
|
15
|
+
get_mime_type(sample_pages.path).must_include 'application/pdf'
|
29
16
|
end
|
30
17
|
|
31
18
|
it 'raises PageNotFound error' do
|
32
|
-
proc { processor.call(
|
33
|
-
proc { processor.call(
|
19
|
+
proc { processor.call(sample_pages, 0) }.must_raise DragonflyPdf::PageNotFound
|
20
|
+
proc { processor.call(sample_pages, 11) }.must_raise DragonflyPdf::PageNotFound
|
34
21
|
end
|
35
22
|
|
36
|
-
# ---------------------------------------------------------------------
|
37
|
-
|
38
23
|
describe 'single pages' do
|
39
24
|
it 'renders page' do
|
40
|
-
processor.call(
|
41
|
-
pdf = PDF::Reader.new(
|
25
|
+
processor.call(sample_pages, 1)
|
26
|
+
pdf = PDF::Reader.new(sample_pages.path)
|
42
27
|
pdf.pages.count.must_equal 1
|
43
28
|
pdf.pages.first.text.must_equal '1'
|
44
29
|
end
|
45
30
|
end
|
46
31
|
|
47
|
-
describe 'spreads' do
|
48
|
-
it 'recalculates the page number correctly' do
|
49
|
-
processor.call(spreads, 8, spreads: true)
|
50
|
-
pdf = PDF::Reader.new(spreads.path)
|
51
|
-
pdf.pages.count.must_equal 1
|
52
|
-
pdf.pages.first.text.must_include '8'
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe 'spreads_back' do
|
57
|
-
it 'recalculates the page number correctly' do
|
58
|
-
processor.call(spreads_back, 9, spreads: true)
|
59
|
-
pdf = PDF::Reader.new(spreads_back.path)
|
60
|
-
pdf.pages.count.must_equal 1
|
61
|
-
pdf.pages.first.text.must_include '9'
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
describe 'spreads_cover' do
|
66
|
-
it 'recalculates the page number correctly' do
|
67
|
-
processor.call(spreads_cover, 9, spreads: true)
|
68
|
-
pdf = PDF::Reader.new(spreads_cover.path)
|
69
|
-
pdf.pages.count.must_equal 1
|
70
|
-
pdf.pages.first.text.must_include '9'
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
describe 'spreads_cover_back' do
|
75
|
-
it 'recalculates the page number correctly' do
|
76
|
-
processor.call(spreads_cover_back, 10, spreads: true)
|
77
|
-
pdf = PDF::Reader.new(spreads_cover_back.path)
|
78
|
-
pdf.pages.count.must_equal 1
|
79
|
-
pdf.pages.first.text.must_include '10'
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
32
|
# ---------------------------------------------------------------------
|
84
33
|
|
85
|
-
def get_mime_type
|
86
|
-
`file --mime-type #{file_path}`.gsub(/\n/,
|
34
|
+
def get_mime_type(file_path)
|
35
|
+
`file --mime-type #{file_path}`.gsub(/\n/, '')
|
87
36
|
end
|
88
|
-
|
89
37
|
end
|
90
38
|
end
|
91
39
|
end
|
@@ -4,78 +4,31 @@ require 'pdf-reader'
|
|
4
4
|
module DragonflyPdf
|
5
5
|
module Processors
|
6
6
|
describe PageThumb do
|
7
|
-
|
8
7
|
let(:app) { test_app.configure_with(:pdf) }
|
9
8
|
let(:processor) { DragonflyPdf::Processors::PageThumb.new }
|
10
|
-
|
11
|
-
let(:single_pages) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_pages.pdf')) }
|
12
|
-
let(:spreads) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_spreads.pdf')) }
|
13
|
-
let(:spreads_back) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_spreads_back.pdf')) }
|
14
|
-
let(:spreads_cover) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_spreads_cover.pdf')) }
|
15
|
-
let(:spreads_cover_back) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_spreads_cover_back.pdf')) }
|
16
|
-
|
17
|
-
before do
|
18
|
-
spreads.meta['spreads'] = true
|
19
|
-
spreads_cover.meta['spreads'] = true
|
20
|
-
spreads_back.meta['spreads'] = true
|
21
|
-
spreads_cover_back.meta['spreads'] = true
|
22
|
-
end
|
9
|
+
let(:sample_pages) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_pages.pdf')) }
|
23
10
|
|
24
11
|
# =====================================================================
|
25
12
|
|
26
13
|
it 'returns PNG by default' do
|
27
|
-
processor.call(
|
28
|
-
get_mime_type(
|
14
|
+
processor.call(sample_pages, 1, density: 72)
|
15
|
+
get_mime_type(sample_pages.path).must_include 'image/png'
|
29
16
|
end
|
30
17
|
|
31
18
|
it 'raises PageNotFound error' do
|
32
|
-
proc { processor.call(
|
33
|
-
proc { processor.call(
|
34
|
-
end
|
35
|
-
|
36
|
-
# ---------------------------------------------------------------------
|
37
|
-
|
38
|
-
describe 'single pages' do
|
39
|
-
it 'renders page' do
|
40
|
-
skip
|
41
|
-
processor.call(single_pages, 1, density: 72)
|
42
|
-
end
|
19
|
+
proc { processor.call(sample_pages, 0) }.must_raise DragonflyPdf::PageNotFound
|
20
|
+
proc { processor.call(sample_pages, 11) }.must_raise DragonflyPdf::PageNotFound
|
43
21
|
end
|
44
22
|
|
45
|
-
|
46
|
-
|
47
|
-
skip
|
48
|
-
processor.call(spreads, 3, density: 72, spreads: true)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
describe 'spreads_back' do
|
53
|
-
it 'recalculates the page number correctly' do
|
54
|
-
skip
|
55
|
-
processor.call(spreads_back, 3, density: 72, spreads: true)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
describe 'spreads_cover' do
|
60
|
-
it 'recalculates the page number correctly' do
|
61
|
-
skip
|
62
|
-
processor.call(spreads_cover, 3, density: 72, spreads: true)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
describe 'spreads_cover_back' do
|
67
|
-
it 'recalculates the page number correctly' do
|
68
|
-
skip
|
69
|
-
processor.call(spreads_cover_back, 3, density: 72, spreads: true)
|
70
|
-
end
|
23
|
+
it 'renders page' do
|
24
|
+
processor.call(sample_pages, 1, density: 72)
|
71
25
|
end
|
72
26
|
|
73
27
|
# ---------------------------------------------------------------------
|
74
28
|
|
75
|
-
def get_mime_type
|
76
|
-
`file --mime-type #{file_path}`.gsub(/\n/,
|
29
|
+
def get_mime_type(file_path)
|
30
|
+
`file --mime-type #{file_path}`.gsub(/\n/, '')
|
77
31
|
end
|
78
|
-
|
79
32
|
end
|
80
33
|
end
|
81
|
-
end
|
34
|
+
end
|
@@ -1,17 +1,15 @@
|
|
1
1
|
module DragonflyPdf
|
2
2
|
module Processors
|
3
3
|
describe SubsetFonts do
|
4
|
-
|
5
4
|
let(:app) { test_app.configure_with(:pdf) }
|
6
5
|
let(:processor) { DragonflyPdf::Processors::SubsetFonts.new }
|
7
|
-
|
8
|
-
let(:sample_pdf) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_pages.pdf')) }
|
6
|
+
let(:sample_pages) { Dragonfly::Content.new(app, SAMPLES_DIR.join('sample_pages.pdf')) }
|
9
7
|
|
10
8
|
# =====================================================================
|
11
9
|
|
12
10
|
it 'returns PDF by default' do
|
13
|
-
processor.call(
|
14
|
-
get_mime_type(
|
11
|
+
processor.call(sample_pages, 1)
|
12
|
+
get_mime_type(sample_pages.path).must_include "application/pdf"
|
15
13
|
end
|
16
14
|
|
17
15
|
private # =============================================================
|
@@ -19,7 +17,6 @@ module DragonflyPdf
|
|
19
17
|
def get_mime_type file_path
|
20
18
|
`file --mime-type #{file_path}`.gsub(/\n/, "")
|
21
19
|
end
|
22
|
-
|
23
20
|
end
|
24
21
|
end
|
25
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dragonfly_pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Celizna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dragonfly
|
@@ -28,30 +28,30 @@ dependencies:
|
|
28
28
|
name: pdf-reader
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
34
|
-
type: :
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.7'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
54
|
+
version: '1.7'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,6 +116,8 @@ extensions: []
|
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
118
|
- ".gitignore"
|
119
|
+
- ".travis.yml"
|
120
|
+
- CHANGELOG.md
|
119
121
|
- Gemfile
|
120
122
|
- Guardfile
|
121
123
|
- LICENSE
|
@@ -131,10 +133,7 @@ files:
|
|
131
133
|
- lib/dragonfly_pdf/processors/subset_fonts.rb
|
132
134
|
- lib/dragonfly_pdf/version.rb
|
133
135
|
- samples/sample_pages.pdf
|
134
|
-
- samples/
|
135
|
-
- samples/sample_spreads_back.pdf
|
136
|
-
- samples/sample_spreads_cover.pdf
|
137
|
-
- samples/sample_spreads_cover_back.pdf
|
136
|
+
- samples/sample_pages_with_bleed.pdf
|
138
137
|
- test/dragonfly_pdf/analysers/pdf_properties_test.rb
|
139
138
|
- test/dragonfly_pdf/plugin_test.rb
|
140
139
|
- test/dragonfly_pdf/processors/page_test.rb
|
data/samples/sample_spreads.pdf
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|