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:
parent
e641e332d1
commit
9f6fdeb85e
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue