How to Run a Demo
ComPDF Conversion SDK provides demos in the "samples" folder. Before running the demo, make sure PHP 7.4+ and ext-ffi are available.
Linux
- Open a terminal and navigate to the root of the ComPDF Conversion PHP SDK package.
- Run the bundled runner:
bash
samples/run.shSuccessful output is similar to:
text
SDK version: 4.1.0
pdf to word: 0
pdf to excel: 0
pdf to ppt: 0
pdf to csv: 0
pdf to html: 0
pdf to rtf: 0
pdf to image: 0
pdf to txt: 0
pdf to json: 0
pdf to markdown: 0
pdf to searchable pdf: 0
pdf to ofd: 0
OK: all conversion smoke tests succeededOutput files (Word, Excel, PowerPoint, etc.) will be generated in the "samples/output_files" folder.
You can also run a single PHP script through the sample launcher:
bash
samples/compdfphp samples/version.php
samples/compdfphp samples/direct_convert_demo.phpsamples/compdfphp configures LD_LIBRARY_PATH and uses LD_PRELOAD to load the native dependencies before the PHP process starts, which avoids native loading-order issues caused by lazy FFI loading.