|
From: | Eric Wasylishen |
Subject: | Re: printing, default printer |
Date: | Wed, 14 Dec 2011 13:44:47 -0700 |
Hi, The print dialog needs some work. However, last time I checked, it is possible to save a PDF with the "save" button - you just have to save to a filename ending in .pdf, and be using the cairo backend. Also, saving to a .ps file should produce a PostScript file with either the cairo or libart backend; not sure about other backends. Pressing "preview" saves a PostScript file and does the following with it (GSPrintOperation.m): /* Check to see if there is a GNUstep app that can preview PS files. It's not likely at this point, so also check for a standards previewer, like gv. */ NSTask *task; NSString *preview; NSWorkspace *ws = [NSWorkspace sharedWorkspace]; [[self printPanel] _setStatusStringValue: @"Opening in previewer..."]; preview = [ws getBestAppInRole: @"Viewer" forExtension: @"ps"]; if (preview) { [ws openFile: _path withApplication: preview]; } else { NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; preview = [def objectForKey: @"NSPreviewApp"]; if (preview == nil || [preview length] == 0) preview = @"gv"; NS_DURING { task = AUTORELEASE([NSTask new]); [task setLaunchPath: preview]; [task setArguments: [NSArray arrayWithObject: _path]]; [task launch]; } ... Once Julian's NSWorkspace patch is integrated we should be able to simplify that to just [ws openFile: _path]; and let NSWorkspace pick a non-GNUstep application if there is no GS pdf/ps viewer. -Eric On 2011-12-14, at 1:23 PM, Ivan Vučica wrote: OS X creates a PDF to produce a print preview, then opens it in Preview.app. What does GNUstep do? Is producing a PDF/PostScript viable? Is it a good idea? |
[Prev in Thread] | Current Thread | [Next in Thread] |