Skip to content

Commit a6fb116

Browse files
committed
Respect PDF crop settings when converting to image
1 parent eba07d4 commit a6fb116

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Configuration/ConfigurationDefaults.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public function __construct(&$settings) {
121121
'#engine' => 'Convert\\ImageMagick',
122122
"colorspace" => "sRGB",
123123
"flatten" => 1,
124+
"define" => 'pdf:use-cropbox=true',
124125
),
125126
),
126127
'pdf->(zip/jpg|directory/jpg)' => array(

src/Engine/Convert/ImageMagick.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ class ImageMagick extends EngineBase {
5555
'default' => NULL,
5656
'group' => 1,
5757
),
58+
array(
59+
'name' => 'define',
60+
'mode' => Shell::SHELL_ARG_BASIC_SGL,
61+
'default' => NULL,
62+
'group' => 1,
63+
),
5864
);
5965

6066
public function convertFile($source, $destination) {

0 commit comments

Comments
 (0)