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

How to assign/display byte[] into RadEditor

1 Answer 133 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Nirav
Top achievements
Rank 1
Nirav asked on 15 Oct 2014, 05:53 PM
Hi, 
I am using "UI for ASP.Net AJAX Q2 2014", Telerik.Web.UI.dll version is 2014.2.618.45, Visual studio 2013 and developing a website.
One of my requirement is to display pdf file with Agree/Do not Agree buttons. 
I am thinking to display pdf file contents in RadEditor ( editing disabled ).
I have pdf file stored into SQL Server database field and I am reading from database and converting to byte[].
Now I want to assign this byte[] to RadEditor so that it displays pdf text as it is with formatting. 
Can you tell me how should I assign byte[] to RadEditor to display that text? 

I will disable editing to it will just look like text, and will provide Agree/Do not agree button so I can capture button click and go accordingly. 
I will be putting this RadEditor in a webform, with above buttons, and will open up that form as Modal form using RadWindow, so user will need to click Agree to continue process. 

Thanks in advance, 


1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 17 Oct 2014, 10:31 AM

Hi Nirav,

RadEditor is an XHTML editor, so it cannot display a PDF. It can take a simple string (which can contain HTML markup) for its Content, but it cannot take an array representation of a file. Also, if you need buttons that invoke server actions, they should be outside of the editor so they can POST the form.

What I can suggest is opening your PDF file in the RadPdfViewer for Silverlight: http://www.telerik.com/help/silverlight/radpdfviewer-overview.html. You can also consider other viewer options like the PDF.js library from Firefox and this blog can help you get started with it: http://blogs.telerik.com/aspnet-ajax/posts/14-05-27/building-an-asp.net-pdf-viewer-with-telerik-window-control-and-pdf-js.


Regards,

Marin Bratanov
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
Editor
Asked by
Nirav
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or