title: CGContext pdf page aspect fit
body: <p>I am displaying a pdf page on the CGContext using the code</p>
  
  <pre><code>- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context
  {
      CGContextSetRGBFillColor(ctx, 1.0, 1.0, 1.0, 1.0);
      CGContextFillRect(ctx, layer.bounds);
      CGContextTranslateCTM(ctx, 0.0, layer.bounds.size.height);
      CGContextScaleCTM(ctx, 1.0, -1.0);
      CGContextConcatCTM(ctx, CGPDFPageGetDrawingTransform(myPageRef, kCGPDFBleedBox, layer.bounds, 0, true));
      CGContextDrawPDFPage(ctx, myPageRef);
  }
  </code></pre>
  
  <p>The problem is that the pdf page is getting drawn on the center of the page leaving border on all four sides. Is there any way to make the page fit to screen. </p>