In our Nintex application, we don't have "Print to PDF" action enabled due to which I'm following this approach to print the documents Print Button - Nintex Forms
This is working perfectly for us. However, I would like to know if there's a way to make the Print button disappear when the document is printed.
My idea would be to not use the window.print() function directly on client click but to use a custom function.
In that custom function you can first hide the button with css/jquery and then call the window.print() inside your custom function.
Could that be working for you?
I see two possibilities. Either you have a JS function like Philipp says and it will update a field on your list item to record that the print occurred. This can be done using CSOM code. This is a little challenging and examples are out there to do so. But this option is best because it will work on the form no matter the display mode.
user opens form in Display mode or any mode, you allow the button to be visible because a rule on the form knows that the "print" field ( a yesno field you add to the list to track this) on the list item and has no value. User clicks on the button, JS function updates the list item and sets a value to "print" field then does a window.print. User closes the form. Next time the form is opened, the form rules hide the button based on the value in the "print" field on the list item. Don't show this field on views for the user.
There are most likely other ways, but you will have to persist that someone did print so it can't be done the next time the form is opened.
you can give your button a custom css class like "no-print". Afterwards you go to your form settings -> "Custom CSS". There you will already find the following area, where you can simply add your new class to and it will look like this:
This will hide your button on the printed form.