Add CSS to the Technical document PDF #2
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We need to set font type and some css to the pdf. Maybe add a footer text too.
wich pdf? the one generated by omeka?
thant would just be a css calling
@media print {}
where is the css called from? is it a plugin generated in the server or is it the browser processing the html/web?
PDF generation happens here
https://git.hangar.org/arcHIVE-tech/arc-hive-TechDocument-omeka-module/src/branch/main/src/Site/BlockLayout/TechDocument.php#L89
It uses mPDF
https://mpdf.github.io/css-stylesheets/introduction.html#example-using-a-stylesheet
created branch fix/print-pdf to solve this issue and to keep print styles all together.
https://git.hangar.org/arcHIVE-tech/Arc-hive-omeka-theme/src/branch/fix/print-pdf-css
i was checking this issue, the PDF generation happens at:
so we have to do this https://mpdf.github.io/css-stylesheets/introduction.html#example-using-a-stylesheet
and parameters are explained here https://mpdf.github.io/reference/mpdf-functions/writehtml.html
so the result is
it is no working as spected, I can't find where to put the
print.css
fileHi,
I have commited here
eeaed03d7d
print.css works.
I was trying to understand where the
h1 {color: red}
it is applied but I can't.What I understand is that this module will use the
@media print {}
definition in the./modules/TechDocument/asset/css/print.css
defined by the module, but I can see that what is applying is thedefault.css
defined by the theme.Is it correct? is this one where I have to focus?
https://git.hangar.org/arcHIVE-tech/Arc-hive-omeka-theme/src/branch/develop/asset/css/default.css
I got lost in may thoughts... thanks for the help
My guess is that Mpdf does not use any css unless defined. We don't tell Mpdf about default.css, so it is never included. We do tell Mpdf about print.css, so it is the only only css included.
as @chris found out we need to check
https://git.hangar.org/arcHIVE-tech/arc-hive-TechDocument-omeka-module/src/branch/main/asset/css
I'll take this from here