PHP Classes

WKHTMLTOPDF support

Recommend this page to a friend!

      WKHTMLTOPDF HTML to PDF creator  >  All threads  >  WKHTMLTOPDF support  >  (Un) Subscribe thread alerts  
Subject:WKHTMLTOPDF support
Summary:Support with installation and WK parameters
Messages:39
Author:PHP-4-Business
Date:2012-04-11 07:51:43
Update:2014-01-10 12:54:43
 
  1 - 10   11 - 20   21 - 30   31 - 39  

  1. WKHTMLTOPDF support   Reply   Report abuse  
Picture of PHP-4-Business PHP-4-Business - 2012-04-11 07:51:43
I hope you find this class useful.

If you need support on installing or using the WKHTMLTOPDF program then please go to the project home page here:
code.google.com/p/wkhtmltopdf/

If you need support on installing the PHP extension then please go to the home page here:
github.com/mreiferson/php-wkhtmltox

The parameters for the binary program are here :
madalgo.au.dk/~jakobt/wkhtmltoxdoc/ ...

The parameters for the PHP extension library are here :
cs.au.dk/~jakobt/libwkhtmltox_0.10. ...


Thank you



  2. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of Rohit Kumar Rohit Kumar - 2012-04-11 13:17:21 - In reply to message 1 from PHP-4-Business
Thanks for such a wonderful post.

php Training Programs | Learn php Ahmedabad

  3. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of Niek Reus Niek Reus - 2012-05-31 21:35:33 - In reply to message 1 from PHP-4-Business
Hello,

I followed the instructions as described in compile_phpwkhtmltox. It all went well, but in step 5 trying the command

./configure --with-phpwkhtmltox=/tmp/wkhtmltopdf-0.11.0_rc1

I got the following output:

/tmp/mreiferson-php-wkhtmltox-fa6208e$ ./configure --with-phpwkhtmltox=/tmp/wkhtmltopdf-0.11.0_rc1
checking for egrep... grep -E
checking for a sed that does not truncate output... //bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-redhat-linux-gnu
checking host system type... i686-redhat-linux-gnu
checking target system type... i686-redhat-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
configure: error: libwkhtmltox version 0.10 or later required
checking if zts is enabled... no
checking for re2c... no
checking for gawk... gawk
checking for libwkhtmltox support... yes, shared
found in /tmp/wkhtmltopdf-0.11.0_rc1
found in /usr/local
checking for wkhtmltopdf_init in -lwkhtmltox... no

So there is a WARNING and an error. The next command

make

Gave as result:

/tmp/mreiferson-php-wkhtmltox-fa6208e$ make
make: *** No targets specified and no makefile found. Stop.

What can I do to make this work?

Thanks for your reply,
Niek

  4. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of PHP-4-Business PHP-4-Business - 2012-06-01 07:47:34 - In reply to message 3 from Niek Reus
Hi Niek,

The Warning is ok but it looks like configure script can't find your libwkhtmltox (from step 3).

You may need to specify the library location - try running

./configure --with-phpwkhtmltox=/tmp/wkhtmltopdf-0.11.0_rc1 'LDFLAGS=-L/usr/local/lib'

Regards,
Geoff

  5. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of Niek Reus Niek Reus - 2012-06-01 09:43:43 - In reply to message 4 from PHP-4-Business
Hi Geoff,

Thanks for your reply. Unfortunately the alternative command didn't work either. But now that you mention step 3, I encountered some problems there too which I thought I had solved. First of all it says that I should run the following command to copy the library to my libraries directory:

cp /tmp/libwkhtmltox-0.11.0_rc1-i386/lib/libwkhtmltox.so /usr/local/lib

This didn't work, because /tmp/libwkhtmltox-0.11.0_rc1-i386/lib/libwkhtmltox.so doesn't exist. But /tmp/lib/libwkhtmltox.so does exist, so instead I ran

cp /tmp/lib/libwkhtmltox.so /usr/local/lib

Then I should copy the library headers to my headers directory:

cp -v /tmp/include/wkhtmltox /usr/local/include/wkhtmltox

This gave the following output:

cp: omitting directory `/tmp/include/wkhtmltox'

I must say that I don't know what -v means here. The folder wkhtmltox was not pasted into /usr/local/include. So I copied and pasted the folder there by hand using WinSCP to get access to the folders on my server. All those commands I also made within WinSCP.

I hope you can give me some advice here.

Best regards,
Niek


  6. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of PHP-4-Business PHP-4-Business - 2012-06-01 10:47:15 - In reply to message 5 from Niek Reus
My mistake sorry. Use:

cp -vR /tmp/include/wkhtmltox /usr/local/include/wkhtmltox

to avoid the "omitting directory" error.

  7. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of Niek Reus Niek Reus - 2012-06-01 13:12:15 - In reply to message 6 from PHP-4-Business
Thanks for the correction, Geoff. I was able paste the wkhtmltox folder into /usr/local/lib using this new command.

Is the other code I mentioned

cp /tmp/libwkhtmltox-0.11.0_rc1-i386/lib/libwkhtmltox.so /usr/local/lib

totally correct but not working due to a mistake of mine during previous steps, or should this be corrected too?

Unfortunately the code

./configure --with-phpwkhtmltox=/tmp/wkhtmltopdf-0.11.0_rc1 'LDFLAGS=-L/usr/local/lib'

still gives the same error. This is the output:

/tmp/mreiferson-php-wkhtmltox-fa6208e$ ./configure --with-phpwkhtmltox=/tmp/wkhtmltopdf-0.11.0_rc1 'LDFLAGS=-L/usr/local/lib'
checking for egrep... grep -E
checking for a sed that does not truncate output... //bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-redhat-linux-gnu
checking host system type... i686-redhat-linux-gnu
checking target system type... i686-redhat-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/modules
checking for PHP installed headers prefix... /usr/include/php
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
checking for gawk... gawk
checking for libwkhtmltox support... yes, shared
found in /tmp/wkhtmltopdf-0.11.0_rc1
found in /usr/local
configure: error: libwkhtmltox version 0.10 or later required
checking for wkhtmltopdf_init in -lwkhtmltox... no

I hope you can help me.

Best regards,
Niek


  8. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of PHP-4-Business PHP-4-Business - 2012-06-01 15:41:36 - In reply to message 7 from Niek Reus
The other line had an incorrect path - I've since corrected both in the installation notes.


Ref the configure error, this of course isn't really an issue with the PHP class but I'll try to help you.

> I was able paste the wkhtmltox folder into /usr/local/lib using this new command.

Note that the wkhtmltox should go into /usr/local/include (not /usr/local/lib ). You can check it's location with

find / -name wkhtmltox


You should get a reply something like:
/tmp/wkhtmltopdf-0.11.0_rc1/include/wkhtmltox
/usr/local/include/wkhtmltox




  9. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of Niek Reus Niek Reus - 2012-06-05 23:38:16 - In reply to message 8 from PHP-4-Business
Hi George,

I downloaded your files again to get the right installation notes. I followed the installation procedure again up to 5) where

./configure --with-phpwkhtmltox=/tmp/wkhtmltopdf-0.11.0_rc1

as well as

./configure --with-phpwkhtmltox=/tmp/wkhtmltopdf-0.11.0_rc1 'LDFLAGS=-L/usr/local/lib'

gave the same error:

configure: error: libwkhtmltox version 0.10 or later required

The code

find / -name wkhtmltox

gave as a result

/usr/local/include/wkhtmltox
/usr/local/include/wkhtmltox/wkhtmltox
/tmp/include/wkhtmltox
/tmp/wkhtmltopdf-0.11.0_rc1/include/wkhtmltox

Any suggestions what else I could do? I figure that the version I try to compile is 0.11.0 which seems to be a later version than 0.10.

Thanks for your help,
Niek

  10. Re: WKHTMLTOPDF support   Reply   Report abuse  
Picture of PHP-4-Business PHP-4-Business - 2012-06-06 08:39:25 - In reply to message 9 from Niek Reus
What do you get from

find / -name libwkhtmltox.*



 
  1 - 10   11 - 20   21 - 30   31 - 39