I recall a notice at Dartmouth’s Baker Library on the way out of the stacks, a reproduction of a sign from the University of Salamanca threatening people with excommunication if they steal or damage the books in any way. This is what came up on an image search; it looks familiar to me:
And now, courtesy my colleague Curt Lindquist, an Atlas Obscura article on the bad things that monks would promise to those who messed with their book production:
In the Middle Ages, creating a book could take years. A scribe would bend over his copy table, illuminated only by natural light—candles were too big a risk to the books—and spend hours each day forming letters, by hand, careful never to make an error. To be a copyist, wrote one scribe, was painful: “It extinguishes the light from the eyes, it bends the back, it crushes the viscera and the ribs, it brings forth pain to the kidneys, and weariness to the whole body.”
Given the extreme effort that went into creating books, scribes and book owners had a real incentive to protect their work. They used the only power they had: words. At the beginning or the end of books, scribes and book owners would write dramatic curses threatening thieves with pain and suffering if they were to steal or damage these treasures.
They did not hesitate to use the worst punishments they knew—excommunication from the church and horrible, painful death. Steal a book, and you might be cleft by a demon sword, forced to sacrifice your hands, have your eyes gouged out, or end in the “fires of hell and brimstone.”
“These curses were the only things that protected the books,” says Marc Drogin, author of Anathema! Medieval Scribes and the History of Book Curses. “Luckily, it was in a time where people believed in them. If you ripped out a page, you were going to die in agony. You didn’t want to take the chance.”
More at the link.
On a similar (if slightly less apocalyptic) level, a friend of mine once printed up a number of bookplates reading “The wicked borroweth, and returneth not again” (Psalm 37.21) for placement in the prayer books of the church that he was priest of.