Support » Plugin: wp-mpdf » Switch Themes

  • Resolved petrusmaximus


    is there a possibility to switch the theme that is beeing used to create the PDF? For example as a parameter when calling mpdf_pdfbutton()?
    For example:
    <?php if(function_exists(‘mpdf_pdfbutton’)) mpdf_pdfbutton(false, ‘my link’, ‘my login text’, ‘MYTHEME’); ?>

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



    Yeah this feature is not available. And I currently have no resources to work on the plugin. But feel free to head over to and submit a pull request. I am more then happy to merge it and release a new version.


    Hello @petrusmaximus, @fkrauthan,

    I am looking to be able to change the specific theme that is used to create PDF?
    Did you find a solution ?

    Thank you !!

    Thread Starter petrusmaximus


    Yes I did, I check URL parameter and change the theme accordingly.
    In the file wp-mpdf/wp-mpdf.php I changed the following starting in line #457

    $templatePath = dirname( __FILE__ ) . ‘/themes/’;
    $templateFile = $templatePath . ‘default_de.php’;
    if ( isset( $_GET[‘lang’] ) && $_GET[‘lang’] == ‘en’ ) {
    $templateFile = $templatePath . ‘default_en.php’;

    In this case the default_de template is used by default, if I find lang=en in URL I change the template to default_en.

    Hope it helps you.


    Thank you very much for your answer, this one helped me a lot.
    I also used the same technique as yours.
    We lose the caching file, this is unfortunate.

    Thanks again

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Switch Themes’ is closed to new replies.