0.6.8 • Published 4 years ago
proskomma-render-pdf v0.6.8
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 installUsage
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.pdfThe 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 PDFExample Sources
from unfoldingWord Literal Text (Psalms and Gospels)