Search code examples
objective-ciospdfquartz-2d

How can I create a PDF with a higher dpi on iOS?


I'm creating a PDF, to be used as a mail attachment, inside my app. Which works fine, but I have no idea how to create anything but a 72dpi PDF.

I start like this

CGRect mediaBox = CGRectMake(0, 0, 595, 842);
CGContextRef context = CGPDFContextCreateWithURL([NSURL fileURLWithPath:path], &mediaBox, NULL);

Do all my Quartz drawing inside the context, all works well, but by increasing the mediabox I can only change the size of the page.
I'm sure I'm overlooking something obvious, but I can't find where to specify the dpi?


Solution

  • Xcode was not replacing image files on my device, so old (low res) files were still begin used, removing the app from the device completely, and doing a clean build, fixed my problems.