proskomma-render-pdf

0.6.8 • Public • Published

proskomma-render-pdf

Scripture PDF generator based on proskomma-render

This project uses proskomma-render to produce HTML suitable for processing by PagedJS, an implementation of CSS Paged Media.

Installation

You will need Node and NPM.

cd proskomma-render-pdf
npm install

Usage

import {doRender, configIssues} from 'proskomma-render-pdf';

doRender takes as arguments

  • an instance of Proskomma which has been preloaded with (at least) the necessary documents
  • a config object
  • optionally, an array of docSetIds to render
  • optionally, an array of documentIds to render

See the scripts for detailed usage.

configIssues(configOb) returns an array of issues found with the config file, including

  • badly-formed book names (should be Paratext-style 3-letter, upper case codes)
  • section ids with no corresponding entry in the i18n section

This function is run within doRender, but you may wish to check your config before attempting to render.

Example Usage

Scripts

The make_pdf.js Node script produces PDF directly (in places where puppeteer may be used).

cd scripts
node ./make_pdf.js config/config_ult.json ~/Desktop/ult_demo.pdf

The make_html_pdf.js script produces 'chunked' HTML, which may then be converted to PDF in a web page via the browser's 'save as PDF' feature.

cd scripts
node ./make_html_for_pdf.js config/config_ult.json ~/Desktop/ult_demo.html
# Open this HTML file with a browser
# Wait for it to paginate the content
# Save as PDF

Example Sources

from unfoldingWord Literal Text (Psalms and Gospels)

Readme

Keywords

none

Package Sidebar

Install

npm i proskomma-render-pdf

Weekly Downloads

111

Version

0.6.8

License

MIT

Unpacked Size

13.8 MB

Total Files

19

Last publish

Collaborators

  • mvahowe