-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
header and footer aren't visible #9
Comments
Ok it seems I needed bigger margins and to explicitly set a font size. Might be worth putting that in the readme file?
|
The problem is that page styles are not visible inside header and footer templates. This is a limitation of Chromium. Therefore, without setting any styles inside the templates, a default font size is being used which can be very small. Will update the documentation accordingly. |
im also using same liberary on codeigniter when im parsing the url the fucntion get the content for the url but its stills return null |
I'm using the code below and it's generating the pdf file with the margins. However it's not displaying any header or footer. Neither my custom or chrome's standard. I even tried removing the headerTemplate option and nothing. Is there a bug or am I doing something wrong? I'm using the latest version.
$input = new StringInput(); $input->setHtml($html); $converter = new Converter($input, new StringOutput()); $converter->setOptions([ 'landscape' => false, 'printBackground' => true, 'displayHeaderFooter' => true, 'headerTemplate' => '<p>I am a header</p>', 'margin' => ['top' => '5px', 'bottom' => '5px', 'left' => '5px', 'right' => '5px'] ]); $output = $converter->convert(); $binary = $output->get(); if ($binary) { $this->getLogger()->logUserActivity('result_download'); $filename = 'result.pdf'; return new Response($binary, 200, [ 'Content-Type' => 'application/pdf', 'Content-Disposition' => 'attachment; filename="' . $filename . '"' ]); }
The text was updated successfully, but these errors were encountered: