Skip to main content
Nintex Community Menu Bar

Hide Print to PDF Button

  • September 2, 2016
  • 18 replies
  • 195 views

Forum|alt.badge.img+1

Hi there,

is there a way to hide the Print to PDF Button in the Ribbon?

18 replies

Forum|alt.badge.img+13
  • Novice
  • September 2, 2016

Forum|alt.badge.img+17
  • Nintex Partner
  • September 2, 2016

I apologize that I haven't checked myself yet, but I know in O365 there is a disable option in the form settings. Do you see that on prem?

190598_pastedImage_13.png


Forum|alt.badge.img+11
  • Nintex Partner
  • September 5, 2016

Unfortunately onPrem the enable/disable option is missing


Forum|alt.badge.img+13
  • Novice
  • September 5, 2016

The custom CSS link I gave you above will do the job here. You'll need to use the dev tools of your browser to identify the Print to PDF CSS class.


Forum|alt.badge.img+12
  • September 5, 2016

I  agree with Ryan, I'd just use some CSS or JS to hide  the button as needed.   With some additional logic you could make the PDF button hide and show as needed depending on variables as required.  


Forum|alt.badge.img+13
  • Novice
  • September 6, 2016

Hi ‌, if one of these posts gives you the correct answer, could you please mark it as such to help other members.


Forum|alt.badge.img+1
  • Author
  • September 6, 2016

Thanks all for the replies. My first tries didn't work in our Scenario but I will give it another a try and come back to this discussion with more Details.


Forum|alt.badge.img+1
  • November 28, 2016

The CSS solution doesn't work for us as I'm finding that the ID changes every time the form loads... 

1st -   Nintex.Forms.SharePoint.Ribbon.FillerGroup.ca3dacb75ac5462f9be8a6e58e19377f

2nd -  Nintex.Forms.SharePoint.Ribbon.FillerGroup.acd997ca69114adfadc1465498e9664a

Is anyone else having this issue?


Forum|alt.badge.img+11
  • Nintex Partner
  • December 1, 2016

Hi Sean,

I cannot confirm this issue. I tested it for the cancel button in preview and in published version, the id of the button always remains the same (even after re-publishing the form). Which control did you try to hide?


Forum|alt.badge.img+1
  • December 2, 2016

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


Forum|alt.badge.img+11
  • Nintex Partner
  • December 5, 2016

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


Forum|alt.badge.img+1
  • December 6, 2016

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


Forum|alt.badge.img+11
  • Nintex Partner
  • December 6, 2016

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


Forum|alt.badge.img+11
  • Nintex Partner
  • December 7, 2016

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.


Forum|alt.badge.img+2
  • December 12, 2018

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.


Forum|alt.badge.img+5
  • February 27, 2019

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';
});

 


Forum|alt.badge.img+2
  • May 8, 2019

@shaneoss Works for me, thanks


Forum|alt.badge.img+2

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();