DjVu is efficient at compression, but sometimes the text becomes an image and non-selectable. Is there anyway to make sure that the text remains selectable? Which program should I use for this conversion?
DjVu files are normally image only. From these file sections can be selected as images but not as text¹.
If OCR was applied during, or after, the conversion to DjVu. Extra information is stored in the files that associate image areas with text. Only if that was done you can select text from such a file².
¹ e.g. using the djview program.
² In theory one could do OCR on the fly in the DjVu viewer, but I don't think any of the currently available viewers can do that.
You can also use ocrodjvu with a selected OCR engine, e.g. tesseract.