0

Will anyone suggest me in setting up the PDFTron with PHP.? I have gone through the documentation and samples available but I'm not able to find a way to work with php. since there are no samples availble for PHP.

ARV
  • 54
  • 6

1 Answers1

1

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.

Ryan
  • 2,473
  • 1
  • 11
  • 14