diary-print-entries-hook is a variable defined in `diary-lib.el'.
Its value is

  • This variable may be risky if used as a file-local variable.

Run by `diary-print-entries' after preparing a temporary diary buffer.
The buffer shows only the diary entries currently visible in the
diary buffer. The default just does the printing. Other uses
might include, for example, rearranging the lines into order by
day and time, saving the buffer instead of deleting it, or
changing the function used to do the printing.

You can customize this variable.