Selenium can only access a HTML or XML document as a tree structure wherein each node is an object representing a part of the document. PDF does not offer this nor does it work in this way.
The browser has a PDF reader engine that paints the contests to the pdf-viewer element. This renderer draws the PDF onto a canvas (or a shadow DOM internal element) — a painted surface, not HTML. You will need to use a different tool such as a PDF parsing library that is able to piece through this and read its content and unfortunately Selenium was not designed for this.