Format Conversion (LibreOffice)
Word-to-PDF conversion is executed by the LibreOffice engine and is a resource-intensive operation. Its performance is significantly affected by CPU, memory, disk IO, file size, and document complexity, and may fluctuate considerably.
To ensure service stability, when ldoc is deployed independently, it is recommended to keep the conversion concurrency within the number of physical CPU cores, leaving some headroom. A practical upper bound is the number of physical CPU cores minus 2. For example, on an 8-core (8C) server, the number of concurrent conversion tasks should not exceed 6 (8 - 2 = 6).
The actual concurrency limit should be determined after thorough stress testing and capacity evaluation based on your business document samples.
I. LibreOffice Deployment
For detailed installation and configuration steps, refer to: How to Deploy LibreOffice Service
II. Enabling PDF Conversion Based on LibreOffice
Set the environment variable ENV_PDF_CONVERT_TYPE in the YAML configuration file of the corresponding microservice application, then restart the service.
ENV_PDF_CONVERT_TYPE: "libreoffice"
If the microservice is deployed in cluster mode or the file service operates in an independent deployment mode, you need to add the following environment variable to the microservice configuration file:
ENV_HAP_INTRANET_CROSS_ENDPOINT: "192.168.0.10:8880"
Note: The value of this environment variable is the intranet access address for the HAP microservice. Make sure the file server can access the microservice through this address; otherwise, the PDF conversion feature will fail to execute.