UIViewのスクリーンショットを撮ってPDFを作成しています。これは現在、Retinaディスプレイを搭載したiPad3でうまく機能していますが、低解像度の画面を備えた他のデバイスでテストすると、テキストの解像度に問題があります。
これが私のコードです:
//start a new page with default size and info
//this can be changed later to include extra info.
UIGraphicsBeginPDFPage();
//render the view's layer into an image context
//the last option specifies scale. If 0, it uses the devices scale.
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 2.0);
CGContextRef context = UIGraphicsGetCurrentContext();
[view.layer renderInContext:context];
UIImage *screenShot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
//render the screenshot into the pdf page CGContext
[screenShot drawInRect:view.bounds];
//close the pdf context (saves the pdf to the NSData object)
UIGraphicsEndPDFContext();
UIGraphicsBeginImageContextWithOptions
また、スケールを2.0に設定しようとしましたが、変更はありません。iPad2のビューを2倍の解像度で強制的にレンダリングするにはどうすればよいですか?
期待される出力:
実際の出力: