DEFAULT_URL
See original GitHub issueI need to be able to define DEFAULT_URL via a php script. My script is based on viewer.html, but it gets a filename from a database with an ID, and defines that in the header:
echo "var DEFAULT_URL = '".$file."'";
This doesn’t seem to be working for me in 2.0 - how would I go about defining DEFAULT_URL now? Exposing the location of the pdf file in the URL is simply not an option for me, nor is defining it in the viewer.js file.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
FormsAuthentication.DefaultUrl Property (System.Web.Security)
The DefaultUrl property value is set in the configuration file for an ASP.NET application by using the defaultUrl attribute of the forms configuration ......
Read more >defaultUrl, loginUrl in ASP.NET web.config - Stack Overflow
DefaultUrl defines where the authentication process will take you after login. Basically user tries to access Default.aspx.
Read more >Understand Default URL Pattern - Contentstack
The Default URL Pattern feature lets you set a common URL pattern for all the entries of a content type. Once you set...
Read more >default-url - IBM
The default-url command specifies the URL fragment on the application server to go to after a successful login. The field is only used...
Read more >Default URL - Shrine
The default_url plugin allows setting the URL which will be returned when there is no attached file. ... The default URL block is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As explained in the FAQ there’s another, and possibly even easier, way to achieve this; please see https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#file
To summarize: Load the viewer with an empty
?file=
parameter, as in e.g. https://mozilla.github.io/pdf.js/web/viewer.html?file=, and then callPDFViewerApplication.open(/* file here */)
to load the PDF file.@Snuffleupagus I tried placing this code in the header of viewer.html:
PDFViewerApplication.open('<?=$file;?>');
And I get this error:
Can't find variable: PDFViewerApplication