objective c - iOS - Check if webView is loaded with PDF content on non-'pdf' file extension -


I want to check (boolean values) if the PDF content is loaded in UIWebView, this question already exists, but This is not the case.

This is not as simple as checking the path extension of WebView URL as this PDF content is generated through ASPX. The extension 'aspx' will always return to the string 'pdf' url after requesting a PDF file, not only by visiting the url. I need to check whether the server actually returns a PDF file, as it should.

OK, webview is loaded with PDF content but not on a specific PDF file on the server. (Maybe Apache redirect, ASPX PDF generation or something else)

If this URL is loaded into the Safari application (in the ASPX file), then it will detect PDF content (even if the ASPX file). It says, "in the open ..." and so on.

How does it show that UIWebView is loaded on non-PDF extension file with PDF content?

Jonathan

I solved it using:

< P> Thanks @ Guillem

  - (Bull) is PDF Sententant Loaded Inward View: (UI Webbook *) Webview request). reaction. MMMTIP; If (! ([Range range offstring: @ "PDF"]. Location == 0)) {return yes; } And {not return; } no return; }  

Comments