dragonfly_pdf 2.2.0 → 2.2.1
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/CHANGELOG.md +4 -0
- data/lib/dragonfly_pdf/analysers/pdf_properties.rb +1 -1
- data/lib/dragonfly_pdf/processors/append.rb +1 -1
- data/lib/dragonfly_pdf/processors/convert.rb +4 -4
- data/lib/dragonfly_pdf/processors/page.rb +1 -1
- data/lib/dragonfly_pdf/processors/remove_password.rb +1 -1
- data/lib/dragonfly_pdf/processors/rotate.rb +1 -1
- data/lib/dragonfly_pdf/processors/stamp.rb +1 -1
- data/lib/dragonfly_pdf/processors/subset_fonts.rb +1 -1
- data/lib/dragonfly_pdf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c3befda2f4836c64afe15ce4f326e59f2de98d07c1d6ebfe40537d06a86068a
|
4
|
+
data.tar.gz: 074a8cb3cde1158b8729cbf6545f43ad81734b9d2b7dc3e7dd44b70ac94a624d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d79bd5c7f0e5f9607659b23524e68048b81bc2bb9577b8423fe3886ad2bb82d93e212259940da23e2610d7ebd4919cfc2f7e25f3709a9e05cc0bb182ed3a729e
|
7
|
+
data.tar.gz: 0a3e896ecb9bb5c6c2001f4c59587274f16595130c52dea6c24e166d0688d1d05c5ffe2366dbcac5e2b850c2ebf1aaa8f4a01938a057310a589a18d060b7fd0f
|
data/CHANGELOG.md
CHANGED
@@ -5,7 +5,7 @@ module DragonflyPdf
|
|
5
5
|
return {} unless content.ext
|
6
6
|
return {} unless SUPPORTED_FORMATS.include?(content.ext.downcase)
|
7
7
|
|
8
|
-
data = `pdftk #{content.path} dump_data`
|
8
|
+
data = `pdftk "#{content.path}" dump_data`
|
9
9
|
|
10
10
|
page_count = data.scan(/NumberOfPages: (\d+)/).flatten.first.to_i
|
11
11
|
page_numbers = data.scan(/PageMediaNumber: (\d+)/).flatten.map(&:to_i)
|
@@ -6,7 +6,7 @@ module DragonflyPdf
|
|
6
6
|
raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
|
7
7
|
|
8
8
|
content.shell_update(ext: 'pdf') do |old_path, new_path|
|
9
|
-
"#{pdftk_command} #{old_path} #{pdfs_to_append.map(&:path).join(' ')} cat output #{new_path}"
|
9
|
+
"#{pdftk_command} \"#{old_path}\" #{pdfs_to_append.map(&:path).join(' ')} cat output \"#{new_path}\""
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -20,14 +20,14 @@ module DragonflyPdf
|
|
20
20
|
pdf_options = options.fetch('pdf_options', 'compress,compress-fonts,compress-images,linearize,sanitize,garbage=deduplicate')
|
21
21
|
|
22
22
|
content.shell_update(ext: format) do |old_path, new_path|
|
23
|
-
"#{convert_command} -o #{new_path} -F #{format} -O #{pdf_options} #{old_path} #{page}"
|
23
|
+
"#{convert_command} -o \"#{new_path}\" -F #{format} -O #{pdf_options} \"#{old_path}\" #{page}"
|
24
24
|
end
|
25
25
|
|
26
26
|
when 'svg'
|
27
27
|
text = options.fetch('text', 'path')
|
28
28
|
|
29
29
|
content.shell_update(ext: format) do |old_path, new_path|
|
30
|
-
"#{convert_command} -o #{new_path} -F #{format} -O text=#{text} #{old_path} #{page}"
|
30
|
+
"#{convert_command} -o \"#{new_path}\" -F #{format} -O text=#{text} \"#{old_path}\" #{page}"
|
31
31
|
end
|
32
32
|
|
33
33
|
# MuPDF appends 1 at the end of the filename, we need to rename it back
|
@@ -50,11 +50,11 @@ module DragonflyPdf
|
|
50
50
|
width = dimensions.width.ceil
|
51
51
|
|
52
52
|
content.shell_update(ext: format) do |old_path, new_path|
|
53
|
-
"#{convert_command} -o #{new_path} -F #{format} -O width=#{width},colorspace=rgb #{old_path} #{page}"
|
53
|
+
"#{convert_command} -o \"#{new_path}\" -F #{format} -O width=#{width},colorspace=rgb \"#{old_path}\" #{page}"
|
54
54
|
end
|
55
55
|
|
56
56
|
# MuPDF appends 1 at the end of the filename, we need to rename it back
|
57
|
-
`mv #{content.path.sub(".#{format}", "1.#{format}")} #{content.path}`
|
57
|
+
`mv \"#{content.path.sub(".#{format}", "1.#{format}")}\" \"#{content.path}\"`
|
58
58
|
end
|
59
59
|
|
60
60
|
content.meta['format'] = format
|
@@ -11,7 +11,7 @@ module DragonflyPdf
|
|
11
11
|
raise DragonflyPdf::PageNotFound unless pdf_properties['page_numbers'].include?(page_number)
|
12
12
|
|
13
13
|
content.shell_update(ext: 'pdf') do |old_path, new_path|
|
14
|
-
"#{gs_command} -dFirstPage=#{page_number} -dLastPage=#{page_number} -o #{new_path} -f #{old_path}"
|
14
|
+
"#{gs_command} -dFirstPage=#{page_number} -dLastPage=#{page_number} -o \"#{new_path}\" -f \"#{old_path}\""
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -6,7 +6,7 @@ module DragonflyPdf
|
|
6
6
|
raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
|
7
7
|
|
8
8
|
content.shell_update(ext: 'pdf') do |old_path, new_path|
|
9
|
-
"#{gs_command} -q -sOutputFile
|
9
|
+
"#{gs_command} -q -sOutputFile=\"#{new_path}\" -c .setpdfwrite -f \"#{old_path}\""
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -6,7 +6,7 @@ module DragonflyPdf
|
|
6
6
|
raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
|
7
7
|
|
8
8
|
content.shell_update(ext: 'pdf') do |old_path, new_path|
|
9
|
-
"#{pdftk_command} #{old_path} stamp #{stamp_pdf.path} output #{new_path}"
|
9
|
+
"#{pdftk_command} \"#{old_path}\" stamp \"#{stamp_pdf.path}\" output \"#{new_path}\""
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -6,7 +6,7 @@ module DragonflyPdf
|
|
6
6
|
raise UnsupportedFormat unless SUPPORTED_FORMATS.include?(content.ext.downcase)
|
7
7
|
|
8
8
|
content.shell_update(ext: 'pdf') do |old_path, new_path|
|
9
|
-
"#{gs_command} -o #{new_path} -f #{old_path}"
|
9
|
+
"#{gs_command} -o \"#{new_path}\" -f \"#{old_path}\""
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
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: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Celizna
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dragonfly
|