Nic Adams asked 2018-04-27 11:11:46 UTC
I'm still trying to set the download filename on the PdfViewer control when using pdf.js as the viewer. I've discovered that the underlying javascript object PDFViewerApplication, has a method setTitleUsingUrl() which takes a URL and then figures out the filename from it.
My problem now is that I cannot figure out how to access the PDFViewerApplication object. I’ve tried to do this from OnWebRender and from other objects and using Eval(string.Format(“PDFViewerApplication.setTitleUsingUrl(‘{0}’);”, Application.Url + fileName)); but I always get “PDFViewerApplication is undefined”
I've tried to debug the js but I just cannot find this object anywhere and as I'm a c# developer I don't understand the js model or the development tools enough to find this object. I've spend a couple of days trying to work it out but am getting nowhere.
Can anyone point me in the right direction?
TIA
Nic
Nic Adams asked 2018-04-27 11:11:46 UTC
I'm still trying to set the download filename on the PdfViewer control when using pdf.js as the viewer. I've discovered that the underlying javascript object PDFViewerApplication, has a method setTitleUsingUrl() which takes a URL and then figures out the filename from it.
My problem now is that I cannot figure out how to access the PDFViewerApplication object. I’ve tried to do this from OnWebRender and from other objects and using Eval(string.Format(“PDFViewerApplication.setTitleUsingUrl(‘{0}’);”, Application.Url + fileName)); but I always get “PDFViewerApplication is undefined”
I've tried to debug the js but I just cannot find this object anywhere and as I'm a c# developer I don't understand the js model or the development tools enough to find this object. I've spend a couple of days trying to work it out but am getting nowhere.
Can anyone point me in the right direction?
TIA
Nic