• Resolved kotam8211

    (@kotam8211)


    I am implementing a PDF with wp-mpdf plugin.
    It has almost been made, but these two issues still remain. I would like to ask how to solve them.

    1) Font
    I would like to use a specific font. I have it as ttf.
    However, it does not work even I put it on /wp-content/plugins/wp-mpdf/mpdf/ttfonts/ folder.

    2) Page size
    The page size is A4 by default, but I would like to customize it.
    How can I do that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author fkrauthan

    (@fkrauthan)

    Unfortunately changing the font is not officially supported. You can try dropping the TTF file in that folder and then setting the font-family in your css but this is not official supported.

    Also the page size can not be modified. If you really want to you can take a look in the wp-mpdf.php line 184. But please note should I ever publish another update for this plugin your change would be overwritten.

    Hello @kotam8211 @fkrauthan
    we found a solution in order to change the font in the pdf.

    Here the example for us (SpaceGrotesk.ttf)

    1. After putting font in ttf folder I called this font in config_fonts.php

    plugins\wp-mdf\mpdf\config_fonts.php

    “spacegrotesk” => array(
    ‘R’ => “SpaceGrotesk.ttf”,
    ‘useOTL’ => 0xFF,
    ‘useKashida’ => 75,
    )

    2. then simply call font family in the css.

    On the Page size we didnt work. So we cant help with that so far.
    Our current challenge is now we can use the plugin in order to generate multiple PDFs with different templates. Maybe you have an idea there.

    • This reply was modified 4 years, 10 months ago by umikhan.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Font and page size’ is closed to new replies.