Download the PHP package enflow/document-replacer without Composer

On this page you can find all versions of the php package enflow/document-replacer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package document-replacer

Modify docx templates and convert them to PDF

Latest Version on Packagist Build Status Total Downloads

The enflow/document-replacer package provides a easy way to modify docx templates, replace text and save it. Adds the ability to export it to PDF trough unoserver/unoconvert.

Installation

You can install the package via composer:

PDF conversion

This package comes with an implementation to convert docx templates to PDF using unoserver. You can install this on your machine globally using:

Converters

It's highly recommend using the new unoconvert converter. If you are unable to upgrade, we still provide the deprecated UnoconvConverter for the time being. UnoconvConverter is deprecated and will be removed in 3.0.

Server

Unoserver works together with unoconvert. Unoserver runs as a daemon on the server, and unoconvert connects through it to pass the files. To see why this is more efficient, see https://github.com/unoconv/unoserver/#overview

Start the server with: unoserver --daemon

It's recommended setting this up with a server like supervisord, without the --daemon flag, to auto restart the process if needed.

Usage

Images

If you wish to replace images in your document, you can pass the Image class to the replacement array like this:

The search-pattern model for images can be like:

More info can be found in the PHPWord documentation

Non-default server options

Running the server on non-default options (IP 127.0.0.1 / port 2002)? You can pass along the interface and port to the UnoserverConverter:

Testing

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

About Enflow

Enflow is a digital creative agency based in Alphen aan den Rijn, Netherlands. We specialize in developing web applications, mobile applications and websites. You can find more info on our website.

License

The MIT License (MIT). Please see License File for more information.


All versions of document-replacer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
phpoffice/phpword Version ^0.18.2|^1.0
symfony/process Version ^6.0|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package enflow/document-replacer contains the following files

Loading the files please wait ....