optimizeDocx

optimizeDocx

ADVANCED / PREMIUM BASIC

Optimizes a DOCX.

Description
public optimizeDocx (string $source, string $target, [, array $options])

This method optimizes DOCX documents.

Parameters

source

The path to the source Word document.

target

The path to the Word document output.

options

The possible keys and values are:

Key Type Description
compressionMethod string 'default', 'store' or 'deflate' use CM_DEFAULT, CM_STORE (uncompressed) or CM_DEFLATE to save the file. Default as 'default'. Needs php 7.0 or newer.
extraAttributes bool Remove not needed attributes in the XML files. Default as false. The default value is false.
imageFiles bool Optimize image files. The default value is true.
imageFilesToJpegLevel int Optimize all image files transforming them to jpeg. Default as null, set quality value (70, 90...).
xmlFiles bool Optimize XML files. The default value is true.
Code samples

Example #1