Skip to content
ComPDF
DemoFAQ
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

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

  1. Open a terminal and navigate to the root of the ComPDF Conversion PHP SDK package.
  2. Run the bundled runner:
bash
samples/run.sh

Successful 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 succeeded

Output 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.php

samples/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.