












';
$chunkHeight = 1500;
$poster = Poster::extension('imagick')
->buildImDst(Html::load($html)->size(480)->render());
$canvasInfo = $poster->getCanvasInfo();
$tmpCanvas = $canvasInfo['canvas'];
$width = $canvasInfo['width'];
$height = $canvasInfo['height'];
$count = ceil($height / $chunkHeight);
for ($i = 0; $i < $count; $i++) {
$y = $chunkHeight * $i;
if ($i + 1 == $count) {
$chunkHeight = $height - $y;
}
$crop = Poster::extension('gd')
->buildImDst($tmpCanvas)
->crop(0, $y, $width, $chunkHeight)
->getPoster(__DIR__ . '/../poster/crop/' . $i . '.png');
}