Custom margins in TextEdit

There is already an old hint about this topic, but it doesn’t really explain it very clearly, only in the comments.

Here’s how you can change the margins in TextEdit to your favourite size, so that you can use, for example, the whole space on a sheet of paper when printing.

First, save your document first as a Rich Text file (.rtf), if you have not already done this. To see the effect directly in your document, open it and enable under the Format menu the setting Wrap to Page for your document.

Next open up the TextEdit preferences, switch to the tab Open and Save and check on the option Display RTF files as RTF code instead of formatted text.

Open the document again and you will see the raw code that defines how the document look like. You want to look in the 4th row, where it says:
margl1440margr1440

This define …

Source: Mac OSX Hints