Forums

wp-mpdf
[resolved] Hide Toolbars and Force Print Dialog (3 posts)

  1. alidaonline
    Member
    Posted 1 year ago #

    Hi there

    I've installed this plugin and it works great although I would like to have a situation where a user clicks on the link to print to PDF and when the new tab opens the print dialog is automatically opened.

    I know you can't close the tab once the print dialog is closed but I would like to hide the toolbar so that users can't save the PDF.

    Could you point me in the right direction?

  2. fkrauthan
    Member
    Posted 1 year ago #

    There is no option. And there is always a way to save the pdf file. So if you would only a print of your pdf you should use another plugin. wp-print for exmaple.

  3. alidaonline
    Member
    Posted 1 year ago #

    I found a way to remove the toolbar by adding the following code to the config.php file in the mpdf folder:

    $this->SetDisplayPreferences('/HideMenubar/HideToolbar/DisplayDocTitle');

    I know that the user can still click on File - Save As but the intention is just to discourage the average user from saving the file.

    I've found some code here http://www.fpdf.org/en/script/script36.php that just needed a modification to refer to the mpdf class which automatically opens the print dialog.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags