Make sure that the iframe is on the same domain, otherwise you can't get
access to its internals. That would be cross-site scripting.
It seems you are trying to load google docs in iframe, so it is from
other domain and no browser would allow you to access elements within
Few years back I wanted same thing and spent lots of time behind it. I
came to know its not possible.
You might want to use pdf.js to display docs.
Look at this
question for detail