V
V
Vladislav Sofienko2017-10-12 21:28:20
Yii
Vladislav Sofienko, 2017-10-12 21:28:20

How to embed Mozilla's pdf.js in Yii2?

How to embed pdf.js library in Yii2? It is desirable to write for the stupid, because I'm not very good at writing extensions and widgets.
You can not offer Yii2Assets/yii2-pdfjs , because it refuses to work in the advanced version of yii2 =D

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2017-10-13
@Maksclub

Installed now in 2 lines and everything started up
1. Install through the composer (make sure it's worth it)
2. In the frontend / config / main.php application, insert into the section with modules:

'pdfjs' => [
       'class' => '\yii2assets\pdfjs\Module',
],

3. Display in view, for example, directly in frontend/views/site/index.php output:
<?= \yii2assets\pdfjs\PdfJs::widget([
    'url'=> Url::base().'/automir.pdf'
]); ?>

4. Autoworld itself downloaded quickly from torrents, put in frontend/web/
Here is the result:
59e047101b24b802287587.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question