File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ def main():
7070 alerts_end_time = pre_processed_args ['alerts_end_time' ],
7171 custom_logo = custom_logo ,
7272 pagesize = 'a2' ,
73+ pdf = True ,
7374 )
7475
7576 except Exception as e :
@@ -101,8 +102,11 @@ def main():
101102 try :
102103 from weasyprint import HTML , CSS
103104 from weasyprint .text .fonts import FontConfiguration
105+ import logging as log
106+ weasyprint_log = log .getLogger ('weasyprint' )
107+ weasyprint_log .addHandler (log .FileHandler ('weasyprint.log' ))
104108 font_config = FontConfiguration ()
105- html = HTML (string = report )
109+ html = HTML (string = report , base_url = basedir )
106110 html .write_pdf (report_file_name , font_config = font_config )
107111 except Exception as e :
108112 logger .error (f'Failed writing report file { report_file_name } : { str (e )} ' )
Original file line number Diff line number Diff line change 2525 size : {{pagesize}} landscape;
2626 }
2727 {% endif %}
28+ img {visibility : visible !important ;}
2829 table {transform : scale (1 );}
2930 td , th {
3031 max-width : 150px ;
3334 p {break-inside : avoid ;}
3435 div {break-inside : avoid ;}
3536 .pagebreak { page-break-after : always ; clear : both ;}
36-
3737 }
3838
3939
102102 margin-top : 1.5rem ;
103103 }
104104
105+ .promographicpdf img {
106+ display : block ;
107+ margin : auto ;
108+ width : 90% ;
109+ }
110+
105111 .promographic {
106112 display : flex ;
107113 justify-content : center ;
403409 {{ summary_data | join(', ') }}
404410 </blockquote >
405411
412+ {% if pdf %}
413+ <div class =" promographicpdf" >
414+ {% if polygraph_graphic_html %}
415+ {{ polygraph_graphic_html | safe }}
416+ {% endif %}
417+ </div >
418+ {% else %}
406419 <div class =" promographic" >
407420 {% if polygraph_graphic_html %}
408421 {{ polygraph_graphic_html | safe }}
409422 {% endif %}
410423 </div >
411-
424+ {% endif %}
412425</div >
413426
414427<div class =" section-two" >
You can’t perform that action at this time.
0 commit comments