有人会建议我用 PHP 设置 PDFTron 吗?我已经浏览了可用的文档和示例,但我无法找到使用 php 的方法。因为没有可用于 PHP 的示例。
问问题
475 次
1 回答
0
All samples include PHP sample code and shell scripts to run them. Though, first you need to generate PHP bindings for your environment using latest SWIG and CMAKE.
For full instructions see the PDFNetWrappers GitHub page.
Suppose you wanted to build and run the 64-bit PHP wrappers. You could run the following set of commands:
- mkdir wrappers_build # Make a directory to build the wrappers in.
- cd wrappers_build # Move to that directory.
- git clone https://github.com/PDFTron/PDFNetWrappers # Git the code.
- cd PDFNetWrappers/PDFNetC # Move to where we download PDFNet.
- wget http://www.pdftron.com/downloads/PDFNetC64.tar.gz # Download PDFNet.
- tar xzvf PDFNetC64.tar.gz # Unpack PDFNet.
- mv PDFNetC64/Headers/ . # Move PDFNet Headers/ into place.
- mv PDFNetC64/Lib/ . # Move PDFNet Lib/ into place.
- cd .. # Go back up.
- mkdir Build # Create a directory to create the Makefiles in.
- cd Build # Move to that directory.
- cmake -D BUILD_PDFNetPHP=ON .. # Create the Makefiles with CMake.
- make # Build the PHP wrappers with SWIG.
- make install # Copy the PHP wrappers to where the samples can find them.
- cd ../Samples # Move to the Samples directory.
- ./runall_php.sh # Run all PHP code samples, using the new wrappers.
Once this is done. You can download full PHP samples from GitHub. Then either run Samples/runall_php.sh
or the RunTest.sh
script in any of the PHP sample folders.
于 2015-09-28T16:23:28.680 回答