IndexError |
Python 3.12.8: C:\Users\Administrator\AppData\Local\Programs\Python\Python312\python.exe Sat Jan 18 11:05:17 2025 |
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
C:\apache24\htdocs\cgi-bin\stamp\msapp\bhntstamp.py in <module> |
77 agentnum = tdict['hntagtnum'] |
78 mktemplate(agentnum,tdict) |
=> 79 watermark(input_pdf = 'c:/Apache24/htdocs/brochures/ms/hnt.pdf', |
=> 80 output_pdf = 'c:/Apache24/htdocs/wwwbin/output.pdf', |
=> 81 watermark_pdf = 'template.pdf') |
watermark = <function watermark>, input_pdf undefined, output_pdf undefined, watermark_pdf undefined |
C:\apache24\htdocs\cgi-bin\stamp\msapp\bhntstamp.py in watermark(input_pdf='c:/Apache24/htdocs/brochures/ms/hnt.pdf', output_pdf='c:/Apache24/htdocs/wwwbin/output.pdf', watermark_pdf='template.pdf') |
53 def watermark(input_pdf,output_pdf,watermark_pdf): |
54 watermark = PdfReader(watermark_pdf) |
=> 55 watermark_page = watermark.pages[0] |
56 pdf = PdfReader(input_pdf) |
57 pdf_writer = PdfWriter() |
watermark_page undefined, watermark = <PyPDF2._reader.PdfReader object>, watermark.pages = <PyPDF2._page._VirtualList object> |
C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\PyPDF2\_page.py in __getitem__(self=<PyPDF2._page._VirtualList object>, index=0) |
2075 index = len_self + index |
2076 if index < 0 or index >= len_self: |
=> 2077 raise IndexError("sequence index out of range") |
2078 return self.get_function(index) |
2079 |
builtin IndexError = <class 'IndexError'> |
IndexError: sequence index out of range
add_note =
<built-in method add_note of IndexError object>
args =
('sequence index out of range',)
with_traceback =
<built-in method with_traceback of IndexError object>