JSON API - transform
transform
PREMIUM
TRIAL / ADVANCED
Transforms spreadsheets into other formats (XLSX, PDF, XLS, ODS).
Note
You are reading the JSON API documentation. For the PHP API method please go to transform.
JSON data
| Key | Description |
|---|---|
| document | Document to transform. Path to the local document, Base64 string, or URL. |
| targetFormat | The target format for the transformation. Available formats: "xls", "xlsx", "ods", "pdf", "csv". |
| method | Method used to transform the document: "libreoffice". |
"libreoffice" method options:
| Key | Description |
|---|---|
| escapeshellarg | False by default. Applies escapeshellarg to escape source and LibreOffice path strings. |
| conversionExtraOptions | Default as empty. Add extra options to the conversion command line. For example to transform all sheets to CSV. |
| homeFolder | Set a custom home folder to be used for the conversions. |
| outdir | Set the outdir path. Useful when the output path is not the same than the source path. |
| path | Sets the LibreOffice path. This option can be used instead of the path option in config/phpxlsxconfig.ini. |
| recalcFunctions | Recalcs functions when transforming to PDF. Default as false. Check the macros-libreoffice folder included in Advanced and Premium packages to use this option. |
Code samples
Example #1
Release notes
- phpxlsx 6.0:
- new action.