Convert pdf file to txt file

Is there a way to convert a pdf file in rust to a text file??

1 Like

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.

2 Likes

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

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.