Compare commits

..

2 commits

Author SHA1 Message Date
isUnknown
3d386f4c66 Add --print-background flag to pagedjs-cli URL generation
All checks were successful
Deploy / deploy (push) Successful in 10s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 09:12:57 +01:00
isUnknown
3ade5bca9e Add filename param support with Content-Disposition header
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 08:41:40 +01:00
2 changed files with 3 additions and 0 deletions

View file

@ -60,7 +60,9 @@ class GenerateController
}
// Retourner le PDF
$filename = !empty($data['filename']) ? basename($data['filename']) : 'document.pdf';
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="' . $filename . '"');
header('Content-Length: ' . strlen($pdf));
echo $pdf;

View file

@ -56,6 +56,7 @@ class PdfGenerator
$cmd .= escapeshellcmd($this->config['pagedjs_bin']);
$cmd .= ' ' . escapeshellarg($url);
$cmd .= ' -o ' . escapeshellarg($pdfFile);
$cmd .= ' --print-background';
if (!empty($options['timeout'])) {
$cmd .= ' --timeout ' . (int)$options['timeout'];