hi! i am tushar.
i am trying to insert digital signature in a pdf file using
PHP. i create a digital signature jpg image using
imagecreatefromjpeg() function, but whenever i trying to
insert it into my pdf file it shown this error.
"FPDF error: Not a JPEG file: signature.jpg". could some one
help me? how can i insert a digital signature in a pdf file
using PHP?

Answer Posted / pavunkumar

I have given this example for creating pdf file with image
files. In Image function you need specify the image file name .

<?php
require('fpdf.php');
$pdf=new FPDF();
$pdf->AddPage();
$pdf->Image('signature.jpeg',150,150,30,20);
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output("newfile.pdf","I");
?>

After executing this script , you will be getting the file
called newfile.pdf . Which will have a specified image .
and helloworld world string.

For more information . go through this url
http://www.fpdf.org/

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does php start with variables?

738


What is difference between mysql_connect and mysqli_connect?

675


What is the use of the function htmlentities?

806


Can you convert php to html?

704


What is php session and how it works?

693


How do I run a php script in windows?

726


if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer

1584


What are different types of Print Functions available in PHP?

692


Which function will you use to create an array?

711


Do you know how to declare an array in php?

701


Tell me how to find current date and time?

745


Does php 5 support exceptions?

871


What is a namespace in php?

685


What is php and what does it do?

750


When viewing an html page in a browser, the browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?

732