feat(pdf-generation): add custom MathJax CSS to PDF content

Integrates MathJax CSS directly into the PDF content to ensure consistent mathematical styling and formatting. This addresses visual discrepancies in PDF documents that include mathematical expressions.
This commit is contained in:
Kumi 2024-08-03 16:49:51 +02:00
parent e641e332d1
commit 9f6fdeb85e
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -821,7 +821,12 @@ function handle_pdf_download()
$pdf->setTextColor(0);
$pdf->Ln(10);
$pdf->SetFont('helvetica', '', 12);
$content = apply_filters('the_content', $post->post_content);
$mathjax_css = file_get_contents(get_template_directory() . '/assets/dist/css/mathjax.css');
$content = "<style>$mathjax_css</style>$content";
$pdf->writeHTML($content);
// Output PDF document