Using TWebBrowserControl to view multi-page PDF


I am using a popup form to display a PDF on my server.

When I do this on Windows it shows all of the pages correctly.

On iOS only the first page is shown.When I view it in Safari it is fine.

On Android it prompts to download but is never displayed. In chrome it does the same.

Is there another way of viewing a PDF?



An alternative could be to do Application.Navigate() and set as URL the URL of the PDF.
We are not aware though of issues with displaying a PDF via a TWebBrowserControl.

I am currently facing the same problems and can confirm that showing a PDF in a DIV or iFRAME under iOS on a smart phone causes problems. This unfortunately seems to be a basic problem and has nothing to do with Web Core. For the time being, we follow Brunos advice and under iOS (or to be precise, when Application.IsMobile is true), we do an Application.Navigate(). This at least shows the full PDF.

Unfortunately, at least under iOS there doesn't seem to be an easy way back into the application. We are investigating on that but found no solution by now.

Thanks for confirming this Walter. When using application.navigate you can get back to the application by swiping right.

Swiping right to get back into the app doesn't work on the iPhones I tested this on. Works on Android, I was told. Is there maybe a setting in iOS to toggle this swiping feature?

I can't remember whick device I was using. I'll test it again.

I can confirm that swiping right does work on an iPhone 11 Pro running iOS 14.4 but you have to do it from the left hand edge so is more like pulling it.

Thanks Ken, confirmed! But it needed the small fingers of a teenager to make that work...


I have used a WebresponsiveGrid to show some pdfs in TWebBrowserControls. The PDFs show tiled in the grid ok.

I now need to enable a click or d/click to do Application.Navigate('testimonials/mytestimonial2.pdf',ntBlank) and open in a new browser tab. But TWebBrowserControl on click or on D/click does not respond.

What am I missing here please.

Sadly the OnClick handled within the IFRAME document isn't propagated to the document of the main page hosting the IFRAME. This is a limitation (by design) of how IFRAME works.
It's non-trivial to workaround this unfortunately.