0

Can anyone tell me when I run this code why its giving me back a link? The file is saved locally on my computer as a PDF. When I open the file it opens directly in Adobe Reader and there is not link.. This is a deed with names and legal descriptions.

This is the result when running the code: Firefox

https://benchmark.probate.mobilecountyal.gov/LandmarkWeb//Docume...

1 of 2

2/11/2023, 8:39 PM

# importing required modules
from PyPDF2 import PdfReader
 
# creating a pdf reader object
pdf_file = open(r'C:\Users\user\Desktop\testdeed.pdf', 'rb')
pdf_reader = PdfReader(pdf_file)
 
# printing number of pages in pdf file
print(len(pdf_reader.pages))
 
# getting a specific page from the pdf file
page = pdf_reader.pages[0]
 
# extracting text from page
text = page.extract_text()
print(text)
mason
  • 1
  • 2
  • I ran this code and it opens the pdf just fine. import os pdf_file = r'C:\Users\user\Desktop\testdeed.pdf' if os.name == 'nt': # Windows os.startfile(pdf_file) else: # Other operating systems os.system("open " + pdf_file) – mason Feb 12 '23 at 02:50

0 Answers0