2

I am using FPDI to create pdf document,add text and download it in the browser with this code:

    $pdf = new FPDI();
    $pdf->AddPage();
    $pagecount = $pdf->setSourceFile($filePath);
    $tppl = $pdf->importPage(1);
    $pdf->useTemplate($tppl, 0, 0, 222.25, 297.18);
    $pdf->SetFont('DejaVu','',10);

    $pdf->SetXY(106,42);
    $pdf->Write(0, date('d'));

    $pdf->SetXY(136,42);
    $pdf->Write(0, date('m'));

    $pdf->Output();

And i want to know if there is any way to convert the pdf i create to png/jpeg file and then send it to the user?

YosiFZ
  • 7,792
  • 21
  • 114
  • 221
  • why not send them the pdf? –  Apr 28 '14 at 21:56
  • Because i am using this to send the pdf to android and in android i am using google docs to show the pdf and it make some problems – YosiFZ Apr 28 '14 at 22:05
  • possible duplicate of [PDF to JPG conversion using PHP](http://stackoverflow.com/questions/8624886/pdf-to-jpg-conversion-using-php) – Muhammad Abdul-Rahim May 06 '15 at 18:38
  • After generating the PDF you can save it in a temp location and then convert it to a JPG. See this: http://stackoverflow.com/questions/8624886/pdf-to-jpg-conversion-using-php – Muhammad Abdul-Rahim May 06 '15 at 18:38

0 Answers0