开发者

Generating PDF: low resolution (How to make it higher res?)

开发者 https://www.devze.com 2023-03-16 06:49 出处:网络
I am generating a PDF in the following manner (code snippet): UIView *displayView = self.view; //displayView.contentScaleFactor = 3.0;

I am generating a PDF in the following manner (code snippet):

UIView *displayView = self.view;
//displayView.contentScaleFactor = 3.0;
CGRect pageRect = displayView.bounds;
if (UIGraphicsBeginPDFContextToFile(path, pageRect, [self pdfContextDictionary]) == NO) {
  return nil; // error
}

UIGraphicsBeginPDFPage();
CGContextRef context = UIGraphicsGetCurrentContext();
CALayer *layer = displayView.layer;
//layer.contentsScale = 3.0;
[layer renderInContext:context];
UIGraphicsEndPDFContext();  

both of the commented out lines were two differen开发者_高级运维t attempts to get the view to render at a higher resolution. i've seen others comment about making the view much larger, which will be my next step unless anyone knows any magic incantation to force the renderInContext: to generate a higher res output.

0

精彩评论

暂无评论...
验证码 换一张
取 消