hummus-reports
v1.0.10
Published
Layout engine over hummus pdf library
Downloads
4
Readme
Hummus reports
Hello! This repo hosts an engine that can generate reports. It does that using a PDF library named hummus, and a layout engine that helps with things like text wrapping, image fitting, and provide a json document layout, instead of the hummus command-based api.
Engine documentation
You can find documentaiton on how to use the engine in the documents section of this project. Here's a TOC:
- Getting Started
- The root Document
- Document Pages
- Page boxes
- Drawing Primitive Shapes
- Showing images
- Placing text
- Wrapping text and inline boxes
- Modifying existing PDF files
- Encrypting PDF files and Using encrypted PDF files
Installation
npm install hummus-reports
Samples
The project has two samples provided:
- simple-script - A basic script that generates a PDF file, with assets map example. The output is made to a file.
- simple-editor - A simple preview-and-generate server and site, allowing you to quickly edit and preview documents. The output of the PDF is provided directly to the stream, which in turn is used as a data uri in the client code. If you intend to run this project independently make sure to update its reference to this project as it is now relative to this project root.
Development
Folders structure
The folders structure is as follows:
./index.js
- root file for exportingPDFEngine
class./lib/pdf-engine folder
- implementaiton of the pdf engine. root ispdf-engine.js
.
Warning! native module ahead
HummusJS is a native module. This means that this code can only be ran on a NodeJS service, and is not a cross-platform javascript module.