Skip to content

Commit 0d5994a

Browse files
committed
Fix PyPDF2 import and remove call to .encode()
1 parent 3a46af9 commit 0d5994a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ch13-interact-with-pdf-files/1-work-with-the-contents-of-a-pdf-file.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
import os
6-
from pyPDF2 import PdfFileReader, PdfFileWriter
6+
from PyPDF2 import PdfFileReader, PdfFileWriter
77

88

99
# Exercise 1
@@ -26,7 +26,6 @@
2626
# Extract every page of text
2727
for page_num in range(0, input_file.getNumPages()):
2828
text = input_file.getPage(page_num).extractText()
29-
text = text.encode("utf-8") # convert text to unicode
3029
output_file.write(text)
3130

3231

0 commit comments

Comments
 (0)