New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pagedjs

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pagedjs

Chunks up a document into paged media flows and applies print styles

  • 0.0.3
  • npm
  • Socket score

Version published
Weekly downloads
18K
decreased by-16.33%
Maintainers
1
Weekly downloads
 
Created
Source

Paged.js - Paged Media Tools

NPM Module

$ npm install pagedjs
import { Chunker, Styler} from 'pagedjs';

let styles = new Polisher();
let styleText = await styles.add("path/to/css/file.css");

let chunker = new Chunker(DOMContent, document.body, styles).then((flow) => {
	console.log("Rendered", flow.total, "pages.");
})

Polyfill

Add the the paged.polyfill.js script to replace all @page css and render the html page with the Paged Media styles applied:

<script src="https://s3.amazonaws.com/pagedmedia/pagedjs/dist/paged.polyfill.js"></script>

Test with Aurorae: https://s3.amazonaws.com/pagedmedia/pagedjs/examples/aurorae/index.html.

Chunker

Chunks up a document into paged media flows and applies print classes.

Process the first 50 pages of Moby Dick: https://s3.amazonaws.com/pagedmedia/pagedjs/examples/index.html.

Upload and chunk an Epub (using Epub.js): https://s3.amazonaws.com/pagedmedia/pagedjs/examples/epub.html.

Polisher

Converts @page css to classes, and applies counters and content.

Test styles for Aurorae: https://s3.amazonaws.com/pagedmedia/pagedjs/examples/styler.html.

CLI

Command line interface to render out PDFs of HTML files using Puppeteer: https://gitlab.pagedmedia.org/polyfills/pagedjs-cli.

Setup

Install dependencies

$ npm install

Development

Run the local dev-server with livereload and autocompile on http://localhost:9090/

$ npm start

Deployment

Build the dist output

$ npm run prepare

FAQs

Package last updated on 27 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc