PHPackages                             diecoding/yii2-pdfjs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. diecoding/yii2-pdfjs

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

diecoding/yii2-pdfjs
====================

Previewer PDF File with PDF.js for Yii2

v1.1.2(1y ago)54.0k—5.6%6MITJavaScriptPHP &gt;=7.4.0

Since Sep 16Pushed 1y ago1 watchersCompare

[ Source](https://github.com/wanforge/yii2-pdfjs)[ Packagist](https://packagist.org/packages/diecoding/yii2-pdfjs)[ GitHub Sponsors](https://github.com/sugeng-sulistiyawan)[ RSS](/packages/diecoding-yii2-pdfjs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (10)Used By (0)

Yii2 PDF.js
===========

[](#yii2-pdfjs)

Previewer PDF File with PDF.js for Yii2

[![Latest Stable Version](https://camo.githubusercontent.com/3ecdf988ee604019f9699ffb6544dce3d61781d01f462b66a3b3b5696ff34f3c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646965636f64696e672f796969322d7064666a733f6c6162656c3d737461626c65)](https://packagist.org/packages/diecoding/yii2-pdfjs)[![Total Downloads](https://camo.githubusercontent.com/05d8242848c2baa9f666d086b2695194851a2663554aa9d89dd3522658d14859/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646965636f64696e672f796969322d7064666a73)](https://packagist.org/packages/diecoding/yii2-pdfjs)[![Latest Stable Release Date](https://camo.githubusercontent.com/6db42106d5433c074a7c2040db33c0c1690f3136cc3a86c5b9132b5281feb914/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f737567656e672d73756c69737469796177616e2f796969322d7064666a73)](https://github.com/sugeng-sulistiyawan/yii2-pdfjs)[![Quality Score](https://camo.githubusercontent.com/be8c5323ce20ab7252dc9eade23f33228c3e624ad4339dd1d45897128745a429/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f737567656e672d73756c69737469796177616e2f796969322d7064666a73)](https://scrutinizer-ci.com/g/sugeng-sulistiyawan/yii2-pdfjs)[![Build Status](https://camo.githubusercontent.com/2fc220e8380a8720337b91282aadc84c74316ca9253dcbcc80b5bb5342d2cb2c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f737567656e672d73756c69737469796177616e2f796969322d7064666a73)](https://app.travis-ci.com/sugeng-sulistiyawan/yii2-pdfjs)[![License](https://camo.githubusercontent.com/ead9d47b4c57e14c191ce5d944c956073b7e5e176c4808f3ab21448bb5600d54/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f737567656e672d73756c69737469796177616e2f796969322d7064666a73)](https://github.com/sugeng-sulistiyawan/yii2-pdfjs)[![PHP Version Require](https://camo.githubusercontent.com/75a53f036a3267beea19f366719a4f1ebf2698763fdef5af93b171f4b45e20d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f646965636f64696e672f796969322d7064666a732f7068703f636f6c6f723d366637336136)](https://packagist.org/packages/diecoding/yii2-pdfjs)

> Yii2 PDF.js uses [PDF.js](https://mozilla.github.io/pdf.js/)
>  Demo:

Table of Contents
-----------------

[](#table-of-contents)

- [Yii2 PDF.js](#yii2-pdfjs)
    - [Table of Contents](#table-of-contents)
    - [Instalation](#instalation)
    - [Dependencies](#dependencies)
    - [Usage](#usage)
        - [Setup Module](#setup-module)
        - [Views](#views)
            - [Basic Usage](#basic-usage)
            - [Direct Url with Full Toolbar Section](#direct-url-with-full-toolbar-section)
            - [Custom Attribute](#custom-attribute)
            - [Disable Toolbar Section](#disable-toolbar-section)

Instalation
-----------

[](#instalation)

Package is available on [Packagist](https://packagist.org/packages/diecoding/yii2-pdfjs), you can install it using [Composer](https://getcomposer.org).

```
composer require diecoding/yii2-pdfjs '^1.0'
```

or add to the require section of your `composer.json` file.

```
'diecoding/yii2-pdfjs': '^1.0'
```

Dependencies
------------

[](#dependencies)

- PHP 7.2+
- [yiisoft/yii2](https://github.com/yiisoft/yii2)

Usage
-----

[](#usage)

### Setup Module

[](#setup-module)

```
...
'modules'=>[
  'pdfjs' => [
       'class' => \diecoding\pdfjs\Module::class,
   ],
],
...
```

### Views

[](#views)

#### Basic Usage

[](#basic-usage)

```
echo \diecoding\pdfjs\PdfJs::widget([
    'url' => '@web/uploads/dummy.pdf',
]);
```

#### Direct Url with Full Toolbar Section

[](#direct-url-with-full-toolbar-section)

```
echo Url::to(["/pdfjs", 'file' => Url::to('@web/uploads/dummy.pdf', true)], true);
```

#### Custom Attribute

[](#custom-attribute)

```
echo \diecoding\pdfjs\PdfJs::widget([
    'url' => '@web/uploads/dummy.pdf',
    'options' => [
        'style' => [
            'width' => '100%',
            'height' => '500px',
        ],
    ],
]);
```

#### Disable Toolbar Section

[](#disable-toolbar-section)

```
echo \diecoding\pdfjs\PdfJs::widget([
    'url' => '@web/uploads/dummy.pdf',
    'sections' => [
        'toolbarContainer' => false,
    ],
]);
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~168 days

Recently: every ~63 days

Total

9

Last Release

726d ago

Major Versions

0.0.1 → v1.0.02023-09-12

PHP version history (4 changes)0.0.1PHP &gt;=7.0

v1.0.0PHP &gt;=7.4

v1.0.1PHP &gt;=7.2

v1.1.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5fa8faeecf1f3d0da2d981ae5e4238e1590a7897b14b890663a0c49ef03e87a?d=identicon)[diecoding](/maintainers/diecoding)

---

Top Contributors

[![wanforge](https://avatars.githubusercontent.com/u/16300077?v=4)](https://github.com/wanforge "wanforge (28 commits)")

---

Tags

jquerypdfjspdfviewerwidgetyii2jqueryyii2widgetpdfjspdfviewer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/diecoding-yii2-pdfjs/health.svg)

```
[![Health](https://phpackages.com/badges/diecoding-yii2-pdfjs/health.svg)](https://phpackages.com/packages/diecoding-yii2-pdfjs)
```

###  Alternatives

[yii2assets/yii2-pdfjs

Yii2 Extension pdf.js Portable Document Format (PDF) viewer

23209.3k](/packages/yii2assets-yii2-pdfjs)[phpnt/yii2-export

Yii2 It saves data in xls, csv, word, html, pdf files.

158.9k](/packages/phpnt-yii2-export)[russ666/yii2-countdown

jQuery countdown widget for Yii2

11100.0k](/packages/russ666-yii2-countdown)[diecoding/yii2-toastr

Simple flash toastr notifications for Yii2

1328.8k](/packages/diecoding-yii2-toastr)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
