pdf의 내용을 txt로 저장하기

semi·2020년 7월 3일
0

etc

목록 보기
3/8

1. tika 라이브러리를 설치한다.

pip install tika

2. 다음 python 코드를 실행한다.

from tika import parser
pdf_path = "input.pdf" 
parsed = parser.from_file(pdf_path)

txt = open('output.txt', 'w', encoding = 'utf-8')
# output.txt에 pdf파일 내용을 write
print(parsed['content'], file = txt)
txt.close()

0개의 댓글