I'm trying to figure out how it would be possible to enable auto-open for inline preview as described in this guide, but then for external files:
We have many courses in which students need to access one and the same pdf, preferably displayed with inline preview, but which we keep and update in just one place. In this case the pdf is located outside Canvas on a server. De DocViewer recognizes it is not coming from Canvas and therefore not providing the Auto-open the inline preview for this link option.
As a work around it appears to be possible to create a new course, put the pdf in Files, set the visibility to Institution, add the link to another course and enable Auto-open the inline preview for this link. But this is far from ideal...
If I'm not mistaken, the DocViewer is a JS script and gathers some variables before it displays anything, what variables would that be? Please share if you know more about the workings of the DocViewer.
To enable the auto-open feature, the file has to be uploaded to the Canvas site. You may consider use "Blueprint" to push the pdf to multiple sites and/or use Canvas API to upload the pdf to multiple sites. Once you done that, you could use Canvas API to embed the pdf to anywhere support rich text editor. Here is an example.
<p><a class="instructure_file_link instructure_scribd_file auto_open" title="Syllabus_Sample.pdf" href="https://community.canvaslms.com/courses/*******/files/*******/download?verifier=********&wrap=1">Syllabus_Sample.pdf</a></p>
As you may see, the "auto_open" class would be the "variable" you are looking for.
Since I have very little knowledge about the DocViewer in Canvas, I'm not sure if this is the best way to solve your problem. So just post it here for your reference.