I am rendering a plot with many data points into a CALayer that is hosted by an NSView. All drawing operations done within drawInContext: of the CALayer are vector operations (CGPaths etc.).
Now I would like to export this as a PDF file. Using CGPDFContextCreateWithURL(), a PDF file is created, but it essentially just contains a screenshot of my plot, meaning a bitmap image of the the contents of the view.
But what I want is vector-based PDF. I know that CALayers render their content offscreen into a bitmap which is then shown on screen, but why is it not possible to render the very same content as a vector graphics instead?
Is there really no built-in way to achieve this? I must not be the only one needing this.