All Projects → wrklst → docxmustache

wrklst / docxmustache

Licence: MIT License
laravel 8.x docx template manipulation class, based on mustache templating language

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to docxmustache

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 (+5752.94%)
Mutual labels:  word, docx, docxtemplater
Poi Tl
Generate awesome word(docx) with template
Stars: ✭ 2,306 (+6682.35%)
Mutual labels:  word, docx
Phpstamp
The XSL-way templating library for MS Office Word DOCX documents.
Stars: ✭ 150 (+341.18%)
Mutual labels:  word, docx
craXcel-cli
Command line application to unlock Microsoft Office password protected files.
Stars: ✭ 44 (+29.41%)
Mutual labels:  word, microsoft-word
Etherpad Lite
Etherpad: A modern really-real-time collaborative document editor.
Stars: ✭ 11,937 (+35008.82%)
Mutual labels:  word, docx
Net Core Docx Html To Pdf Converter
.NET Core library to create custom reports based on Word docx or HTML documents and convert to PDF
Stars: ✭ 133 (+291.18%)
Mutual labels:  word, docx
VueXcode
Syntax highlighting for .Vue components and .mustache templates in Xcode
Stars: ✭ 25 (-26.47%)
Mutual labels:  mustache, mustache-templates
Superfileview
基于腾讯浏览服务Tbs,使用X5Webkit内核,实现文件的展示功能,支持多种文件格式
Stars: ✭ 1,115 (+3179.41%)
Mutual labels:  word, docx
ocaml-mustache
mustache.js logic-less templates in OCaml
Stars: ✭ 74 (+117.65%)
Mutual labels:  mustache, mustache-templates
wordroller
Free Microsoft Word document (aka .docx) processing library for .Net
Stars: ✭ 17 (-50%)
Mutual labels:  word, docx
Version3
Version 3 of Chem4Word - A Chemistry Add-In for Microsoft Word
Stars: ✭ 53 (+55.88%)
Mutual labels:  microsoft-word, openxml
Docx
Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
Stars: ✭ 2,150 (+6223.53%)
Mutual labels:  word, docx
Sharpdocx
C# based template engine for generating Word documents
Stars: ✭ 100 (+194.12%)
Mutual labels:  word, docx
npoi
a .NET library that can read/write Office formats without Microsoft Office installed. No COM+, no interop.
Stars: ✭ 4,493 (+13114.71%)
Mutual labels:  word, openxml
Js Word
✒️ Word Processing Document Library
Stars: ✭ 1,203 (+3438.24%)
Mutual labels:  word, docx
Documentserver
ONLYOFFICE Document Server is an online office suite comprising viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
Stars: ✭ 2,335 (+6767.65%)
Mutual labels:  word, docx
Desktopeditors
An office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents
Stars: ✭ 1,008 (+2864.71%)
Mutual labels:  word, docx
Documentbuilder
ONLYOFFICE Document Builder is powerful text, spreadsheet, presentation and PDF generating tool
Stars: ✭ 61 (+79.41%)
Mutual labels:  word, docx
officeexport-java
三行代码导出自定义样式word
Stars: ✭ 68 (+100%)
Mutual labels:  word, docx
sarna
Security Assessment Report geNerated Automatically
Stars: ✭ 26 (-23.53%)
Mutual labels:  reporting, docx

DocxMutache Logo

DocxMustache for Laravel 6.0.

Software License Quality Score Build Status StyleCI

Docx template manipulation class for Laravel 6.0, based on mustache templating language. This class is still under heavy development and works more like proof of concept at the moment. Things will change quickly and might break things.

Template Example in Word This package helps you to use docx files with mustache syntax as templates to merge richly styled documents with information from any data source. It can replace text and images and supports basic html styling (bold, itallic, underline).

Installation

composer require wrklst/docxmustache

Please check depencies down below and examples folder for configuration and usage.

HTML conversion

Current HTML conversion is basic and only supports singular runs of bold, italic and underlined text and no combination of these. It requires all values non html to be escaped with htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); and a prefix of *[[DONOTESCAPE]]* so the class knows not to escape the html before it is converted to openXML.

Replacing images

The image needs to be a reachable URL with a image in a supported format. The url value needs to be placed into the alt text description field of the image. Images will be resampled to the constraints of the placeholder image. The Image value needs to be formated the with pseudo tags around, such as: [IMG-REPLACE]http://placehold.it/350x150[/IMG-REPLACE]

Example

Please also checkout the example in the example folder to get a basic understand of how to use this class.

DOCX to PDF conversion

Conversion to PDF requires libreoffice-common to be installed on the server (used for conversion). Use sudo apt install libreoffice-common on your ubuntu/debian based server. Also install ttf-mscorefonts if you need support for Arial font when converting docx documents to pdf sudo apt-get install ttf-mscorefonts-installer

Other Dependencies

The package is dependent on several Laravel specific functions. It could easily be ported to other frameworks or be ported to be framework agnostic. In addition to the Laravel dependency, the page uses the following packages:

Laravel specific dependencies (only relevant if ported into non Laravel environment):

Contributions

If you would like to contribute something to this package, please feel free to make a pull request and a corresponding issue and we will be happy to review and discuss.

Why another openXML / docx template solution?

There are some classes out there that help with writing and or changing the content of word documents, some with commercial licenses and some free. For our particular purpose we did not need most of the features many of the libraries out there have – we needed a simple solution that would allow to replace values and images and traverse through data in a easy and straightforward manner.

Many of the other libraries use cloning to repeat a block with some custom templating syntax instead of using a existing template syntax. We use the usual mustache syntax, also to achieve repeating content in as many dimensions as needed.

Other PHP Classes to manipulate openXML word documents:

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].