图片转PDF

目的:图片转pdf(image2pdf)
依赖:fpdf.php
网址 为 http://fpdf.org/ 有文档和包

demo:
step 1 :
  First download fpdf library class from here http://fpdf.org/
step 2 :
  Take the file “fpdf.php” from downloaded file
step 3 :

1   // write this code on your file say example.php
2   // include fpdf library class
3   require(‘fpdf.php’);
4   $image = dirname(__FILE__).DIRECTORY_SEPARATOR.’my_image.png’;
5   $pdf = new FPDF();
6   $pdf->AddPage();
7   $pdf->Image($image,20,40,170,170);
8   $pdf->Output();

你可能感兴趣的:(图片转PDF)