Jump to content

please help me....


ayan.lee

Recommended Posts

i am trying to create a sample report using pdf file...everytime i run my code...there is no error...but when i click the submit button...the pdf file won't appear...instead the window will display...."failed to load pdf document"...is there something with my code...or do i need to upgrade my pdf reader....please help me... :)here is my code:

 

----index.php---

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>PDF Example #1 - Picture Title & Description</title>

<style type="text/css">

<!--

#apDiv1 {

position:absolute;

width:304px;

height:48px;

z-index:1;

left: 268px;

top: 40px;

}

#apDiv2 {

position:absolute;

width:220px;

height:29px;

z-index:1;

left: 23px;

top: 41px;

}

#apDiv3 {

position:absolute;

width:131px;

height:26px;

z-index:2;

left: 637px;

top: 33px;

}

#Layer1 {

position:absolute;

width:344px;

height:257px;

z-index:1;

left: 437px;

top: 101px;

}

body,td,th {

font-family: Verdana;

font-size: 14px;

}

.style1 {

font-size: 24px;

font-weight: bold;

}

-->

</style>

</head>

 

<body>

<form action="create.php" method="post" enctype="multipart/form-data">

  <p align="center" class="style1">Join the fun! Add a title and description for this picture! </p>

  <p align="left">#1) Title <br />

    <label>

    <input name="header" type="text" style="height:30px; font-size:28px; font:Helvetica,Verdana;" id="header" />

    </label>

  </p>

  <p align="left">#2) Add Description </p>

  <p align="left">

    <textarea name="body" cols="45" rows="15"></textarea>

  </p>

  <div id="Layer1"><img src="yellow_rock.gifs" width="346" height="262" /></div>

  <p align="left">#3) Click Button </p>

  <p align="left">

    <input name="input" type="submit" value="Create PDF" />

  </p>

  <p align="left"> </p>

  <p> </p>

</form>

 

</body>

</html>

 

---create.php---

 

<?php

$header =$_POST['header'];

$body =$_POST['body'];

include ('class.ezpdf.php');

$pdf =& new Cezpdf();

$pdf->addJpegFromFile('jawbone.jpg',199,$pdf->y-200,200,0);

$pdf->selectFont('./fonts/Helvetica.afm');

$pdf->ezText($header . "\n\n",25,array('justification'=>'centre'));

 

$pdf->ezText("\n\n\n\n\n\n\n" . $body,16,array('justification'=>'centre'));

$pdf->output();

$pdf->ezStream();

?>

 

 

 

 

tanx..

 

Link to comment
Share on other sites

This will probably be moved to Other Libraries and Frameworks.

 

the reason being, nobody knows what is in the included file.. also even if we did see it, nobody would want to review a whole class of working code, to understand why your 10 lines of broken code doesn't work, they'll be able to help you better there, sorry we can't help you in this category :)..

 

I can however, offer you some advice, try forcing a text content-type.. Try error handling.

 

If your page has an error it will usually show you the error, but when you're not in a plain text content-type, you usually can't see the error messages :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.