diff --git a/inc/inc.ClassConversionServiceTextToImage.php b/inc/inc.ClassConversionServiceTextToImage.php index 6c526c695..56a311ec6 100644 --- a/inc/inc.ClassConversionServiceTextToImage.php +++ b/inc/inc.ClassConversionServiceTextToImage.php @@ -96,7 +96,8 @@ class SeedDMS_ConversionServiceTextToImage extends SeedDMS_ConversionServiceBase $draw->setFontSize($fontSize); $draw->setTextAlignment(Imagick::ALIGN_LEFT); - $content = file_get_contents($infile); + /* Limit the number of characters to 30000 which is roughly 9 pages */ + $content = file_get_contents($infile, false, null, 0, 30000); $lines = preg_split('~\R~',$content); $boxY = $boxTop; $pagecount = 0;