Permalink
Browse files

Cleanup code

  • Loading branch information...
1 parent 64121b8 commit 56d1e5361e25c7002e59da14005989520ea17506 @besi committed Jul 14, 2011
Showing with 12 additions and 12 deletions.
  1. +12 −12 src/markdownletter/mpdf.php
@@ -1,23 +1,23 @@
<?php
- include('lib/mpdf/mpdf.php');
- require_once('lib/txt2letter.php');
-
+ include('lib/mpdf/mpdf.php');
+ require_once('lib/txt2letter.php');
+
if (isset($_POST['markdownText']) && isset($_POST['letterTemplate'])) {
-
- $txt2Letter = new Txt2Letter();
- $my_text = $txt2Letter->getHtmlMarkdown();
- $my_text = $txt2Letter->getHtmlWithIdsBQ($my_text);
-
+
+ $txt2Letter = new Txt2Letter();
+ $my_text = $txt2Letter->getHtmlMarkdown();
+ $my_text = $txt2Letter->getHtmlWithIdsBQ($my_text);
+
$stylesheet = file_get_contents("templates/".$_POST["letterTemplate"].".css");
+ // TODO: It would be nice if a letter heading is present if this is used as the filename
+ // TODO: Example: "Application for Job" --> "YYYY-MM-DD_Application_for_Job.pdf"
$fileName = date("Y-m-d")."_Letter.pdf";
-
+
$mpdf=new mPDF();
$mpdf->WriteHTML($stylesheet, 1);
$mpdf->WriteHTML($my_text);
$mpdf->Output($fileName, 'D');
exit;
-
}
- ?>
-
+?>

0 comments on commit 56d1e53

Please sign in to comment.