Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Easier method to set TextEdit page margins (no code changes)' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Easier method to set TextEdit page margins (no code changes)
Authored by: pc_junk on Apr 30, '04 10:19:51PM

I had the same problem however found it easier to just save a blank RFT document and directly edit the raw RTF data to setup the margins. Once you have setup the margins TextEdit will use these when you open the document. You can also setup the template as a stationary pad to make creating new docs easier.

To edit the raw RFT data you need to use a text editor from the terminal (vi/pico).

The "default" blank document from TextEdit looks like this:

{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww12240\viewh14100\viewkind1\viewscale100
}

To set the margins just set \margl & \margw appropriately (1440 is 1") - to set the top/bottom margins you can also set \margt & \margb

My template for a document with 0.5" margins is:

{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl}
{\colortbl;\red255\green255\blue255;}
\margt720\margb720\margl720\margr720\vieww9920\viewh8000\viewkind0
}



[ Reply to This | # ]
Easier method to set TextEdit page margins (no code changes)
Authored by: tinb on May 01, '04 02:09:27AM
You don't need to use a text editor like vi or pico to edit rtf files this way. Just choose open from TextEdit and switch Ignore rich text commands on the open panel.

[ Reply to This | # ]
Easier method to set TextEdit page margins (no code changes)
Authored by: epkesdotcom on Jun 08, '04 05:40:59AM

Nice solution. But to further simplify this solution try this.

Open .RTF file in BBedit Lite (free) or similar raw text app.
* For .RTFD document CNTRL select file - SHOW PACKAGE CONTENTS... Then open .RTF in raw text editor.

On line 5 you will see this:
margl1440\margr1440\vieww9920\viewh8000\viewkind0

"marg" stands for margin and the l & r stands for left and right

Conversions: .25 = 360 .5 = 720 .75 = 1080 1" = 1440

Also t & b stands for top and bottom.

So if you change the fifth column to this...
\margt720\margb720\margl1080\margr1080\vieww9920\viewh8000\viewkind0

You will have margins Top: .5 Bottom: .5 Left: .75 Right: .75

The vieww and viewh open the document to the preferred dimensions.

Wouldn't it be amazing if something like this were actually a part of a text edit app? Hmm... Apple?

Hope this helps. - Epkes



[ Reply to This | # ]
Easier method to set TextEdit page margins (no code changes)
Authored by: epkesdotcom on Jun 08, '04 05:46:51AM

Actually tinb's comment:
"Just choose OPEN from TextEdit and switch Ignore rich text commands on the open panel" is probable better then using BBEdit. Much faster.



[ Reply to This | # ]
Easier method to set TextEdit page margins (no code changes)
Authored by: epkesdotcom on Jun 08, '04 05:53:28AM

Although tinb's idea doesn't apply to RTFD documents. You need to open its package contents in BBEdit or set Text Edit's prefs to "Ignore rich text commands" temporarily for editing and then turn them back on when done.



[ Reply to This | # ]
Easier method to set TextEdit page margins (no code changes)
Authored by: epkesdotcom on Jun 08, '04 05:56:10AM
I meant to say: So if you change the fifth ROW to this... \margt720\margb720\margl1080\margr1080\vieww9920\viewh8000\viewkind0

[ Reply to This | # ]