sburkecit
Novice

Re: Hide Print to PDF Button

Jump to solution

We're trying to hide the Print to PDF button.

Here's the first time I load it

first

and the next time I load it...

The ID for the PDF button is totally different when the form loads....

214b8e209a1b...  vs  5b9fa47899... 

0 Kudos
Reply
philipplucas
Scout

Re: Hide Print to PDF Button

Jump to solution

Hi Sean,

I can confirm this behaviour, the ID of the print to pdf button changes everytime.

However, as a workaround you can use this css:

.ms-cui-tabContainer ul li:nth-child(5){
visibility: hidden !important;
}

Where "5" is the number of the li-element containing your print to pdf button. Doesn't work on preview mode for me, but works after publishing.

Regards

Philipp

Reply
sburkecit
Novice

Re: Hide Print to PDF Button

Jump to solution

Sorry, but I found an issue with this...  it works when the form is in Edit mode but the Print PDF button still appears in View mode.  Weird.  Everything looks the same... 

0 Kudos
Reply
philipplucas
Scout

Re: Hide Print to PDF Button

Jump to solution

Let me have a look on this tomorrow, no access to my VM at the moment.

0 Kudos
Reply
philipplucas
Scout

Re: Hide Print to PDF Button

Jump to solution

Allright, it doesn't work on view mode because in view mode it is the 3rd child. To work around this we will need some JS/JQuery.

To find out in which mode your form is:  

Then you can use the CSS I provided for the new/edit mode and change the 5 to a 3 in the display mode section.

Reply
burnsmh
Novice

Re: Hide Print to PDF Button

Jump to solution

This works for me, but it also removes it from the back end when I use it in a Rich Text widget. I am using the responsive forms and I dont have direct access to the CSS or the formatting rules.

0 Kudos
Reply
shaneoss
Scout

Re: Hide Print to PDF Button

Jump to solution

Hi @burnsmh,

Try the following custom JS solution instead of CSS.

NWF$(document).ready(function(){
    var print2pdfid = document.querySelector('[id^="Nintex.Forms.Print.Ribbon.Print"]').parentNode.parentNode.id;
    var print2pdf = document.getElementById(print2pdfid.substring(0, print2pdfid.indexOf("-")));
    print2pdf.style.display = 'none';
});

 

Reply
duplo85
Novice

Re: Hide Print to PDF Button

Jump to solution

@shaneoss Works for me, thanks

Reply
suneelprakash7
Scholar

Re: Hide Print to PDF Button

Jump to solution

I tried to use the below code and it worked for me. But the problem is it will be hidden in both view and edit mode.

 

NWF$("#RibbonPrintToPDFButton").hide();

 

0 Kudos
Reply