0% found this document useful (0 votes)
2 views1 page

PHP Image and PDF Generation Code

The document contains two PHP scripts: one for generating a PNG image with the text 'vapm almala' and another for creating a PDF file that displays 'welcome to php pdf'. Both scripts utilize built-in PHP libraries for image and PDF generation. The output of each script is a visual representation of the specified text in their respective formats.

Uploaded by

smrutigadave
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

PHP Image and PDF Generation Code

The document contains two PHP scripts: one for generating a PNG image with the text 'vapm almala' and another for creating a PDF file that displays 'welcome to php pdf'. Both scripts utilize built-in PHP libraries for image and PDF generation. The output of each script is a visual representation of the specified text in their respective formats.

Uploaded by

smrutigadave
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

------------------------image---------------------

<?php
header('content-type:image/png');
$img=imagecreate(500,300);
$back=imagecolorallocate($img,225,22
5,255);
$for=imagecolorallocate($img,0,0,0);
imagestring($img,12,150,50,"vapm
almala",$for);
imagepng($img);
?>
Output:
--------------------------------pdf----------------------------

<?php

require('[Link]');

$pdf=new FPDF();

$pdf->AddPage();

$pdf->SetFont('Arial','B',20);

$pdf->cell(50,60,"welcome to php pdf");

$pdf->output();

?>

Output:

You might also like