Skip to content

Commit 929a426

Browse files
committed
1 parent 9172e30 commit 929a426

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/docsplit/transparent_pdfs.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module TransparentPDFs
99
def ensure_pdfs(docs)
1010
[docs].flatten.map do |doc|
1111
ext = File.extname(doc)
12-
if ext.downcase == '.pdf'
12+
if ext.downcase == '.pdf' || File.open(doc, &:readline) =~ /\A\%PDF-\d+(\.\d+)?$/
1313
doc
1414
else
1515
tempdir = File.join(Dir.tmpdir, 'docsplit')
@@ -23,4 +23,4 @@ def ensure_pdfs(docs)
2323

2424
extend TransparentPDFs
2525

26-
end
26+
end

0 commit comments

Comments
 (0)