Fast and simple report generator, from JSON to pdf, xslx, docx, odt...
See the code⚡️ Fast, Simple and Powerful report generator in any format PDF, DOCX, XLSX, ODT, PPTX, ODS, XML, CSV using templates and your JSON data as input !
Use the latest version (v5+) for free with our Docker Edition:
docker pull carbone/carbone-ee:latest
No license is required to start the On-Premise Docker Edition with the REST API (same API as the Cloud Edition). A license is only required for advanced features. By default, only community features are enabled.
Check out our changelog
This open-source edition, which can be embedded in Node.js, is always one major version behind. We will update it to v4 as soon as possible. Thank you for your patience.
Feel free to contact us via chat if you need further information or professional support.
README language: 🇨🇳 简体中文, 🇺🇸 English
{d.companyName} directly in your documentCarbone is a mustache-like template engine {d.companyName}.
Template language documentation : https://carbone.io/documentation.html
Carbone analyzes your template and inject data in the document. The generated document can be exported as is, or converted to another format (PDF, ...) using LibreOffice if it is installed on the system. Carbone is working only on the server-side.
1 - Install it
npm install carbone
2 - Copy-paste this code in a new JS file, and execute it with node
const fs = require('fs');
const carbone = require('carbone');
// Data to inject
var data = {
firstname : 'John',
lastname : 'Doe'
};
// Generate a report using the sample template provided by carbone module
// This LibreOffice template contains "Hello {d.firstname} {d.lastname} !"
// Of course, you can create your own templates!
carbone.render('./node_modules/carbone/examples/simple.odt', data, function(err, result){
if (err) {
return console.log(err);
}
// write the result
fs.writeFileSync('result.odt', result);
});
Carbone uses efficiently LibreOffice to convert documents. Among all tested solutions, it is the most reliable and stable one in production for now.
Carbone does a lot of thing for you behind the scene:
Be careful, LibreOffice which is provided by the PPA libreoffice/ppa does not bundled python (mandatory for Carbone). The best solution is to download the LibreOffice Package from the official website and install it manually:
# remove all old version of LibreOffice
sudo apt remove --purge libreoffice*
sudo apt autoremove --purge
# Download LibreOffice debian package. Select the right one (64-bit or 32-bit) for your OS.
# Get the latest from http://download.documentfoundation.org/libreoffice/stable
# or download the version currently "carbone-tested":
wget https://downloadarchive.documentfoundation.org/libreoffice/old/7.5.1.1/deb/x86_64/LibreOffice_7.5.1.1_Linux_x86-64_deb.tar.gz
# Install required dependencies on ubuntu server for LibreOffice 7.0+
sudo apt install libxinerama1 libfontconfig1 libdbus-glib-1-2 libcairo2 libcups2 libglu1-mesa libsm6
# Uncompress package
tar -zxvf LibreOffice_7.5.1.1_Linux_x86-64_deb.tar.gz
cd LibreOffice_7.5.1.1_Linux_x86-64_deb/DEBS
# Install LibreOffice
sudo dpkg -i *.deb
# If you want to use Microsoft fonts in reports, you must install the fonts
# Andale Mono, Arial Black, Arial, Comic Sans MS, Courier New, Georgia, Impact,
# Times New Roman, Trebuchet, Verdana,Webdings)
sudo apt install ttf-mscorefonts-installer
# If you want to use special characters, such as chinese ideograms, you must install a font that support them
# For example:
sudo apt install fonts-wqy-zenhei
And now, you can use the converter, by passing options to render method.
Don't panic, only the first conversion is slow because LibreOffice must starts Once started, LibreOffice stays on to make new conversions faster
var data = {
firstname : 'John',
lastname : 'Doe'
};
var options = {
convertTo : 'pdf' //can be docx, txt, ...
};
carbone.render('./node_modules/carbone/examples/simple.odt', data, options, function(err, result){
if (err) return console.log(err);
fs.writeFileSync('result.pdf', result);
process.exit(); // to kill automatically LibreOffice workers
});
var data = [
{
movieName : 'Matrix',
actors : [{
firstname : 'Keanu',
lastname : 'Reeves'
},{
firstname : 'Laurence',
lastname : 'Fishburne'
},{
firstname : 'Carrie-Anne',
lastname : 'Moss'
}]
},
{
movieName : 'Back To The Future',
actors : [{
firstname : 'Michael',
lastname : 'J. Fox'
},{
firstname : 'Christopher',
lastname : 'Lloyd'
}]
}
];
carbone.render('./node_modules/carbone/examples/movies.docx', data, function(err, result){
if (err) return console.log(err);
fs.writeFileSync('movies_result.docx', result);
});
carbone.render('./node_modules/carbone/examples/flat_table.ods', data, function(err, result){
if (err) return console.log(err);
fs.writeFileSync('flat_table_result.ods', result);
});
To check out the api reference and the documentation, visit carbone.io.
To checkout out the Carbone CLI documentation, visit carbone.io
If you're facing any issues with this Community Edition, search a similar issue to ensure it doesn't already exist on Github. Otherwhise, create an issue to help us.
The roadmap is pinned on the github issues list.
⚡️ Secret news of 14th Februrary 2023: we are building our own PDF converter, x200 faster than LibreOffice! Stay tuned.
Report generation speed (without network latency), using a basic one-page DOCX template:
10 ms / report without document conversion (analyzing, injection, rendering)50 ms / report with a PDF conversion (100 loops, 3 LibreOffice workers, without cold-start)On a MacBook Pro Mid-2015, 2,2 Ghz i7, 16Go.
There are two editions of Carbone:
The Community Edition is one major version behind the Enterprise Edition. This rule may change in the future.
Our ultimate goal
2% percent of our hosted solution revenues goes to charity
Thanks to all Carbone contributors (random order)
157 followers · starred Oct 2019
118 followers · starred Apr 2024
60 followers · starred Oct 2025
145 followers · starred Oct 2024
Fast and simple report generator, from JSON to pdf, xslx, docx, odt...
See the code⚡️ Fast, Simple and Powerful report generator in any format PDF, DOCX, XLSX, ODT, PPTX, ODS, XML, CSV using templates and your JSON data as input !
Use the latest version (v5+) for free with our Docker Edition:
docker pull carbone/carbone-ee:latest
No license is required to start the On-Premise Docker Edition with the REST API (same API as the Cloud Edition). A license is only required for advanced features. By default, only community features are enabled.
Check out our changelog
This open-source edition, which can be embedded in Node.js, is always one major version behind. We will update it to v4 as soon as possible. Thank you for your patience.
Feel free to contact us via chat if you need further information or professional support.
README language: 🇨🇳 简体中文, 🇺🇸 English
{d.companyName} directly in your documentCarbone is a mustache-like template engine {d.companyName}.
Template language documentation : https://carbone.io/documentation.html
Carbone analyzes your template and inject data in the document. The generated document can be exported as is, or converted to another format (PDF, ...) using LibreOffice if it is installed on the system. Carbone is working only on the server-side.
1 - Install it
npm install carbone
2 - Copy-paste this code in a new JS file, and execute it with node
const fs = require('fs');
const carbone = require('carbone');
// Data to inject
var data = {
firstname : 'John',
lastname : 'Doe'
};
// Generate a report using the sample template provided by carbone module
// This LibreOffice template contains "Hello {d.firstname} {d.lastname} !"
// Of course, you can create your own templates!
carbone.render('./node_modules/carbone/examples/simple.odt', data, function(err, result){
if (err) {
return console.log(err);
}
// write the result
fs.writeFileSync('result.odt', result);
});
Carbone uses efficiently LibreOffice to convert documents. Among all tested solutions, it is the most reliable and stable one in production for now.
Carbone does a lot of thing for you behind the scene:
Be careful, LibreOffice which is provided by the PPA libreoffice/ppa does not bundled python (mandatory for Carbone). The best solution is to download the LibreOffice Package from the official website and install it manually:
# remove all old version of LibreOffice
sudo apt remove --purge libreoffice*
sudo apt autoremove --purge
# Download LibreOffice debian package. Select the right one (64-bit or 32-bit) for your OS.
# Get the latest from http://download.documentfoundation.org/libreoffice/stable
# or download the version currently "carbone-tested":
wget https://downloadarchive.documentfoundation.org/libreoffice/old/7.5.1.1/deb/x86_64/LibreOffice_7.5.1.1_Linux_x86-64_deb.tar.gz
# Install required dependencies on ubuntu server for LibreOffice 7.0+
sudo apt install libxinerama1 libfontconfig1 libdbus-glib-1-2 libcairo2 libcups2 libglu1-mesa libsm6
# Uncompress package
tar -zxvf LibreOffice_7.5.1.1_Linux_x86-64_deb.tar.gz
cd LibreOffice_7.5.1.1_Linux_x86-64_deb/DEBS
# Install LibreOffice
sudo dpkg -i *.deb
# If you want to use Microsoft fonts in reports, you must install the fonts
# Andale Mono, Arial Black, Arial, Comic Sans MS, Courier New, Georgia, Impact,
# Times New Roman, Trebuchet, Verdana,Webdings)
sudo apt install ttf-mscorefonts-installer
# If you want to use special characters, such as chinese ideograms, you must install a font that support them
# For example:
sudo apt install fonts-wqy-zenhei
And now, you can use the converter, by passing options to render method.
Don't panic, only the first conversion is slow because LibreOffice must starts Once started, LibreOffice stays on to make new conversions faster
var data = {
firstname : 'John',
lastname : 'Doe'
};
var options = {
convertTo : 'pdf' //can be docx, txt, ...
};
carbone.render('./node_modules/carbone/examples/simple.odt', data, options, function(err, result){
if (err) return console.log(err);
fs.writeFileSync('result.pdf', result);
process.exit(); // to kill automatically LibreOffice workers
});
var data = [
{
movieName : 'Matrix',
actors : [{
firstname : 'Keanu',
lastname : 'Reeves'
},{
firstname : 'Laurence',
lastname : 'Fishburne'
},{
firstname : 'Carrie-Anne',
lastname : 'Moss'
}]
},
{
movieName : 'Back To The Future',
actors : [{
firstname : 'Michael',
lastname : 'J. Fox'
},{
firstname : 'Christopher',
lastname : 'Lloyd'
}]
}
];
carbone.render('./node_modules/carbone/examples/movies.docx', data, function(err, result){
if (err) return console.log(err);
fs.writeFileSync('movies_result.docx', result);
});
carbone.render('./node_modules/carbone/examples/flat_table.ods', data, function(err, result){
if (err) return console.log(err);
fs.writeFileSync('flat_table_result.ods', result);
});
To check out the api reference and the documentation, visit carbone.io.
To checkout out the Carbone CLI documentation, visit carbone.io
If you're facing any issues with this Community Edition, search a similar issue to ensure it doesn't already exist on Github. Otherwhise, create an issue to help us.
The roadmap is pinned on the github issues list.
⚡️ Secret news of 14th Februrary 2023: we are building our own PDF converter, x200 faster than LibreOffice! Stay tuned.
Report generation speed (without network latency), using a basic one-page DOCX template:
10 ms / report without document conversion (analyzing, injection, rendering)50 ms / report with a PDF conversion (100 loops, 3 LibreOffice workers, without cold-start)On a MacBook Pro Mid-2015, 2,2 Ghz i7, 16Go.
There are two editions of Carbone:
The Community Edition is one major version behind the Enterprise Edition. This rule may change in the future.
Our ultimate goal
2% percent of our hosted solution revenues goes to charity
Thanks to all Carbone contributors (random order)
157 followers · starred Oct 2019
118 followers · starred Apr 2024
60 followers · starred Oct 2025
145 followers · starred Oct 2024