Using PYPDF2 to Convert all PDFs in input directory while preserving the input directory tree structure in the output directory.
If using executable:
PDFtoTXT.exe [OPTIONS] [INPUT_DIRECTORY] [OUTPUT_DIRECTORY]
If using the script:
python3 pdf2txt.py [OPTIONS] [INPUT_DIRECTORY] [OUTPUT_DIRECTORY]
-
-i, --input INPUT_DIRECTORY- Specify the input directory containing PDF files.
- If not provided, the first positional argument will be used as the input directory.
-
-o, --output OUTPUT_DIRECTORY- Specify the output directory for TXT files.
- If not provided, the second positional argument will be used as the output directory.
-
-g, --gui- Use GUI mode for directory selection.
- If no directories are provided, the script will default to GUI mode.
-
Using named arguments:
PDFtoTXT.exe -i "C:\Input PDFs" -o "D:\Output" PDFtoTXT.exe --input "C:\Input PDFs" --output "D:\Output" -
Using positional arguments:
PDFtoTXT.exe "C:\Input PDFs" "D:\Output" -
Mixed style:
PDFtoTXT.exe "C:\Input PDFs" -o "D:\Output" -
Using GUI mode:
PDFtoTXT.exe PDFtoTXT.exe --gui
-
Positional Arguments:
INPUT_DIRECTORY: The directory containing PDF files to be converted. If not provided as a named argument (-ior--input), it should be the first positional argument.OUTPUT_DIRECTORY: The directory where the converted TXT files will be saved. If not provided as a named argument (-oor--output), it should be the second positional argument.
-
Named Arguments:
-i, --input: Use this option to specify the input directory explicitly.-o, --output: Use this option to specify the output directory explicitly.-g, --gui: Use this option to enable GUI mode for directory selection.
- If both positional and named arguments are provided, the named arguments will take precedence.
- If no arguments are provided, the script will default to GUI mode for directory selection.
- If all arguments are provided, -g, path selecter form will launch and -i and -o inputs will be ignored.