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

What is baseurl?

530


What are the delimiters in php?

521


Explain me what is the goto statement useful for?

478


Tell me what are the __construct() and __destruct() methods in a php class?

502


Does strlen include null?

576






Tell me how can we display information of a variable and readable by human with php?

565


What is the difference between for and foreach in php?

495


How to implement a class named dragonball. This class must have an attribute named ballcount (which starts from 0) and a method ifoundaball. When ifoundaball is called, ballcount is increased by one. If the value of ballcount is equal to seven, then the message you can ask your wish is printed, and ballcount is reset to 0. How would you implement this class?

628


What is mysqli_real_escape_string?

527


Is php case sensitive?

512


Do while loops php?

509


How do you define a constant in php?

553


How to test if a variable is an array?

559


Explain me what is the difference between $_files['userfile']['name'] and $_files['userfile']['tmp_name']?

487


How can we display the output directly to the browser?

523