I’d like to be able to display a PDF in a webpage, but not just the PDF - I’ll have other stuff I want to load on the page as well in regular HTML.
So the page will look something like this:
HTML Content
More HTML Content
PDF file displayed
More HTML Content
End of Page
It appears that the googles recommend using either an or tag, which does indeed work when I create a page like the above and load it in my desktop browser. However, when I try the same in an HTMLViewer instance in my app, I get a pop-up that appears that says “AdobePDFViewer cannot find a compatible Adobe Acrobat or Adobe Reader to view this PDF. Please select one.”
It appears to me that this pop-up is generated by the Xojo app, but I certainly did not program it that way.
Has anyone done this? Am I missing something simple?
@Michel Bujardet - unfortunately, I need to display more than just the pdf in the browser at the same time. See my explanation above about having a PDF file embedded within an HTML page.
For example, I may want to pass something like this to the HTMLViewer:
dim html as String = pageHeaderAndIntro
html = html + "<embed src='http://fontmenu.com/xojo/xmetro.pdf' width='500' height='375' type='application/pdf'>"
html = html + pageClosing
html = html + footerAndCopyright
When I try loading this html into an HTMLViewer on OS X, I get the above error message about it needing the AdobePDFViewer.
Interesting - I’m using 10.11.3, as I’m not willing to put beta releases of the OS on my main production machine. In 10.11.3 I’m seeing this issue with loading PDFs into browsers not only in my Xojo-built apps but also in Xojo itself.
What you were seeing was not a bug in Xojo. We meant to have the PDFs external anyway. Have you tried the iframe solution mentioned? Also keep in mind that you may be seeing an Apple embedded web bug that is resolved in 10.11.4- I don’t have both in front of me to compare.
BOTH show a white screen… with the IFrame having a border due to the style element.
AND when you mouse over the object area, you get the popup controls indicating it THINKS there is a PDF there,
in SAFARI you see the PDF, AND the popuup controls
Yes- it seems like there are two issues at play- but neither seem to be Xojo specific.
An Adobe plugin causing messages to pop up in embedded web views, and a possible issue in Apple’s 10.11.3 embedded web view with PDFs that they may have resolved in 10.11.4.
FYI… when I right click on the blank area… it asks if I want to view in PREVIEW… and THAT works.
SO… my opinion is that it IS loading the PDF, but can’t render it, but all events still seem to work.
I’d love it if more people using OS X would take a moment to download and test this for me. Just open the enclosed project and hit run. What do you see in the app window that appears?