Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I was having the same problem and the answer before did help me in some parts but it didn't solve the whole problem.</p> <p>This is the how I solved my problem.</p> <pre><code>- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context { NSLog(@"pdfQuartzViewViewController - drawLayer"); CGPDFDocumentRef myDocumentRef = CGPDFDocumentCreateWithURL((CFURLRef)[NSURL fileURLWithPath:self.strFilename]); CGPDFPageRef pageReference = CGPDFDocumentGetPage(myDocumentRef, 1); CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 1.0f); // White CGContextFillRect(context, CGContextGetClipBoundingBox(context)); // Fill CGContextTranslateCTM(context, 0.0f, layer.bounds.size.height); // Scaling the pdf page a little big bigger than the view so we can cover the white borders on the page CGContextScaleCTM(context, 1.0015f, -1.0015f); CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(pageReference, kCGPDFCropBox, layer.bounds, 0, true); pdfTransform.tx = pdfTransform.tx - 0.25f; pdfTransform.ty = pdfTransform.ty - 0.40f; CGContextConcatCTM(context, pdfTransform); CGContextDrawPDFPage(context, pageReference); // Render the PDF page into the context CGPDFDocumentRelease(myDocumentRef); myDocumentRef = NULL; } </code></pre> <p>Here there is a good link where you can find more information about it. The post explains how to use all this methods.</p> <p><a href="http://iphonedevelopment.blogspot.ch/2008/10/demystifying-cgaffinetransform.html" rel="nofollow">http://iphonedevelopment.blogspot.ch/2008/10/demystifying-cgaffinetransform.html</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload