From dc489bba378ef0ebc42b305f18669a333560d255 Mon Sep 17 00:00:00 2001 From: 7u83 <7u83> Date: Tue, 25 Feb 2020 10:59:24 +0000 Subject: [PATCH] Download button creates PDF for download. But PDF contanis only the startpage. --- kaform.js | 16 ++++++++++++---- submit.php | 29 +++++++++++++++++++---------- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/kaform.js b/kaform.js index 82beb63..d594877 100644 --- a/kaform.js +++ b/kaform.js @@ -146,18 +146,26 @@ function addTableRow(){ var e=""; // add column for position no - e += `
Projekt: $_POST[project]
-WMDE Ansprechpartner: $_POST[wmdecontact]
Name: $_POST[realname]
E-Mail: $_POST[email]
- Telefon: $_POST[phone]
WMDE Ansprechpartner: $_POST[wmdecontact]
+// Telefon: $_POST[phone] // Print text using writeHTMLCell() $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); @@ -249,7 +249,7 @@ function calcSum(){ } foreach ($_POST['amount'] as $val){ - var_dump($val); +// var_dump($val); $sum += floatval(str_replace(",",".",$val)); } return $sum; @@ -259,10 +259,19 @@ function calcSum(){ $pdfs = array(); // Applicatoin starts here +// +$p = mkFrontPDF(); + +$file = $p; +header('Content-Disposition: attachment; filename="'. basename($file) . '"'); +header('Content-Length: ' . filesize($file)); +readfile($file); + +var_dump($p); +die(); echo "Making Fromt PDF