Skip to content
galkahana edited this page Dec 8, 2014 · 11 revisions

Hello and welcome to the Hummus Renderer Wiki.
Hummus renderer is a NodeJS module and a REST based service for creating and modifying PDF documents.

The PDF files are created based on a simple Javascript object. The object represents a PDF document, and is constructed from pages and their content. Using a simple Object to represent the PDF makes it very easy to generate PDF documents, and simple to integrate with infrastructures like Mustache and Angular for providing variable templates that easily fit with the data from your website.

Let's give it a try. Open another tab or browser window and browse to http://pdfrendering.herokuapp.com/.
Now, copy the following code and paste it in the large text area there:

	{
		"pages": [
			{
				"width": 595,
				"height": 842,
				"boxes": [
					{
						"bottom": 500,
						"left": 10,
						"text": {
							"text": "hello world",
							"options": {
								"fontPath": "./resources/fonts/arial.ttf",
								"size": 40,
								"color": "pink"
							}
						}
					}
				]
			}
		]
	}

Click the Create! button and in a few seconds a window should open up with a PDF showing hello world in pink.

Looking at the syntax you can probably figure out how to change the text, and color, and position. try it out :)

Now, you can create such lovely PDFs in your website using either client-code only javascript with the PDF Rendering service, or if you have a NodeJS based site, you can use the hummusrenderer module.

  • To continue learning about the Object model, and what kinds of PDFs you can create, go to The Rendering Object
  • To learn how to use the Object model in NodeJS using the hummusrenderer module, go to hummusrenderer module
  • To learn how to use the PDF Rendering Service in your website, go to PDF Rendering Service