Is there a way to convert a pdf file in rust to a text file??
The pdf_extract crate is one possibility.
pdftotext is another. This one uses Poppler, a widely-used C++ library, so it may require installing extra libraries or tools, but it might also have more mature support for a wide range of PDF files.
Note that not all PDF files can be converted to text reliably, since PDF is a very flexible format that is designed for printed output, not machine processing.
As a side note: i hope your PDFs are well formed: What's so hard about PDF text extraction?