title: How can I get the last line position of PDF file using Python?
body: <p>I am new in Python and creating PDF file using Python, ReportLab and PyPDF2 module. Please help me to find out the last line position of PDF file. Below is the explanation of my question.</p>
  
  <p>For example,</p>
  
  <p>I have one PDF file in which 10 lines are written. Now I wants to add another text into same PDF file. For this I wants to know position of the last line, So I can start another text from below of that line.</p>
  
  <p>Below is sample of code using which i have extracted data from PDF file.</p>
  
  <pre><code>import tkinter
  from tkinter import *
  from reportlab.pdfgen import canvas
  from reportlab.lib.pagesizes import A4
  from PyPDF2 import PdfFileReader
  
  
  root= Tk()
  root.geometry("100x100")        
  
  def line_position():
      opn_pdf1= open("test_pdf.pdf","rb")
      read_pdf= PdfFileReader(opn_pdf1)
      print(read_pdf)
      num_page= read_pdf.getNumPages()
      print(num_page)
      page= read_pdf.getPage(num_page-1)
      data= page.extractText().splitlines()
      print (data)
      print(len(data))
  
  Button(root,text= "PDF Last Line",command= line_position).pack()
  
  
  root.mainloop()
  </code></pre>
  
  <p>Also, let me know is there any way to read and extract data using reportlab instead of PyPDF2.</p>
  
  <p>Thank you.</p>