log if document is printed

I have found a way to auto print thanks for everyone’s help.