macOS/iOS API解説

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

目次

imageRectForPaper:

指定した用紙での印刷可能範囲をポイントで返します
-(NSRect)imageRectForPaper:(NSString *)paperName:

解説

指定した用紙での印刷可能範囲をポイントで返します。印刷可能範囲はPPDファイルで設定されています。

返り値

( NSRect )

範囲

引数

( NSString * )paperName

用紙名

フレームワーク

ApplicationKit

クラス

NSPrinter

Instance Methods

使用可能

10.0

参照

- pageSizeForPaper:

例文

#import "Controller.h"

@implementation Controller

- (IBAction)pushButton:(id)sender
{
NSRect rect =[[NSPrintInfo defaultPrinter] imageRectForPaper:@"A4"];
NSLog([NSString stringWithFormat:@"x=%.1f,y=%.1f,w=%.1f,h=%.1f",rect.origin.x,rect.origin.y,rect.size.width,rect.size.height]);

}

@end