We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9172e30 commit 929a426Copy full SHA for 929a426
lib/docsplit/transparent_pdfs.rb
@@ -9,7 +9,7 @@ module TransparentPDFs
9
def ensure_pdfs(docs)
10
[docs].flatten.map do |doc|
11
ext = File.extname(doc)
12
- if ext.downcase == '.pdf'
+ if ext.downcase == '.pdf' || File.open(doc, &:readline) =~ /\A\%PDF-\d+(\.\d+)?$/
13
doc
14
else
15
tempdir = File.join(Dir.tmpdir, 'docsplit')
@@ -23,4 +23,4 @@ def ensure_pdfs(docs)
23
24
extend TransparentPDFs
25
26
-end
+end
0 commit comments