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
What is baseurl?
What are the delimiters in php?
Explain me what is the goto statement useful for?
Tell me what are the __construct() and __destruct() methods in a php class?
Does strlen include null?
Tell me how can we display information of a variable and readable by human with php?
What is the difference between for and foreach in php?
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?
What is mysqli_real_escape_string?
Is php case sensitive?
Do while loops php?
How do you define a constant in php?
How to test if a variable is an array?
Explain me what is the difference between $_files['userfile']['name'] and $_files['userfile']['tmp_name']?
How can we display the output directly to the browser?