feat(pdf): improve PDF title rendering and margins
Adjusted PDF title rendering to use HTML for better styling. Set top margin to 50 units for improved layout consistency. This improves the visual presentation of PDF titles, adhering more closely to typographical standards.
This commit is contained in:
parent
77949dd0c1
commit
934db5dcc4
1 changed files with 2 additions and 1 deletions
|
@ -791,13 +791,14 @@ function handle_pdf_download()
|
|||
$pdf->SetAuthor(get_bloginfo('name'));
|
||||
$pdf->SetTitle($post->post_title);
|
||||
$pdf->SetSubject('Scientific Paper');
|
||||
$pdf->SetMargins(PDF_MARGIN_LEFT, 50, PDF_MARGIN_RIGHT);
|
||||
|
||||
// Add a page
|
||||
$pdf->AddPage();
|
||||
|
||||
// Set title
|
||||
$pdf->SetFont('helvetica', 'B', 20);
|
||||
$pdf->Cell(0, 10, $post->post_title, 0, 1, 'C');
|
||||
$pdf->writeHTML('<h1>' . $post->post_title . '</h1>', true, false, false, false, 'C');
|
||||
|
||||
// Set authors
|
||||
$pdf->SetFont('helvetica', '', 12);
|
||||
|
|
Loading…
Reference in a new issue