PHP code example of steamulo / pdfjs-viewer-bundle
1. Go to this page and download the library: Download steamulo/pdfjs-viewer-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$parameters = array(
//Tell to the bundle that the pdf is outside the webroot
'isPdfOutsideWebroot' => true,
//Tell to the bundle where is the pdf. (absolute path for outside temporal folder pdf, just the <name>.pdf for inside temporal folder)
'pdf' => '/home/jjalvarezl/Descargas/123.pdf',
//Tell to the bundle that its necessary to delete pdf after render.
'deletePdfInTmpAfterRenderized' => false,
);
return $this->get('jjalvarezl_pdfjs_viewer.viewer_controller')->renderDefaultViewer($parameters);