Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
88 righe
2.3 KiB
88 righe
2.3 KiB
<? |
|
$error = true; |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (isset($_SESSION["utente"]) && !empty($_POST["content"]) && tokenVerify()) { |
|
$content = $_POST["content"]; |
|
if (!empty($content)) { |
|
$error = false; |
|
ob_start(); |
|
?> |
|
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
|
<title><?= __("Export") ?></title> |
|
<style type="text/css"> |
|
html, body { |
|
margin: 0px; |
|
padding: 0px; |
|
} |
|
body { |
|
font-family: "Helvetica", sans-serif; |
|
font-size: 10pt; |
|
padding: 1cm; |
|
} |
|
|
|
.card { |
|
margin:0.1cm 0.5cm; |
|
padding:0.5cm; |
|
} |
|
|
|
.text-center { |
|
text-align:center |
|
} |
|
|
|
.bg-success { |
|
background-color:#0C0; |
|
} |
|
|
|
.bg-danger { |
|
background-color:#C00; |
|
} |
|
|
|
table { |
|
width: 100%; |
|
border-spacing: 0; |
|
border-collapse: collapse; |
|
} |
|
th { |
|
background-color:#CCC; |
|
} |
|
td,th { |
|
border: 1px solid #666; |
|
margin:0; |
|
padding: 0.2cm; |
|
} |
|
.text-tiny { |
|
font-size: .7em; |
|
} |
|
.text-small { |
|
font-size: .85em; |
|
} |
|
.text-big { |
|
font-size: 1.4em; |
|
} |
|
.text-huge { |
|
font-size: 1.8em; |
|
} |
|
|
|
</style> |
|
</head> |
|
<body> |
|
<? |
|
$html = ob_get_clean() . $content . "</body></html>"; |
|
$pdf = documentConverter::getPDFWithWKHTML($html,$_POST["size"] ?? "A4",$_POST["format"] ?? "portrait"); |
|
if (!empty($pdf)) { |
|
$error = false; |
|
header("Content-type: application/pdf"); |
|
header("Cache-Control: no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0"); |
|
header("Content-Disposition: inline; filename=export.pdf"); |
|
echo $pdf; |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
}
|