html로 이미지를 만들고 싶습니다. 오래된 이미지이기 때문에 오래 사용할 수 없으며 더 이상 작동하지 않으며 비슷한 것을 원합니다. 내가 이미이html에서 이미지 만들기
<?php
$html_code = "<b> this is the body </b> ";
// Create the image
$img = imagecreate("300", "600");
imagecolorallocate($img,0,0,0);
$c = imagecolorallocate($img,70,70,70);
imageline($img,0,0,300,600,$c2);
imageline($img,300,0,0,600,$c2);
$white = imagecolorallocate($img, 255, 255, 255);
imagettftext($img, 9, 0, 1, 1, $white, "arial.ttf", $html_code);
// Display the image
header("Content-type: image/jpeg");
imagejpeg($img);
같은 GD 라이브러리를 사용하여 이미지를 만들려고했지만 그것은 HTML 태그를 "컴파일"을 텍스트로 이미지를 인쇄하지 않습니다.
안부
'이것은 본문'입니다. 그건 정상입니다. 이것은 html 마크 업을 렌더링하는 웹 브라우저의 작업입니다. php doc의 imagettftext 페이지에는 몇 가지 힌트가 있습니다. http://php.net/manual/fr/function.imagettftext.php – Aif
'imagettftext'는 HTML을 입력으로 사용하지만 일반 텍스트를 사용하지 않으므로 이렇게 할 수는 없습니다. – Andris