macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

setPaperSize:

用紙の幅と高さをセットします
-(void)setPaperSize:(NSSize)aSize:

解説

用紙の幅と高さをセットします(pointで)

返り値

( void )

なし

引数

( NSSize )aSize

サイズ

フレームワーク

ApplicationKit

クラス

NSPrintInfo

Instance Methods

使用可能

10.0

参照

- dictionary
- initWithDictionary:
- paperSize

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSPrintInfo *pInfo = [NSPrintInfo sharedPrintInfo] ;
NSPageLayout *pageLayout = [NSPageLayout pageLayout];

[pInfo setPaperSize:NSMakeSize(10.0,10.0)];

[pageLayout beginSheetWithPrintInfo:pInfo
            modalForWindow:[sender window] 
            delegate:self 
            didEndSelector:@selector(didEndPageLayout) 
            contextInfo:nil ];
            
            NSLog([NSString stringWithFormat:@"w=%.1f,h=%.1f",[pInfo paperSize].width,[pInfo paperSize].height]);
}
-(void)didEndPageLayout
{
NSLog(@"close");
}

@end