Answer the question
In order to leave comments, you need to log in
Why instead of Ukrainian other characters are displayed?
I need to get all the text (in Ukrainian) from a pdf file, but in return I get a completely different output.
import PyPDF2 as pdf
r = pdf.PdfFileReader('document.pdf')
pages_num = r.getNumPages()
page = r.getPage(7).extractText()
with open('test.txt', 'w', encoding='utf-8') as fg:
fg.write('{0}'.format(page))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question