All Projects → sujith3g → Docxtemplater Link Module

sujith3g / Docxtemplater Link Module

Licence: mit
⚓️ Hyperlink module for docxtemplater

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Docxtemplater Link Module

Docxtemplater
Generate docx pptx and xlsx (Microsoft Word, Powerpoint, Excel documents) from templates, from Node.js, the Browser and the command line / Demo: https://www.docxtemplater.com/demo
Stars: ✭ 1,990 (+16483.33%)
Mutual labels:  powerpoint, docx
opentbs
With OpenTBS you can merge OpenOffice - LibreOffice and Ms Office documents with PHP using the TinyButStrong template engine. Simple use OpenOffice - LibreOffice or Ms Office to edit your templates : DOCX, XLSX, PPTX, ODT, OSD, ODP and other formats. That is the Natural Template philosophy.
Stars: ✭ 48 (+300%)
Mutual labels:  template-engine, docx
Unioffice
Pure go library for creating and processing Office Word (.docx), Excel (.xlsx) and Powerpoint (.pptx) documents
Stars: ✭ 3,111 (+25825%)
Mutual labels:  powerpoint, docx
Blade
🚀 Lightning fast and elegant mvc framework for Java8
Stars: ✭ 5,569 (+46308.33%)
Mutual labels:  template-engine
Koa Views
Template rendering middleware for koa (hbs, swig, pug, anything! ✨)
Stars: ✭ 682 (+5583.33%)
Mutual labels:  template-engine
Bars
Bars is a lightweight high performance HTML aware templating engine. Bars emits DOM rather than DOM-strings, this means the DOM state is preserved even if data updates happen.
Stars: ✭ 5 (-58.33%)
Mutual labels:  template-engine
Vscode Smarty
Smarty syntax highlight extension for Visual Studio Code
Stars: ✭ 10 (-16.67%)
Mutual labels:  template-engine
Handlebars Rust
Rust templating with Handlebars
Stars: ✭ 632 (+5166.67%)
Mutual labels:  template-engine
Spring Velocity Support
An support project of legacy velocity based on Spring Framework
Stars: ✭ 22 (+83.33%)
Mutual labels:  template-engine
Gorazor
Razor view engine for go
Stars: ✭ 772 (+6333.33%)
Mutual labels:  template-engine
Dot Dom
.dom is a tiny (512 byte) template engine that uses virtual DOM and some of react principles
Stars: ✭ 757 (+6208.33%)
Mutual labels:  template-engine
Inja
A Template Engine for Modern C++
Stars: ✭ 715 (+5858.33%)
Mutual labels:  template-engine
Hamlit
High Performance Haml Implementation
Stars: ✭ 898 (+7383.33%)
Mutual labels:  template-engine
Phpword
A pure PHP library for reading and writing word processing documents
Stars: ✭ 6,017 (+50041.67%)
Mutual labels:  docx
React Docx
React reconciler for DOCX.js.
Stars: ✭ 23 (+91.67%)
Mutual labels:  docx
Liquidjs
A simple, expressive, safe and Shopify compatible template engine in pure JavaScript.
Stars: ✭ 638 (+5216.67%)
Mutual labels:  template-engine
React email editor
This project is experimental! It's my attempt to create visual email template editor using React+Redux+etc... tools stack.
Stars: ✭ 19 (+58.33%)
Mutual labels:  template-engine
Jet
Jet template engine
Stars: ✭ 756 (+6200%)
Mutual labels:  template-engine
Docconv
Converts PDF, DOC, DOCX, XML, HTML, RTF, etc to plain text
Stars: ✭ 735 (+6025%)
Mutual labels:  docx
Selmer
A fast, Django inspired template system in Clojure.
Stars: ✭ 801 (+6575%)
Mutual labels:  template-engine

docxtemplater-link-module

Hyperlink module for docxtemplater

Download count ghit.me Build Status

Installation:

You will need docxtemplater v2.1.1: npm install docxtemplater

Install this module: npm install docxtemplater-link-module

Usage: Text and URL

The example below will displays the following hyperlink:

Lorem ipsum dolor sit amet.

Your docx should contain the text: Lorem ipsum {^link} amet..

var fs = require('fs');
var content = fs.readFileSync(__dirname + "/example-href.docx", "binary");
var DocxGen = require('docxtemplater');
var LinkModule = require('docxtemplater-link-module');
var linkModule = new LinkModule();
 
var docx = new DocxGen()
	.attachModule(linkModule)
	.load(content)
	.setData({
		link : {
			text : "dolor sit",
			url : "http://google.com"
		}
	}).
	render();
var buffer = docx
	.getZip()
	.generate({type:"nodebuffer"});
fs.writeFile("test.docx", buffer);

Usage: URL only

The example below will displays the following hyperlink:

Lorem ipsum http://google.com amet.

Your docx should contain the text: Lorem ipsum {^link} amet..

var fs = require('fs');
var content = fs.readFileSync(__dirname + "/example-href.docx", "binary");
var DocxGen = require('docxtemplater');
var LinkModule = require('docxtemplater-link-module');
var linkModule = new LinkModule();
 
var docx = new DocxGen()
	.attachModule(linkModule)
	.load(content)
	.setData({
		link : "http://google.com"
	}).
	render();
var buffer = docx
	.getZip()
	.generate({type:"nodebuffer"});
fs.writeFile("test.docx", buffer);

Usage: Email address support

The example below will displays the following hyperlink:

Lorem ipsum [email protected] amet.

Your docx should contain the text: Lorem ipsum {^link} amet..

var fs = require('fs');
var content = fs.readFileSync(__dirname + "/example-mailto.docx", "binary");
var DocxGen = require('docxtemplater');
var LinkModule = require('docxtemplater-link-module');
var linkModule = new LinkModule();
 
var docx = new DocxGen()
	.attachModule(linkModule)
	.load(content)
	.setData({
		link : "[email protected]"
	}).
	render();
var buffer = docx
	.getZip()
	.generate({type:"nodebuffer"});
fs.writeFile("test.docx", buffer);

Usage: Text and URL in powerpoint pptx

The example below will displays the following hyperlink powerpoint:

Lorem ipsum dolor sit amet.

Your pptx should contain the text: Lorem ipsum {^link} amet..

var fs = require('fs');
var content = fs.readFileSync(__dirname + "/example-href.pptx", "binary");
var DocxGen = require('docxtemplater');
var LinkModule = require('docxtemplater-link-module');
var linkModule = new LinkModule();
 
var docx = new DocxGen()
	.attachModule(linkModule)
	.setOptions({ fileType : "pptx" })
	.load(content)
	.setData({
		link : {
			text : "dolor sit",
			url : "http://google.com"
		}
	}).
	render();
var buffer = docx
	.getZip()
	.generate({type:"nodebuffer"});
fs.writeFile("output-href.pptx", buffer);

Usage: Email address support in powerpoint

The example below will displays the following hyperlink:

Lorem ipsum [email protected] amet.

Your pptx should contain the text: Lorem ipsum {^link} amet..

var fs = require('fs');
var content = fs.readFileSync(__dirname + "/example-mailto.pptx", "binary");
var DocxGen = require('docxtemplater');
var LinkModule = require('docxtemplater-link-module');
var linkModule = new LinkModule();
 
var docx = new DocxGen()
	.attachModule(linkModule)
	.setOptions({ fileType : "pptx" })
	.load(content)
	.setData({
		link : "[email protected]"
	}).
	render();
var buffer = docx
	.getZip()
	.generate({type:"nodebuffer"});
fs.writeFile("output-mailto.pptx", buffer);

Testing

You can test that everything works fine using the command mocha. This will also create 2 docx files under the root directory that you can open to check if the docx are correct

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].