getData
does not work for me. I can't find anything about it in any of the documentation, and I keep getting the error 'ArrayObject' object has no attribute 'getData'
when I try to use it on an indirect object.
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
from tkinter import filedialog
import PyPDF2
from PyPDF2 import filters
from PyPDF2 import generic
from PyPDF2 import merger
from PyPDF2 import pagerange
from PyPDF2 import utils
from PyPDF2 import xmp
root = Tk()
frm = ttk.Frame(root, padding=300)
frm.grid()
ttk.Label(frm,
text="TestingTesting123").grid(column=10, row=9)
ttk.Button(frm, text="Quit",
command=root.destroy).grid(column=10, row=10)
_Loader = filedialog
_File = _Loader.askopenfile()
_Reader = PyPDF2.PdfFileReader(stream=_File.name)
_Page = _Reader.getPage(0)
_Output = messagebox
_Output.showinfo("Test",_Page['/Contents'].getData())
root.mainloop()
So, everything is just fine right up until I call the getData
method. If I take it out, _Page['/Contents']
returns what appears to be a two-dimensional array object {IndirectObject[71,0]}
.
All I want to do is be able to see what's in that array, or at least one index. I call the getData
method, and I get the error. Also, when I assign the _Page
variable, I don't get anything suggested in PyCharm
when I type "_Page." which, if it's a page object, I should, right? Do I not have something imported correctly, maybe? No, I can't share the .pdf I'm working on. Wish I could. Also, is there any documentation of PyPDF
that actually mentions or covers things like getData
or resolvedObjects?