Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! You can enable inline PHP scripting with the following line in your theme functions:

    define("DOMPDF_ENABLE_PHP", true);

    Hope that helps!

    Ewout

    Thread Starter nostalgicdodo

    (@nostalgicdodo)

    hey thanks a bunch.

    quick aside :
    how to set the font style?

    here’s what I’ve written,

    <script type="text/php">
    
    	if ( isset( $pdf ) ) {
    
    		$font = $fontMetrics->get_font( "verdana" , "bold" );
    		$page_width = $pdf->get_width();
    		$page_height = $pdf->get_height();
    		$pdf->page_text( $page_width - 69 , $page_height - 27 , "{PAGE_NUM} / {PAGE_COUNT}" , $font , 9 , array( 0 , 0 , 0 ) );
    
    	}
    
    </script>

    the line,
    $font = $fontMetrics->get_font( "verdana" , "bold" );
    doesn’t work. When I comment it out, it works.

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! Fonts are better set via CSS, you also need the upload the TTF. Check the documentation here: Using custom fonts

    Ewout

    Thread Starter nostalgicdodo

    (@nostalgicdodo)

    alright. I’ll try that approach.

    thanks very much.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘page numbers in the pdf’ is closed to new replies.