mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-26 07:50:58 +00:00
Allow saving a print job as a PDF
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32559 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9369adb0b4
commit
6cf02e2b42
4 changed files with 30 additions and 7 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2011-03-13 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
|
* Source/NSPrintPanel.m:
|
||||||
|
* Printing/GSCUPS/GSCUPSPrintOperation.m:
|
||||||
|
* Printing/GSLPR/GSLPRPrintOperation.m: Allow saving a print
|
||||||
|
job as a PDF.
|
||||||
|
|
||||||
2011-03-13 Wolfgang Lux <wolfgang.lux@gmail.com>
|
2011-03-13 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
* Source/NSSpellChecker.m (-_findNext:, -_learn:, -_forget:,
|
* Source/NSSpellChecker.m (-_findNext:, -_learn:, -_forget:,
|
||||||
|
|
|
@ -118,8 +118,16 @@
|
||||||
[info setObject: _path
|
[info setObject: _path
|
||||||
forKey: @"NSOutputFile"];
|
forKey: @"NSOutputFile"];
|
||||||
|
|
||||||
|
if ([[[_path pathExtension] lowercaseString] isEqualToString: @"pdf"])
|
||||||
|
{
|
||||||
|
[info setObject: NSGraphicsContextPDFFormat
|
||||||
|
forKey: NSGraphicsContextRepresentationFormatAttributeName];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
[info setObject: NSGraphicsContextPSFormat
|
[info setObject: NSGraphicsContextPSFormat
|
||||||
forKey: NSGraphicsContextRepresentationFormatAttributeName];
|
forKey: NSGraphicsContextRepresentationFormatAttributeName];
|
||||||
|
}
|
||||||
|
|
||||||
_context = RETAIN([NSGraphicsContext graphicsContextWithAttributes: info]);
|
_context = RETAIN([NSGraphicsContext graphicsContextWithAttributes: info]);
|
||||||
|
|
||||||
|
|
|
@ -140,8 +140,16 @@
|
||||||
[info setObject: _path
|
[info setObject: _path
|
||||||
forKey: @"NSOutputFile"];
|
forKey: @"NSOutputFile"];
|
||||||
|
|
||||||
|
if ([[[_path pathExtension] lowercaseString] isEqualToString: @"pdf"])
|
||||||
|
{
|
||||||
|
[info setObject: NSGraphicsContextPDFFormat
|
||||||
|
forKey: NSGraphicsContextRepresentationFormatAttributeName];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
[info setObject: NSGraphicsContextPSFormat
|
[info setObject: NSGraphicsContextPSFormat
|
||||||
forKey: NSGraphicsContextRepresentationFormatAttributeName];
|
forKey: NSGraphicsContextRepresentationFormatAttributeName];
|
||||||
|
}
|
||||||
|
|
||||||
_context = RETAIN([NSGraphicsContext graphicsContextWithAttributes: info]);
|
_context = RETAIN([NSGraphicsContext graphicsContextWithAttributes: info]);
|
||||||
|
|
||||||
|
|
|
@ -254,7 +254,7 @@ static NSPrintPanel *shared_instance;
|
||||||
NSSavePanel *sp;
|
NSSavePanel *sp;
|
||||||
|
|
||||||
sp = [NSSavePanel savePanel];
|
sp = [NSSavePanel savePanel];
|
||||||
[sp setRequiredFileType: @"ps"];
|
[sp setAllowedFileTypes: [NSArray arrayWithObjects: @"pdf", @"ps", nil]];
|
||||||
result = [sp runModal];
|
result = [sp runModal];
|
||||||
if (result == NSOKButton)
|
if (result == NSOKButton)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue