gedit allows you to print both to a file and to paper.
Please also consult thefor more general information.
To open the Print dialog, either:
Click on Menu Button ▸ Print icon.
Or press Ctrl+P.
Prior to printing your document, you can preview how the printed document will look by using Print Preview. To preview the document:
From the Print dialog, click on the Preview button.
Text Editor Settings Tab
Inside the Print dialog, there is the Text Editor tab to configure how the text is printed.
From there, you can choose whether to print line numbers, configure text wrapping, configure the fonts, whether there are page headers, and more.