22 lines
672 B
PHP
22 lines
672 B
PHP
<?php
|
|
ob_clean();
|
|
$content = $api->getLabel($_GET['label']);
|
|
if ($api->lastError) {
|
|
null;
|
|
} else {
|
|
if (is_array($_GET['label'])) {
|
|
$name = "polkurier_" . time() . ".pdf";
|
|
} else {
|
|
$name = "polkurier_" . $_GET['label'] . ".pdf";
|
|
}
|
|
header('Content-Type: application/pdf');
|
|
header('Content-Length: ' . strlen($content));
|
|
header('Content-disposition: inline; filename="' . $name . '"');
|
|
header('Cache-Control: public, must-revalidate, max-age=0');
|
|
header('Pragma: public');
|
|
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
|
|
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
|
echo $content;
|
|
}
|
|
exit();
|