Convert pdf file to txt file

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.

1 Like

As a side note: i hope your PDFs are well formed: What's so hard about PDF text extraction? ​

1 Like