IIRC the vertical 0 value was set to the bottom in the PDF standard way back when. I know that with DynaPDF you can flip the orientation but I don’t have it in front of me to see what it is. I’d imagine Swift has something similar.
it wasn’t a matter of flipping the PDF context, that I’ve done
it was a matter of flipping the coor of my cliprect to properly match the PDF page
// solution
public func clip(to:CGRect) {
var r : CGRect = to
r = CGRect(x:r.minX,y:flipY(r.minY),width:r.width,height: -r.height)
r.origin.y -= margin.y
zContext!.clip(to:r)
}