This is a migrated thread and some comments may be shown as answers.

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

2 Answers 65 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Bert
Top achievements
Rank 1
Bert asked on 01 Jun 2014, 12:07 PM
Dear,

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">
                      </telerik:RadPane>
                    </telerik:RadSplitter>


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 Answers, 1 is accepted

Sort by
0
Bert
Top achievements
Rank 1
answered on 02 Jun 2014, 04:16 PM
Update:

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)
https://addons.mozilla.org/en-us/android/addon/pdfjs/?src=hp-dl-mostpopular

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?



0
Vessy
Telerik team
answered on 03 Jun 2014, 10:21 AM
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,
Vessy
Telerik
 

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.

 
Tags
Splitter
Asked by
Bert
Top achievements
Rank 1
Answers by
Bert
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or