Skip to content

Commit

Permalink
Replace PyPDF2 with pypdf
Browse files Browse the repository at this point in the history
  • Loading branch information
ashenm committed Jan 6, 2024
1 parent 76ba527 commit 1155e26
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
beautifulsoup4==4.12.0
lxml==4.9.4
PyPDF2==2.12.1
pypdf==3.17.4
PyYAML==6.0.1
reportlab==3.6.13
8 changes: 4 additions & 4 deletions scripts/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from os import P_WAIT, path, remove, spawnlp
from os.path import basename
from PyPDF2 import PdfFileReader, PdfFileWriter
from pypdf import PdfReader, PdfWriter
from tempfile import NamedTemporaryFile
from argparse import ArgumentParser
from reportlab.pdfbase import pdfmetrics
Expand All @@ -27,7 +27,7 @@
args = parser.parse_args()

# denouement
output = PdfFileWriter()
output = PdfWriter()

# intermediate docs
intermediate = NamedTemporaryFile(mode='wb')
Expand All @@ -39,7 +39,7 @@
# construct denouement
with open(intermediate.name, 'rb') as resume, open(forefront.name, 'rb') as forepart:

intermediate.pdf = PdfFileReader(resume)
intermediate.pdf = PdfReader(resume)
forefront.pages = intermediate.pdf.getNumPages()

forefront.canvas = Canvas(filename=forefront.name, pagesize=A4, initialFontName='Helvetica')
Expand All @@ -62,7 +62,7 @@
forefront.canvas.save()

# read constructed custom headers
forefront.pdf = PdfFileReader(forepart)
forefront.pdf = PdfReader(forepart)

# merge resume and headers
for i in range(0, forefront.pages):
Expand Down

0 comments on commit 1155e26

Please sign in to comment.