My application uses a quartz filter to convert images within a PDF document to black and white:
PDF Document *pdfDocument = [[PDFDocument alloc] initWithURL:[NSURL fileURLWithPath:@"/Users/dan/Desktop/test.pdf"]];
QuartzFilter *quartzFilter = [QuartzFilter quartzFilterWithURL:[[NSBundle mainBundle] URLForResource:@"Black & White" withExtension:@"qfilter"]];
NSDictionary *options = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:quartzFilter, nil] forKeys:[NSArray arrayWithObjects:@"QuartzFilter", nil]];
[pdfDocument writeToFile:@"/Users/dan/Desktop/testResault.pdf" withOptions:options];
Unfortunately writing the file to disk with the filter applied results in many memory leaks as you can see here:
Is this a bug within the Quartz Framework or am I doing something wrong in the code above?
If you want you can download my test project here: http://www.file-upload.net/download-7293644/PDF---Quartz-Memory-Leak.zip.html
I am using ARC.