0.6.8 • Published 2 years ago

proskomma-render-pdf v0.6.8

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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)

0.6.8

2 years ago

0.6.7

2 years ago

0.6.6

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago