Closed GoogleCodeExporter closed 8 years ago
here is me source code
include("dompdf_config.inc.php");
$html ='<html><body>'
.'<br/>'.'<br/>'.'<br/>'.'<br/>'.'</>'.
'<h3 style="margin-left:5%;margin-top:0;margin-bottom:0;padding:0;">
DoctorsInTraining.com USMLE Step 1 Review </h3>'.
'<h3 style="margin-left:5%;margin-top:0;padding:0;margin-bottom:0;"> <strong> - 6 Week "Emergency" Plan - Testing week of:'.$ArrayofDates[0].' </strong> </h3>'.
'<p style="font-size:10px;
margin-left:5%;margin-top:0;margin-bottom:0;padding:0;">Study Guide Created
For: '.$ArrayofDates[49].'</p>'.'<br>'.
'<table border="1px thin ffffff" cellpadding="2px" align="center" cellspacing="0px" width="80%" height="300px" style="height:300px; margin-left:5%;font-size:14px;" >
<tr> <td><strong>Week</strong> </td> <td><strong>Week of:</strong> </td>
<td><strong>First Aid & Doctors In Training</strong> </td>
<td><strong>Question Bank**</strong> </td> </tr>
<tr> <td>Days 1-3 </td> <td>'.$ArrayofDates[6].' </td> <td> </td> <td>4hr
practice test (200q). If less than 45% correct, then
you will require at least 12 weeks of study, and this plan
will not work for you. </td> </tr>
<tr> <td>2 </td> <td>'.$ArrayofDates[5].' </td> <td>Doctors In Training USMLE
Step 1 Review </td> <td>25-50q daily. Weekend 150q NBME test online. </td>
</tr>
<tr> <td>3 </td> <td>'.$ArrayofDates[4].' </td> <td>Doctors In Training USMLE
Step 1 Review </td> <td>25-50q daily. Weekend 150q NBME test online. </td>
</tr>
<tr> <td>4 </td> <td>'.$ArrayofDates[3].' </td> <td>Doctors In Training USMLE
Step 1 Review </td> <td>25-50q daily. Weekend 150q NBME test online. </td>
</tr>
<tr> <td>5 </td> <td>'.$ArrayofDates[2].' </td> <td>Doctors In Training USMLE
Step 1 Review </td> <td>25-50q daily. 100Q DIT Predictive Exam. </td> </tr>
</table><br>
'.'<p style="margin-left:5%;"><strong>Week 6 : Post Course -</strong> Week of:
'.$ArrayofDates[1].'</p><ul>'.
'<li style="margin-left:5%;">If scoring less than 55-60% correct on practice
questions (Qbank or World), your risk of not passing Step 1 is high. </li>'.
'<li style="margin-left:5%;">The last 5 days before your test, re-read First
Aid (1/5 daily) and review high-yield info from the course. </li>'.
'<li style="margin-left:5%;">Take test within a 5-14 day window after the
DoctorsInTraining.com course </li><br>'.
'<li style="margin-left:5%;">** Question Bank resources to consider: Kaplan
Q-bank, USMLEWorld.com, NMS review book </li>'.
'<li style="margin-left:5%;">**It usually takes 1-2hrs to take and review 25
questions. </li></ul> <br> '.
'<p style="margin-left:5%;"><strong>Review Books to strongly consider reading
or referencing:</strong> </p><ul>'.
'<li style="margin-left:5%;">BRS Pathology (or Goljan) </li>'.
'<li style="margin-left:5%;">BRS Physiology </li>'.
'<li style="margin-left:5%;">BRS Physiology </li>'.
'<li style="margin-left:5%;">Lippincott Biochemistry (or Goljan) </li>'.
'<li style="margin-left:5%;">Lippincott Pharmacology </li>'.
'<li style="margin-left:5%;">Robbins Pathology Chapters 1-7 </li>'.
'<li style="margin-left:5%;">HY Neuroanatomy </li>'.
'<br>'.
'<p style="margin-left:5%;"><strong>Important Notes:</strong> </p>'.
'<li style="margin-left:5%;">Success with this plan will require 12+ hours of
study daily. </li>'.
'<li style="margin-left:5%;">By placing a check mark on the upper right-hand
corner of a page completed, you can skip around in pages and keep track of what
you have already done. </li>'.
'<li style="margin-left:5%;">Meet with a study partner 2-3 times a week so that
you can quiz each other over the FA pages read in previous weeks. </li>'.
'<li style="margin-left:5%;">Each week, set aside a small amount of time to
quickly review the FA pages read the previous week. </li></ul>'.
'<script type="text/php">
if ( isset($pdf) ) {
//$font = Font_Metrics::get_font("verdana", "bold");
// $pdf->page_text(72, 18, "Header: {PAGE_NUM} of {PAGE_COUNT}", $font, 6, array(0,0,0));
$w = $pdf->get_width();
$h = $pdf->get_height();
// Draw a line along the bottom
$y = $h - 2 * $text_height - 24;
$pdf->line(16, $y, $w - 16, $y, $color, 1);
// Add a logo
$img_w = 2 * 290; // 2 inches, in points
$img_h = 1 * 70; // 1 inch, in points -- change these as required
$pdf->image("https://origin.ih.constantcontact.com/fs045/1102653126500/img/673.png","png", 1,1, $img_w, $img_h);
// Close the object (stop capture)
// $pdf->close_object();
}
</script>
'.'</body></html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf",array("Attachment" => 0));
Original comment by kyle.mor...@gmail.com
on 9 Sep 2010 at 9:49
The HTML source is far from being valid :
- </> is not a valid HTML tag
- 1px thin ffffff >> you forgot the # before 000000
- the table's attributes dont need a unit, for example you should use width="300px" but width="300" (but the units are still required in the style attribute)
- you shouldn't use <br> between LI tags
Be sure that accesses to $ArrayofDates don't throw errors and that it works
with or without the <script type="text/php> element (note that you need to set
the DOMPDF_ENABLE_PHP to true for this element to be taken into account).
Original comment by fabien.menager
on 15 Nov 2010 at 1:18
Original comment by fabien.menager
on 10 Apr 2011 at 7:16
[deleted comment]
Original comment by eclecticgeek
on 30 May 2013 at 5:15
Original issue reported on code.google.com by
kyle.mor...@gmail.com
on 9 Sep 2010 at 9:48