ASP.NET - Open pdf without adobe

Asked By Indu P on 21-Oct-10 04:12 AM
hi, I have to open a pdf viewer from my application. as dialogue box when user clicks on the link.
Without adobe reader, how can u do this.

Please let me know

Regards
Indu
Mitesh Darji replied to Indu P on 21-Oct-10 04:24 AM
It is not possible to open any with without software it must be open in AdobeReader in Browser.

suppose In your system AdobeReader not installed then it will ask for download because they could not find relevant software to open it.


Jatin Prajapati replied to Indu P on 21-Oct-10 04:28 AM
Without adobe pdf reader, you can't open. Or you have to develop your own reader to do this.
Indu P replied to Jatin Prajapati on 21-Oct-10 04:31 AM
How can I get the reader or some dll file
Nowshad M replied to Indu P on 21-Oct-10 05:24 AM
Hi Indu,
You can open a PDF without using/downloading Adobe reader by using Flex Viewer.

Just refer the following links for more information

http://flexpaper.devaldi.com/ is an open source document viewer component for displaying PDF files inside websites or Flash applications.

The component does not exactly display PDF files but the PDF-to-SWF converted files in a Acrobat Reader-like interface.

http://www.i-keng.com/wp-content/uploads/2010/04/flexpaper.gif

Usage is pretty simple, just inserting the SWF file + customizing the options and there are free tools to convert documents, like http://www.swftools.org/download.html.

FlexPaper supports zoom in/out, paging, fullscreen, search and printing the documents viewed.

Optionally, it is possible to use the component in Adobe Flex as a SWC source file comes with the download.

Website: http://flexpaper.devaldi.com/
Download: http://flexpaper.devaldi.com/download.htm

Thanks,

Nowshad

Indu P replied to Nowshad M on 21-Oct-10 05:43 AM
Hi,

I was not able to download. is it any dll file. I got only swf file.
other two options are not free download.
can u help me with some sample code
Nowshad M replied to Indu P on 21-Oct-10 06:10 AM
Hi,

<script type="text/javascript">
        function LoadSPViewer(strValue)
        {
               strValue=filename;
                if(strValue!="")
                {
                    var swfVersionStr = "9.0.124";
                    var xiSwfUrlStr = "${expressInstallSwf}";
                    var flashvars = {                           
         }
         flashvars.SwfFile = strValue;
         flashvars.Scale = 1;
         flashvars.ZoomTransition = "easeOut";
         flashvars.ZoomTime = 0;
            flashvars.ZoomInterval = 0.1;
            flashvars.FitPageOnLoad = true;
            flashvars.FitWidthOnLoad = true;
            flashvars.PrintEnabled = true;
        var params = {
        
           }
                    params.quality = "high";
                    params.bgcolor = "#ffffff";
                    params.allowscriptaccess = "sameDomain";
                    params.allowfullscreen = "true";
                    var attributes = {};
                    attributes.id = "FlexPaperViewer";
                    attributes.name = "FlexPaperViewer";
                    swfobject.embedSWF(
                        "FlexPaperViewer.swf", "flashContent", 
                        "800", "550",
                        swfVersionStr, xiSwfUrlStr,
                        flashvars, params, attributes);
       swfobject.createCSS("#flashContent", "display:block;text-align:left;");        
   }
}
        </script>


You just download that swfobject js from the path


Thanks,
Nowshad
Indu P replied to Nowshad M on 22-Oct-10 12:30 AM
Hi,

Thank you so much for sending me the code.

Sorry Still I have doubts... extremely sorry to ask again..

Can u tell me the step by step procedure.

I put this code in my aspx.cs file.

But I could not find any js dile
I could download 2 folders one is flash and one is swc. there ar elots of files in that.. I don know which one to use
and how to call in the coding.

Regards
Indu
Indu P replied to Nowshad M on 22-Oct-10 12:31 AM
Also this should be client should be able to view when nothing is installed in his system
Nowshad M replied to Indu P on 22-Oct-10 12:35 AM
Hi,

Yes you can see pdf without installing anythin.. Just give me your mail id i will send my sample code files. Or just mail to me in nowsha.trendy@gmail.com


Thanks,
Nowshad
Indu P replied to Nowshad M on 22-Oct-10 12:54 AM
Thank you so much.

my mail id is indsuj85@gmail.com
Indu P replied to Nowshad M on 25-Oct-10 01:07 AM
Hi ,

I'll check this and get back to you.. I copied the app. but I was getting some error.

I'll check this

Thank you
Indu P replied to Nowshad M on 25-Oct-10 01:54 AM
Hi Noushad,

I modified the coding n tried

My code is given below.

I commented the directoryInfo coding, since it was giving me error

string ss = "http___localhost_3899_WebApp_Invoice2.pdf";

string strScript = @"<script type=""text/javascript"">LoadSPViewer(""" + ss + @""");</script>";

Page.RegisterStartupScript("Load Viewer", strScript);

I wrote this in page load.

But I'm getting javascript error 'sys is undefined' and pdf not loading

and when I comment the script manager and update panel tags,
error is gone but pdf not loading