For Non Air print enabled printer Apple does not have any in built API.
I learned that we can add wifi module to a printer. So my question is if I add wifi module to a printer, will it be AirPrint enabled? If not can non AirPrint enabled printer be made as AirPrint enabled?
If I get a non AirPrint enabled printer is it possible to connect it from iPad? If yes what is the protocol I should use? Is there any open source library on this?
I found the below one: https://github.com/opentable/star-printing.
But from the documentation I could not understand is it only for air print enabled printer?
Below are the ways I can connect a desktop printer using iPad I guess.
Trying to answer all your questions:
If I add a wifi module, will my printer be AirPrint enabled?
Can a non-AirPrint printer be made into an AirPrint printer?
No. You need an AirPrint compatible printer, simply making it available over WiFi does not make it an AirPrint printer, and you cannot change the device to make it an AirPrint printer.
If not, can I still use it?
Yes. However, it will require that you directly open connection with the printer (via a socket) and send the data that way. It's really not too hard to do. There are likely some libraries available, but I haven't specifically tried. The code to open the port and send a data blob is pretty trivial, assuming you have the PCL data already.
Can I connect to a WiFi printer?
Yes, as described above.
Yes, but only on MFi (Made For iOS) printers.
Yes, via the built in print dialog.
This could probably be done the same way as the WiFi printing, but I haven't tried it yet.
Hope that helps, let me know if I can clarify anything.