Hi all,
here is my try for a custom pdfviewer.
I’ve integrated all stuff I need but now it’s not clear how to open file.
I have to load file from local file system (“C:\xxx.pdf” ) rather than from http url.
Thank you.
There is one thing missing in the custom URL, change it to:
this.ViewerURL = @"PDF\Javascript\pdfJS\web\viewer.html?file=[source]";
Then you can use the base PdfSource or PdfStream properties:
this.PDF1.PdfSource = Application.MapPath("mousepad-color-A.pdf");
When using a custom pdf viewer the URL arguments and setup is different for each viewer. Wisej replaces [source] with the postback url. Then if you need “?file=[source]” or “/data/[source]” etc. is up to the viewer.
HTH
Hi Davide,
you could use code like this:
string file = "C:\\..."; MemoryStream ms = new MemoryStream(); using (FileStream f = new FileStream(file, FileMode.Open, FileAccess.Read)) f.CopyTo(ms); this.pdfViewerAuto.PdfStream = ms;
Just make sure that your App/AppPool on IIS has sufficient rights to access the local path.
Best regards
Frank
Please login first to submit.