initWithDictionary:
プリント情報辞書で、プリント情報を初期化して返します
-(id)initWithDictionary:(NSDictionary *)aDictionary:
解説
プリント情報辞書で、プリント情報を初期化して返します。
返り値
( id )
印刷情報(NSPrintInfo)
引数
( NSDictionary * )aDictionary
属性辞書
フレームワーク
ApplicationKit
クラス
NSPrintInfo
Instance Methods
使用可能
10.0
参照
- dictionary
例文
#import "Controller.h" @implementation Controller - (IBAction)pushButton:(id)sender { NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:90],@"NSBottomMargin", [NSNumber numberWithInt:1],@"NSCopies", [NSNumber numberWithInt:1],@"NSFirstPage", [NSNumber numberWithInt:2],@"NSHorizonalPagination", [NSNumber numberWithInt:1],@"NSHorizontallyCentered", @"NSPrintSpoolJob",@"NSJobDisposition", [NSNumber numberWithInt:2147483647],@"NSLastPage", [NSNumber numberWithInt:71],@"NSLeftMargin", [NSNumber numberWithInt:1],@"NSMustCollate", [NSNumber numberWithInt:0],@"NSOrientation", @"A4",@"NSPaperName", [NSValue valueWithSize:NSMakeSize(1000,1000)],@"NSPaperSize", [NSNumber numberWithInt:1],@"NSPrintAllPages", [NSNumber numberWithInt:72],@"NSRightMargin", @"",@"NSSavePath", [NSNumber numberWithInt:1],@"NSScalingFactor", [NSNumber numberWithInt:90],@"NSTopMargin", [NSNumber numberWithInt:0],@"NSVerticalPagination", [NSNumber numberWithInt:1],@"NSVerticallyCentered", nil]; NSPrinter *prn = [NSPrinter printerWithName:@"MICROLINE 3050c"]; NSPrintInfo *pInfo =[[NSPrintInfo alloc] initWithDictionary:dic]; [pInfo setPrinter:prn]; NSLog([NSString stringWithFormat:@"%@",[[pInfo dictionary] description]]); } @end