You can keep a separate reference to your Context such as:
CGContextRef ctx = CGPDFContextCreateWithURL((__bridge CFURLRef)(URL), &mediaBox, NULL);
self.ctx = ctx;
Then you can release the context that you've created by calling:
CFRelease (ctx);
So you're not releasing the one that the compiler believes that self owns.