Q: I'm evaluating PDFTron for use with an application I'm building for
a client. I'm interested in testing the ElementBuilder functionality
(to build, stamp, and edti PDF from PHP). But when I run the PHP
example on my local Windows machine, I receive an error. Fatal error:
Call to undefined function PDFNet_Initialize() in C:\wamp\bin\PDFNetC
\Lib\PDFNetPHP.php on line 15608
This is a Windows 7 machine running WAMP although our production
machine will be a Linux installation.
Any ideas that could help me determining the source of this error so I
can continue evaluating?
----------------
A:
How did you run PHP example on Windows? I assume that you copied
PDFNetPHP.php and samples from Linux since at this very moment PHP is
not officialy supported on Windows
.
You can download an unofficial pre-release Windows version of PDFNet
for PHP using the following link:
http://www.pdftron.com/IDR49Z9-B31B/PDFNetPHP.zip
This set of libraries are tested with the PHP 5.3.6 thread safe
version.
The php_PDFNetPHP.dll (from PDFNet/Lib folder) can be loaded like any
other PHP extension by placing it in the ext folder of the PHP install
directory, and adding the line "extension=php_PDFNetPHP.dll" to
php.ini.
The PDFNetC.dll should be placed in the Windows/System32 or any other
folder that can be accessed by php_PDFNetPHP.dll. Please let us know
how this works for you.
Below are the steps I used to get PDFNet for PHP working on Abyss Web
Sever X1 on Windows XP:
1) Install VC 10 runtime (in not present on the machine). You can
obtain it from the following link:
http://www.microsoft.com/download/en/details.aspx?id=8328
2) Installed Abyss Web Sever X1.
3) Installed the preconfigured Abyss PHP 5 package for Windows from
http://www.aprelium.com/data/php536.exe.
4) Followed instructions on http://www.aprelium.com/abyssws/php5win.html
to configure Abyss with PHP.
5) Donwloaded PDFNet SDK with PHP extension from:
http://www.pdftron.com/IDR49Z9-B31B/PDFNetC.zip
6) Copied PDFNetC/Lib and PDFNetC/Samples folder to the htdocs folder
in your Abyss install directory (eg. C:\Program Files\Abyss Web Server
\htdocs).
7) Modified php.ini file in Abyss PHP 5 installation directory to add
"extension=php_PDFNetPHP.dll" (eg. C:\Program Files\PHP5\php.ini)
8) Copied php_PDFNetPHP.dll to the PHP5 installation directory, and
PDFNetC.dll to C:\WINDOWS\system32.
9) Restart the server
10) Navigate to the StamperTest in the web browser (eg.
http://localhost/Samples/StamperTest/PHP/StamperTest.php)
The web browser should print "Done." at this point. You should find
the output files in the Samples/TestFiles/Output folder (eg.
http://localhost/Samples/TestFiles/Output/).
Q: I am trying to make this work using Apache and not having much luck.
I have copied PDFNetC.dll l to the windows/system32 folder.
I have copied the php_PDFNet.dl to the PHP install folder (c:\program files\php\ext)
I have added “extension=php_PDFNet.dll” to the php.ini file
I have restarted the server
When Apache tries to start I get the following error:
PHP Startup
Unable to load dynamic link library c:\program files\php\ext\php_PDFNet.dll - Specified module not found.
Do you have any ideas of what could possibly be wrong? The file is in the path specified
A: With some Apache servers the problem is that it uses older VC6 distribution of PHP instead of VC9.
In this case you would need to reference and use ‘php_PDFNetVC6.dll’ instead of ‘php_PDFNet.dll’.
I used steps from here,
https://github.com/PDFTron/PDFNetWrappers
for linux system and php 5.6. When i am running ./runall_php.sh, i am getting error as bellow
PHP Fatal error: Call to undefined function PDFNet_Initialize()
Any idea . . ? how i can solve this.