It sounds like you might have some network places set up for windows to use but that are no longer reachable (or something along those lines) because that shouldn’t be taking so long so you might have things timing out in the background.
Or your internet is slow and it’s taking a long time to communicate with one drive or send its screenshots of your document to their creep department.
Or maybe a print driver that no longer exists still has an orphaned entry in the registry and it spends some time trying to locate it.
Or malware has set up hooks for any new window that pops up but the print to pdf dialog is set up in such a way that it churns very inefficiently on that window specifically.
I joke but any one of those might actually be what’s going on.
I had to spend an annoying amount of time finding all of the settings to make it so that my windows machine would never wake up on its own, spread out over an even longer period of time because some of them aren’t easy to trigger on my own so it was a matter of trying something and then trying more things if I find it awake on its own again.
Even disabling the wake on mouse movement was a pain because it doesn’t properly label mice and keyboards and doesn’t have a global setting. I wanted to keep wake on keyboard but not have it wake if my mouse moved a nm because a butterfly flapped its wings too vigorously as it flew by the closed window.
After I installed Linux, I went to do the same thing there only to find it already had sensible defaults set.