PDF in Radpane downloads on android (works fine = views) on other devices

3 posts, 0 answers
  1. Bert
    Bert avatar
    3 posts
    Member since:
    Mar 2014

    Posted 01 Jun 2014 Link to this post


    I'm using the following code to display a PDF on a webpage: 

     <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" />
                        <telerik:RadSplitter ID="Radsplitter1" runat="server" Orientation="Horizontal" Width="680">
                          <telerik:RadPane ID="Radpane1" runat="server" Height="850" Width="680" ContentUrl="PDFs/test.pdf">

    My goal is to show the content of the PDF on the webpage.
    This works great on windows devices and IOS, however when opening the webpage in Android - chrome (tried kitkat and jellybean) the pdf just downloads and does not show on the page.
    (fyi on android using the standard 'internet browser' or firefox, the PDF's don't show up at all)

    I found that the following code can be added to the header of the webpage:
    Content-Type: application/pdf
    Content-Disposition: inline; filename.pdf
    I tried adding that to my masterpage, but that didn't help. I'm assuming that if i could add it to the RadPane that it would work.
    Is there any way to do this, or is there another way to show the PDF files on android - chrome?

  2. Bert
    Bert avatar
    3 posts
    Member since:
    Mar 2014

    Posted 02 Jun 2014 in reply to Bert Link to this post


    I've spend a few hours today further investigating this.
    It seems that android (browsers) don't support the functionality to view PDF's in browsers.

    After searching the internet I only found 1 way to solve this: installing firefox and the FF add-on: PDF viewer (it's working with PDF.js)

    However this add-on is pretty slow so it's not yet ideal.

    Does anybody know how to get this working in the standard browser from android or in chrome on android?

  3. Vessy
    Vessy avatar
    2210 posts

    Posted 03 Jun 2014 Link to this post

    Hello Bert,

    We are aware of the reported issue and it is connected with the inabily of the Android browsers to read PDF files. You can experience the same behavior with a standard <iframe> element (what is also the element we are using to render external content in RadPane), loading a PDF file:
    <iframe height="850" width="680" src="PDFs/test.pdf"></iframe>

    You can find more information on the subject in the following StackOverflow thread: How to open pdf file inside android browser?

    On a side note, I would like to mention that using a Splitter with only one RadPane is highly not recommended scenario that is not supported and might lead to many unexpected issues.

    Kind regards,

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top