ChaoYue0307 / pdf_to_text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PDF to Text Converter

A Python script that can be used to convert PDF files to text files. The script uses the PyPDF2 library to extract text from the PDF file and write it to a text file with the same name.

Requirements

  • Python 3.x
  • PyPDF2 library: Install it:
pip install PyPDF2

Usage

1.Put the pdf_to_text.py file in the same directory as your PDF file that you want to convert.

2.Open the Command Line Interface (CLI) and navigate to the directory where the script and the PDF file are located.

3.Run the script, passing the name of the PDF file as an argument:

python pdf_to_text.py example.pdf

4.The script will create a text file with the same name as the PDF file in the same directory. In this example, the script will create a file named example.txt.

Note: Replace example.pdf with the name of your PDF file.

About


Languages

Language:Python 100.0%