Skip to content

Commit 6089122

Browse files
committed
Merge pull request #59 from jamesalmond/cropbox
Uses crop box on PDF image creation. Fixes #58
2 parents bd35135 + 494d140 commit 6089122

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/docsplit/image_extractor.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def convert(pdf, size, format, previous=nil)
4242
else
4343
page_list(pages).each do |page|
4444
out_file = ESCAPE[File.join(directory, "#{basename}_#{page}.#{format}")]
45-
cmd = "MAGICK_TMPDIR=#{tempdir} OMP_NUM_THREADS=2 gm convert +adjoin #{common} #{escaped_pdf}[#{page - 1}] #{out_file} 2>&1".chomp
45+
cmd = "MAGICK_TMPDIR=#{tempdir} OMP_NUM_THREADS=2 gm convert +adjoin -define pdf:use-cropbox=true #{common} #{escaped_pdf}[#{page - 1}] #{out_file} 2>&1".chomp
4646
result = `#{cmd}`.chomp
4747
raise ExtractionFailed, result if $? != 0
4848
end

0 commit comments

Comments
 (0)