7 Replies Latest reply on Jun 25, 2011 6:39 AM by kglad

    fpdf

    Ron Colmen Level 2

      I'm trying to generate a pdf using fpdf. What are the possibilities that might be avoiding generating this PDF. The swf and the php works fine I tested it in another server. Is there any areas that I need to do any adjustments in my server? Any help is highly appriciated.

        • 1. Re: fpdf
          kglad Adobe Community Professional & MVP

          i've used fpdf to generate a pdf using images and text from flash without problem.

           

          are you able to hardcode data (like simple text) and save a pdf using fpdf?  if not, show the php code you tried.

          1 person found this helpful
          • 2. Re: fpdf
            Ron Colmen Level 2

            require('fpdf.php');

             

            $imageA = explode(",,",$proItemS);

             

            if($imageA[0]!="") {

                $pdf=new FPDF("P","mm","A4");

                $pdf->AliasNbPages();

                $pdf->SetFont('Helvetica','',9);

                $pdf->SetMargins(0,0,0);

                for($i=0;$i<count($imageA);$i++){

                    $pdf->AddPage();

                    $widthHeightA = $pdf->Image($imageA[$i]."_top.jpg",0,0);

                    $pdf->Image($imageA[$i]."_bottom.jpg",0,$widthHeightA[1]);

                }

                $pdfdoc = $pdf->Output("", "S");

            }

            $to = "me@web.com";

            $sender = "Dtext";

            $subject = "TryX";

            $headers .= "Cc: $new\r\n";

             

            $message = "<HTML>

            //dContent

            \</HTML>";

            $eol = PHP_EOL;

            $separator = md5(time());

            if($imageA[0]!="") {

                $filename = "d_Form.pdf";

                $pdfdoc = $pdf->Output("", "S");

                $attachment = chunk_split(base64_encode($pdfdoc));

            }

             

            $headers  = "From: ".$sender.$eol;

            $headers .= "MIME-Version: 1.0".$eol;

            $headers .= "Content-Type: multipart/mixed; boundary=\"".$separator."\"".$eol.$eol;

            $headers .= "Content-Transfer-Encoding: 7bit".$eol;

            $headers .= "This is a MIME encoded message.".$eol.$eol;

             

            $headers .= "--".$separator.$eol;

            $headers .= "Content-Type: text/html; charset=\"iso-8859-1\"".$eol;

            $headers .= "Content-Transfer-Encoding: 8bit".$eol.$eol;

            $headers .= $message.$eol.$eol;

             

            if($imageA[0]!="") {

                $headers .= "--".$separator.$eol;

                $headers .= "Content-Type: application/octet-stream; name=\"".$filename."\"".$eol;

                $headers .= "Content-Transfer-Encoding: base64".$eol;

                $headers .= "Content-Disposition: attachment".$eol.$eol;

                $headers .= $attachment.$eol.$eol;

                $headers .= "--".$separator."--";

            }

            mail("me@web.com", $subject, "", $headers);

            echo 'Successful!';

            • 3. Re: fpdf
              kglad Adobe Community Professional & MVP

              the first problem i see is $proItemS is undefined.

              • 4. Re: fpdf
                Ron Colmen Level 2

                Oo

                  |

                ----

                 

                Thanks Kglad!!

                • 5. Re: fpdf
                  kglad Adobe Community Professional & MVP

                  you're welcome.

                   

                  was that all that you needed to fix?

                  • 6. Re: fpdf
                    Ron Colmen Level 2

                    I thought that was it... but it seems that's not the only issue. I still can not get this to work.

                    • 7. Re: fpdf
                      kglad Adobe Community Professional & MVP

                      copy and paste your corrected code.