Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!news.cs.indiana.edu!msi.umn.edu!noc.MR.NET!gacvx2.gac.edu!gacvx2.gac.edu!scott Newsgroups: comp.sys.next Subject: Re: Scale view to fit widthwise on printed page Message-ID: From: scott@erick.gac.edu (Scott Hess) Date: 6 May 91 14:01:08 References: <501@nwnexus.WA.COM> Organization: Gustavus Adolphus College Nntp-Posting-Host: erick.gac.edu In-reply-to: adonis1@nwnexus.WA.COM's message of 4 May 91 03:30:07 GMTLines: 36 In article <501@nwnexus.WA.COM> adonis1@nwnexus.WA.COM (Adonis Corporation ) writes: Anyone know: How does one scale a view so that it will fit width-wise on a printed page? Using printPSCode, if my View object is too wide it gets clipped off on the right. This is a fun one! What you want to do is adjust the pagination in the application's printinfo. Here's what I do in the printing section of Stuart: PrintInfo *pi=[NXApp printInfo]; ... [pi setHorizPagination:NX_FITPAGINATION]; [pi setVertPagination:NX_AUTOPAGINATION]; [pi setHorizCentered:YES]; [pi setVertCentered:NO]; NX_FITPAGINATION tells it to scale the image as needed to fit. This will only occur if the image is larger than the page. NX_AUTOPAGINATION tells is to split into pages (that's the default, I think). I center it horizontally, in case it's not wide enough to invoke the scaling. I don't center vertically, so it will go to the top of the page if it's too short for the page. I implemented this as part of the printPSCode: method that's to do the printing. Basically, you could do all this stuff followed by 'return [super printPSCode:sender];', I believe. Later, -- scott hess scott@gac.edu Independent NeXT Developer GAC Undergrad