euske / pdfminer

Python PDF Parser (Not actively maintained). Check out pdfminer.six.
https://github.com/pdfminer/pdfminer.six
MIT License
5.26k stars 1.13k forks source link

pdf2txt error in command line cannot match the files argument #252

Open udaykapur opened 5 years ago

udaykapur commented 5 years ago

164 This issue still remains unresolved on Win10 - python 3.7.1

Has someone found a solution yet?

noopur2805 commented 5 years ago

Try replacing file() function with open() and write output file in bytes with 'wb'.

AyeshaSarwar commented 4 years ago

Hi I ran into the same problem. Can you help me telling how did you resolve this issue. Reference https://github.com/euske/pdfminer/issues/164
Thanks

AyeshaSarwar commented 4 years ago

it always says required argument files I am using this syntax pdf2txt.py "D:\test.pdf" also tried pdf2txt.py -c utf-8 "D:\test.pdf"

AyeshaSarwar commented 4 years ago

python 3.8.1 windows10

noopur2805 commented 4 years ago

it always says required argument files I am using this syntax pdf2txt.py "D:\test.pdf" also tried pdf2txt.py -c utf-8 "D:\test.pdf"

Getting error even after the above mentioned changes?

AyeshaSarwar commented 4 years ago

Yes, it runs from administrative power shell but not from command prompt on windows

AyeshaSarwar commented 4 years ago

C:\Users\Ayesha>pdf2txt.py D:/test.pdf usage: pdf2txt.py [-h] [--debug] [--disable-caching] [--page-numbers PAGE_NUMBERS [PAGE_NUMBERS ...]] [--pagenos PAGENOS] [--maxpages MAXPAGES] [--password PASSWORD] [--rotation ROTATION] [--no-laparams] [--detect-vertical] [--char-margin CHAR_MARGIN] [--word-margin WORD_MARGIN] [--line-margin LINE_MARGIN] [--boxes-flow BOXES_FLOW] [--all-texts] [--outfile OUTFILE] [--output_type OUTPUT_TYPE] [--codec CODEC] [--output-dir OUTPUT_DIR] [--layoutmode LAYOUTMODE] [--scale SCALE] [--strip-control] files [files ...] pdf2txt.py: error: the following arguments are required: files

AyeshaSarwar commented 4 years ago

Power Shell Output

PS D:\EducAtiOn\Thesis\Tasks\2\Parsr> pdf2txt.py D:/simple1.pdf Hello

World

Hello

World

H e l l o

W o r l d

H e l l o

W o r l d

AyeshaSarwar commented 4 years ago

It is strange but what do

noopur2805 commented 4 years ago

It is strange but what do

sorry I'm unaware of what might be happening in such case :(