görüntü işleme php ve PDFof görüntü işleme olsun

0 Cevap php

Ben verilen metne dayalı bir görüntü oluşturmak için sahip olduğu bir senaryo üzerinde çalışıyorum.

Temelde ben üreten görüntüleri çeşitli yerlerde bu metinleri yere sahip.

Bu benim iş bitmiş kadar. Aşağıda bunun için kodudur.

header ("Content-type: image/jpeg");
$handle = imagecreate(415, 588) or die ("Cannot Create image");

$inven_tory=imagecreatefromjpeg($_SERVER['DOCUMENT_ROOT'].'/thumb/editor/text_letter.jpg');
imagecopymerge($handle,$inven_tory,0,0,0,0,415,588,100);

$bg_color = imagecolorallocate ($handle, 255, 255, 255); // 0 -255
$txt_color = imagecolorallocate ($handle, 0, 0, 0);


// The first parameter is our handle, then font size, rotation, starting X, starting Y, text color, font, and finally our text.
imagettftext($handle, 15, 0, 10, 25, $txt_color, "fonts/" . $font, wordwrap($text1, 35, "\n", true));

// The first parameter is our handle, then font size, rotation, starting X, starting Y, text color, font, and finally our text.
imagettftext($handle, 20, 0, 40, 120, $txt_color, "fonts/" . $font, wordwrap($text2, 13, "\n", true));

// The first parameter is our handle, then font size, rotation, starting X, starting Y, text color, font, and finally our text.
imagettftext($handle, 15, 0, 10, 500, $txt_color, "fonts/" . $font, wordwrap($text3, 40, "\n", true));

imagejpeg($handle);

Resim Bu sayfada düzgün yaratıyor. Şimdi PDF formatında bu oluşturulan görüntü yerleştirmek ve PDF kaydetmek için kullanıcı vermek. Bunu nasıl yapabilirim? Eğer açık değilse bana bildirin.

0 Cevap