how can I get the print text content?

If a user print a document,how can I get the text content?