I need help to install http://viewerjs.org plugin to view pfd files in Symfony2. That plugin contains css/js files and images with its own folder structure.
This is what I have done:
Copy all js files to AcmeBundle/Resources/public/js
Copy all css files to AcmeBundle/Resources/public/css
Copy images folder (which originally was into css folder in the plugin) to AcmeBundle/Resources/public/images
Change url(images/xxxx) functions of css files to url(../images/xxxx)
Install assets: php app/console assets:install web
Include the following code to the view I want to use viewer.js.
<link rel= "stylesheet" type="text/css" href="{{ asset('bundles/acme/css/viewer.css') }}" /> <script src= "{{ asset('bundles/acme/js/PluginLoader.js') }}" type="text/javascript"></script> <script src= "{{ asset('bundles/acme/js/viewer.js') }}" type="text/javascript"></script> <iframe id="viewer" src="{{ asset('bundles/acme/js/viewer.js') }}/#../uploads/1.pdf" width='400' height='300' allowfullscreen webkitallowfullscreen></iframe>
"1.pdf" file is in /web/uploads/ folder.
When I load the view, I get in the place of the iframe element:
Not Found
The requested URL /bundles/acme/js/viewer.js/ was not found on this server.