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


??? | 15 comments | Create New Account
Click here to return to the '???' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
???
Authored by: jiclark on Apr 30, '04 05:44:42PM

Man I hate hints like this that assume a level of knowledge that's just not there in the vast majority of us!!! ;-}

I tried this, but it didn't seem to work. I could only find one set of references to the '72's in the huge amount of text that shows up in Xcode; I changed those to 36, but it still prints with one inch margins.

Any help?



[ Reply to This | # ]
More Details
Authored by: mundie1010 on Apr 30, '04 06:08:23PM

I'm sorry if my original post wasn't clear. Although there are 1,800+ lines of code in Document.m, there are only 6 occurrences of "72" - and the two having to do with tabs aren't relevant. The lines of interest start at line 487:

- (NSPrintInfo *)printInfo {
    if (printInfo == nil) {
        [self setPrintInfo:[NSPrintInfo sharedPrintInfo]];
        [printInfo setHorizontalPagination:NSFitPagination];
        [printInfo setHorizontallyCentered:NO];
        [printInfo setVerticallyCentered:NO];
        [printInfo setLeftMargin:72.0];
        [printInfo setRightMargin:72.0];
        [printInfo setTopMargin:72.0];
        [printInfo setBottomMargin:72.0];
    }
    return printInfo;
}

Change those 72 (pixel) values to whatever you want and rebuild.

By the way, I've discovered that once a document is saved with modified margins, even the official version of TextEdit will open it with those same margins, so you needn't always use the modified version - only when you want to create new templates.



[ Reply to This | # ]
More Details
Authored by: baturjan on Nov 14, '05 08:41:06AM

Thanks for this tip. I know nothing about Xcode, though I have it (1.5) installed. I'm running 10.3.9.

I copied the Document.m file to my desktop to keep a copy of the original.
Then I double clicked on the original Document.m file, which launched Xcode. I replaced the 72 numbers you mentioned with 42.

Then you said to "rebuild". Here's the ignorant, newbie question, how do I rebuild? I tried reading the Xcode help files to no avail.



[ Reply to This | # ]
Further explanation
Authored by: simsamsep on Apr 30, '04 06:24:55PM

When you follow the instructions, a new Text Edit is created in a (also newly created) 'Build' folder in the /Developer -> Examples -> Appkit -> TextEdit folder. If you use that newly built Text Edit, the margins will be as changed in the Document.m file. I changed the 72 values to 57 in order to get my preferred 20mm margins. If you use another language than English, you can copy the .lproj from the original Text Edit to the newly created one. (When you open the application package, inside Text Edit/Contents/Resources/)



[ Reply to This | # ]