• Resolved petrusmaximus

    (@petrusmaximus)


    Hello,
    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

    (@fkrauthan)

    Hey,

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

    Thanks,
    Florian

    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 !!
    Cedric

    Thread Starter petrusmaximus

    (@petrusmaximus)

    @edgar33
    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.

    Peter.

    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
    Cedric

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