mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 11:10:59 +00:00
* Source/GSPDFPrintOperation.m: Update -_print and -deliverResult
to match GSEPSPrintOperation to get the class to at least partly working. Output is appearing up-side-down for me though. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@36203 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
dfbf8d0c39
commit
aa261766b1
2 changed files with 30 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2013-02-28 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
|
* Source/GSPDFPrintOperation.m: Update -_print and -deliverResult
|
||||||
|
to match GSEPSPrintOperation to get the class to at least partly
|
||||||
|
working. Output is appearing up-side-down for me though.
|
||||||
|
|
||||||
2013-02-23 Fred Kiefer <FredKiefer@gmx.de>
|
2013-02-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/NSindow.m (-setDelegate:): Don't unregister delegate
|
* Source/NSindow.m (-setDelegate:): Don't unregister delegate
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#import <Foundation/NSPathUtilities.h>
|
#import <Foundation/NSPathUtilities.h>
|
||||||
#import <Foundation/NSTask.h>
|
#import <Foundation/NSTask.h>
|
||||||
#import <Foundation/NSProcessInfo.h>
|
#import <Foundation/NSProcessInfo.h>
|
||||||
|
#import <Foundation/NSValue.h>
|
||||||
#import "AppKit/NSPrintInfo.h"
|
#import "AppKit/NSPrintInfo.h"
|
||||||
#import "AppKit/NSView.h"
|
#import "AppKit/NSView.h"
|
||||||
#import "GNUstepGUI/GSPDFPrintOperation.h"
|
#import "GNUstepGUI/GSPDFPrintOperation.h"
|
||||||
|
@ -102,6 +103,8 @@
|
||||||
|
|
||||||
info = [[self printInfo] dictionary];
|
info = [[self printInfo] dictionary];
|
||||||
|
|
||||||
|
// TODO: Instead we should support NSGraphicsContext writing to an
|
||||||
|
// NSMutableData directly.
|
||||||
[info setObject: _path
|
[info setObject: _path
|
||||||
forKey: @"NSOutputFile"];
|
forKey: @"NSOutputFile"];
|
||||||
|
|
||||||
|
@ -114,14 +117,31 @@
|
||||||
|
|
||||||
- (void) _print
|
- (void) _print
|
||||||
{
|
{
|
||||||
|
// TODO: Copied-and-pasted from GSEPSPrintOperation. Factor out.
|
||||||
|
|
||||||
|
/* Save this for the view to look at. Seems like there should
|
||||||
|
be a better way to pass it to beginDocument */
|
||||||
|
[[[self printInfo] dictionary] setObject: [NSValue valueWithRect: _rect]
|
||||||
|
forKey: @"NSPrintSheetBounds"];
|
||||||
|
|
||||||
|
[_view beginDocument];
|
||||||
|
[_view beginPageInRect: _rect
|
||||||
|
atPlacement: NSMakePoint(0,0)];
|
||||||
|
|
||||||
[_view displayRectIgnoringOpacity: _rect inContext: [self context]];
|
[_view displayRectIgnoringOpacity: _rect inContext: [self context]];
|
||||||
|
|
||||||
|
[_view endPage];
|
||||||
|
[_view endDocument];
|
||||||
|
|
||||||
|
// FIXME: Output comes out up-side-down
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)deliverResult
|
- (BOOL)deliverResult
|
||||||
{
|
{
|
||||||
if (_data != nil && _path != nil && [_data length])
|
if (_data != nil && _path != nil)
|
||||||
return [_data writeToFile: _path atomically: NO];
|
{
|
||||||
// FIXME Until we can create PDF we shoud convert the file with GhostScript
|
[_data setData: [NSData dataWithContentsOfFile: _path]];
|
||||||
|
}
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue