Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
besi committed Jul 14, 2011
1 parent 64121b8 commit 56d1e53
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/markdownletter/mpdf.php
@@ -1,23 +1,23 @@
<?php <?php
include('lib/mpdf/mpdf.php'); include('lib/mpdf/mpdf.php');
require_once('lib/txt2letter.php'); require_once('lib/txt2letter.php');
if (isset($_POST['markdownText']) && isset($_POST['letterTemplate'])) { if (isset($_POST['markdownText']) && isset($_POST['letterTemplate'])) {

$txt2Letter = new Txt2Letter(); $txt2Letter = new Txt2Letter();
$my_text = $txt2Letter->getHtmlMarkdown(); $my_text = $txt2Letter->getHtmlMarkdown();
$my_text = $txt2Letter->getHtmlWithIdsBQ($my_text); $my_text = $txt2Letter->getHtmlWithIdsBQ($my_text);

$stylesheet = file_get_contents("templates/".$_POST["letterTemplate"].".css"); $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"; $fileName = date("Y-m-d")."_Letter.pdf";

$mpdf=new mPDF(); $mpdf=new mPDF();
$mpdf->WriteHTML($stylesheet, 1); $mpdf->WriteHTML($stylesheet, 1);
$mpdf->WriteHTML($my_text); $mpdf->WriteHTML($my_text);
$mpdf->Output($fileName, 'D'); $mpdf->Output($fileName, 'D');
exit; exit;

} }
?> ?>

0 comments on commit 56d1e53

Please sign in to comment.