Yes, it could be done, and you don't need a driverkit here.
You could find the code example here: https://sourceforge.net/p/pdfwriterformac/code/HEAD/tree/
This project does exeactly what you need, it's written in C and uses CUPS API.
Worth to mention, it is not running like a background service itself, it is instead creates some settings and binary which is used by cupsd system daemon, but this is how it works on macos.
I also think it is possible with some efforts to do the same with Swift, since you added the relevant tag to the question.