Closed maryglo closed 10 years ago
Don't try with gmail. Try with your own HTML. I've seen pdftk
having problems especially with google sites. Apart from that it's very likely that your problem comes from pdftk
itself, which means: I can't fix it. This is only a wrapper class around the command line tool.
Also check the content of $pdf->getError()
after you tried to save the file.
Same thing happened, I tried $pdf = new Pdf('
hello world
'); I dumped var_dump($pdf); and here's the results, last 5 lines of the dumped variable:protected '_stdErr' => string '' (length=0) protected '_exitCode' => int 0 protected '_error' => string '' (length=0) protected '_executed' => boolean true protected '_error' => string '' (length=0)
Which means that the exec Command was executed, and no error encountered.
Do I need to install something to make this work or I've already done the correct procedures in installing package?
You should really try $pdf->getError()
. The var_dump
doesn't help. Also do $pdf->getCommand()->getExecCommand()
to get the raw output of the shell command.
$pdf->getError() returns string with length 0 which means no error.
You should then first try, if the wkhtmltopdf-amd64
command works on the command line (forget what i said about pdftk
above - i was confused with another project of mine).
Do i need install to something in order to make ti work in the command line?
Yes, please first consult the installation instructions again. You need the wkhtmltopdf
binary on your systems and there are different ways to get that.
I see you've changed the title and you use a WAMP server. I'm sorry, but I can not really assist you how to install wkhtmltopdf
there, as I do not (and never will) use Windows for development. There are Windows executables of wkhtmltopdf
and you first need to make sure, that this works. Then you need to configure the path to that .exe
in the $pdf->binary
property. But in principle this library also works with the windows version.
I already installed the binary using composer, composer require h4cc/wkhtmltopdf-amd64.
Can you give me an example to be executed on the command line?
I know how to install the binary using composer, and I installed it already, now the problem how can I test on the command line.
The composer packages of wkhtmltopdf
are Linux binaries. They will not run on Windows.
Oh, are there composer package for Windows? tried the code that I did on a linux server and I got a Permission denied error to my binary file. This is the part of the code $pdf->binary = base_path(). '/vendor/bin/wkhtmltopdf-i386';
I don't know, if there are composer packages. If you get permission errors, you need to verify the file permissions of the binary file.
But all this is really out of the scope of this library, I can't help you any further here.
Please understand, that I have to close this issue for now, as it is not related to my library. Please consult Google for how to get wkhtmltopdf
working on your system.
Hi, I'm using laravel framework and installed on my local machine (windows OS with wamp server installed, AMD) the package together with the binary using composer. I created a test class. Please see below: use mikehaertl\wkhtmlto\Pdf; class PDFConverter {