How do I find out what program ranger is using to preview a file?
Yes, ranger uses
pdftotext to preview PDFs by default, but the answer to your title question is:
~/.config/ranger/scope.sh dictates how files are previewed.
According to the webpage, it uses
pdftotext for pdf previews. (You could read the source code to be certain).