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

Rad Window - opening PDF

9 Answers 341 Views
Window
This is a migrated thread and some comments may be shown as answers.
Arindam
Top achievements
Rank 1
Arindam asked on 24 Mar 2009, 03:12 PM
I am using below code for opening the radwindow

function openDashboards(source, dest, e)
        {
          
            var oWnd = window.radopen("http://localhost/docs/Oracle9i.pdf", null);
            oWnd.SetTitle("My Dashboards");
            return false;
        }

If I opening the link (i.e. http://localhost/docs/Oracle9i.pdf) from my IIS, it gets opened perfectly, but if I am opening through RadWindow it dont gets open, just a blank page. Could you please tell what is the problem or where I am going wrong?

Please reply soon...

Thanks in advance....

9 Answers, 1 is accepted

Sort by
0
Arindam
Top achievements
Rank 1
answered on 24 Mar 2009, 04:06 PM
Thanks to All.. Problem is solved.....
0
jorge
Top achievements
Rank 1
answered on 17 Apr 2009, 03:19 PM
So what was the solution?
0
Georgi Tunev
Telerik team
answered on 21 Apr 2009, 05:43 AM
Hello jorge,

Make sure that ShowContentDuringLoad is set to true. If this doesn't help, please post here your exact RadWindow / RadWindowManager declaration along with the code that you use to open the PDF.


Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Fawad
Top achievements
Rank 1
answered on 23 Aug 2011, 06:38 PM
Hello Telerik

Sorry for reviving old thread. But my problem is similar.

I am running Windows 7 64-bit with Internet Explorer 9 (both 64-bit and 32-bit).

I have pdf saved in binary data form, when I try to open it in the radWindow, it works when I hit F5 and run the Development Environment of Visual Studio 2010. But when I try to open it from IIS, then something strange happens, the RadWindow opens but blank and PDF opens in its own window!

I tried using ShowContentDuringLoad by setting it to true, that did not help.
Then I tried running InternetExplorer 9 32 bit, that worked fine and IIS nicely opened the radwindow and pdf opened in it nicely. But this mechanism does not work in 64-Bit version of IE 9.

 Any ideas?

Here is code-behind in RadWindow for fetching it:

/// <summary>
        /// Shows proposal.
        /// </summary>
        /// <remarks></remarks>
        private void ShowAttachments(Guid gIssue)
        {
                Response.Buffer = true;
                Response.Charset = "";
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.ContentType = "application/pdf";
                Response.StatusCode = 200;
                Response.StatusDescription = "OK";
 
                Issues myIssue = _Utility.SelectIssue(gIssue); //My class to get the Issue object
 
                //Adding a unique name to avoid caching
                Response.AddHeader("content-disposition", "inline; filename=" + myIssue.Type.ToString() + "_" + DateTime.Now.ToString() + ".pdf");
 
                Response.BinaryWrite(myIssue.Attachment); // Binary data
                Response.Flush();
                Response.End();
            
        }

And here is RadWindow declaration:

<telerik:RadWindow ID="RdWndAttachment" BackColor="White" AutoSize="false" Behaviors="Close"
                Skin="Outlook" VisibleStatusbar="false" Height="770px" ShowContentDuringLoad="true"
                Width="950px" Modal="true" OnClientClose="Refresh" VisibleOnPageLoad="false"
                runat="server" ReloadOnShow="true">
            </telerik:RadWindow>
 
<!--
ALL client events work fine.
-->


Please see and kindly help. 

Kind Regards.
0
Marin Bratanov
Telerik team
answered on 25 Aug 2011, 07:50 AM
Hi Fawad,

Please try removing the ReloadOnShow property, as it appends a random querystring when the RadWindow is shown, so it may be causing some unexpected results.

When this property is removed the RadWindow is just a movable iframe, thus I would also advise testing with a simple iframe (not a RadWindow) under a 64bit IE9 - if the same behavior is observed then this is the way IE9 works with iframes and there is nothing we can do about it. And IE9 has a lot of issues with iframes, so I wouldn't be surprised if this was one of its peculiarities.

Please note that the inline content-disposition means that the browser will decide how to handle the response. More information on the matter is available in this article: http://greenbytes.de/tech/webdav/draft-reschke-rfc2183-in-http-latest.html.

You can find a list with supported configurations in the following link: http://greenbytes.de/tech/tc2231/.

I also believe you may find the following thread helpful: http://stackoverflow.com/questions/291813/best-way-to-embed-pdf-in-html.

I hope the above information will help you in isolating the issue and work around this browser behavior.

Kind regards,
Marin
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Fawad
Top achievements
Rank 1
answered on 25 Aug 2011, 12:18 PM
Hi Marin

Many thanks for your reply, but its not possible for now, as I checked online and apparently IE9 64 does not support handling of 32bit PDF reader!

http://support.microsoft.com/kb/305836


So I guess nothing is going to work as long as Adobe does not provide a 64bit version of their PDF ocx, so I have forced my application to use 32 bit version. (WebBrowserControl in exe so targeted exe to use x86 platform only, now it works inside RadWindow without removing ReloadOnShow

Thanks for your reply anyway, much appreciated. :)

Kind Regards.
0
Kannan
Top achievements
Rank 1
answered on 31 Jul 2013, 12:55 PM
Hi Arindam,

Please post your solution.

Kanann
0
Princy
Top achievements
Rank 2
answered on 01 Aug 2013, 05:24 AM
Hi Kannan,

Please have a look into the following JavaScript I tried to open a PDF in a RadWindow on a RadButton click.

ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>
<telerik:RadButton ID="RadButton1" runat="server" Text="Open PDF" OnClientClicking="openPdf">
</telerik:RadButton>

JavaScript:
<script type="text/javascript">
    function openPdf(sender, args) {
        args.set_cancel(true);
        var radwindow1 = radopen("http://localhost:49534/Telerik_2013/docs/Oracle.pdf", null);
        radwindow1.SetTitle("Oracle.pdf");
        radwindow1.set_width("500");
        radwindow1.set_height("500");
        radwindow1.center();
    }
</script>

Thanks,
Princy.
0
Kannan
Top achievements
Rank 1
answered on 01 Aug 2013, 06:02 AM
Hi Priya,

Thanks for the reply . I've Visual studio 2008 and Telerik 2008  Telerik.Web.UI  .I've to open PDF Radwindow

  <telerik:RadWindow ID="RadWindow1" Skin="ContainerStyle" VisibleStatusbar="false"
        EnableEmbeddedSkins="false" Modal="true" Title="RadWindow Output" Width="800px"
        Height="500px" Behavior="Close" runat="server"> 
code behind: 
        RadWindow1.NavigateUrl = objFileManager.GetVirtualFilePath(objFileManager.GetFile(valTPContractUploadFile.CopiedFileFullPath));
        RadWindow1.VisibleOnPageLoad = true;

But PDF open twice..When followed telerik threads and refer net it working but IE it is not working  . so kindly guide the code.

In same page I'm using ajax setting

Thanks,
Kannan.
Tags
Window
Asked by
Arindam
Top achievements
Rank 1
Answers by
Arindam
Top achievements
Rank 1
jorge
Top achievements
Rank 1
Georgi Tunev
Telerik team
Fawad
Top achievements
Rank 1
Marin Bratanov
Telerik team
Kannan
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or