Paged.js is an open-source library to display paginated content in the browser and to generate print books using web technology.
It contains a set of handlers for CSS transformations and fragmented layout which polyfill the [Paged Media](https://www.w3.org/TR/css-page-3/) and [Generated Content](https://www.w3.org/TR/css-gcpm-3/) CSS modules, along with hooks to create new handlers for custom properties.
It contains a set of handlers for CSS transformations and fragmented layout which polyfill the [CSS Paged Media][] and [CSS Generated Content][] CSS modules, along with hooks to create new handlers for custom properties.
The currently supported properties can be found on [the wiki](https://gitlab.pagedmedia.org/tools/pagedjs/wikis/Support-of-specifications).
A quick overview to getting started with Paged Media CSS and Paged.js is available on [pagedmedia.org](https://www.pagedmedia.org/paged-js/).
## NPM Module
```sh
$ npm install pagedjs
```
## Install
```js
import{Previewer}from'pagedjs';
Paged.js is available via a CDN like [jsDelivr][] or [unpkg][] for a quick use.
Command line interface to render out PDFs of HTML files using Puppeteer: [https://gitlab.pagedmedia.org/polyfills/pagedjs-cli](https://gitlab.pagedmedia.org/polyfills/pagedjs-cli).
[`pagedjs-cli`](https://gitlab.pagedmedia.org/polyfills/pagedjs-cli) is a command line interface to render out PDFs of HTML files. It uses [Puppeteer][] under the hood.
## Modules
...
...
@@ -93,9 +137,10 @@ Modules are groups of handlers for that apply the layout and styles of a CSS mod
New handlers can be registered from `import { registerHandlers } from 'pagedjs'` or by calling `Paged.registerHandlers` on an html page.
Run the local dev-server with livereload and autocompile on [http://localhost:9090/](http://localhost:9090/)
```sh
$ npm start
```
...
...
@@ -220,12 +267,12 @@ npm run specs -- --updateSnapshot
### Docker
A `pagedmedia/pagedjs` docker image contains all the dependencies needed to run the `pagedjs` development server, as well as the pdf comparison tests.
A [`pagedmedia/pagedjs` docker image][docker-image] contains all the dependencies needed to run the `pagedjs` development server, as well as the pdf comparison tests.
To build the image run
```bash
docker build -t pagedmedia/pagedjs .
docker build -t pagedmedia/pagedjs .
```
By default the container will run the development server with `npm start`
...
...
@@ -248,3 +295,13 @@ The core team behind paged.js includes [Adam Hyde](https://adamhyde.net), [Julie
## Licence
MIT License (MIT), which you can read [here](https://gitlab.pagedmedia.org/tools/pagedjs/blob/master/LICENSE.md)