Skip to main content

Project Structure

Projects using rendercss will have the same general layout as renderpdf projects as seen in the example below:

└── project/
├── callback/
├── error/
├── mediaproxy/
├── rendercss/ --> new folder
├── restapi/
└── upload/

In the rendercss folder, we will include all nescessary files as below (here using Handlebars for HTML templating and WeasyPrint for PDF generation):

Example:

└── rendercss/
├── handlebars/
│ ├── default.hbs // <documentTemplate>.hbs
│ ├── header.hbs
│ ├── body.hbs
│ ├── footer.hbs
│ └── js_helpers/
│ ├── isDisable.js
│ └── prepareData.js
├── jobs/
│ ├── product.json
│ └── product.xml
├── weasyprint/
│ ├── default.css
│ └── default.js
├── resources/
│ ├── fonts/
│ ├── images/
│ └── icc-profiles/
└── config.ion
Folder / File NameDefinition
handlebarscontains all handlebars template files. Must have default.hbs as entry point since default is the default documentTemplate.
handlebars/js_helperscontains all JavaScript helper scripts
jobscontains data input (support JSON / XML)
weasyprintrendering engine folder. It contains:
- default.css: styling for the template
- default.js: additional JS function if supported by the PDF generator
resourcescontains static files that are used in the template (fonts, images, etc)
config.ioncontains all variables to config rendercss worker.
E.g.:
{
"templatingEngine": "handlebars",
"renderingEngine": "weasyprint",
"xmpTemplating": false,
...
}
See rendercss configuration