Floating in CakePdf



is it possible that floating in CakePdf doesn’t work?

I want to create this:

<div style="float: right;">
        <img  src="img/logo.png" />

but it doesn’t work (the div doesn’t move).

On the other hand something like this work:


What is the problem?

Thanks for help



It depends on the rendering engine that you are using. WkHTMLToPDF supports floats (Since it uses the webkit rendering engine in the background), but the others do not support it.


thanks fot the answer,

I put the code in the bootstrap:

Configure::write('CakePdf', array(
'engine' => 'CakePdf.WkHtmlToPdf',
'orientation' => 'portrait',
'download' => true


and in \Plugin\CakePdf\Pdf\Engine is the WkHtmlToPdfEngine.php.

but it doesn’t work.

How can i see which engine is loaded?



i have to write the path for the WkHtmlToPdf.exe in Configure like that:

‘binary’ => ‘files/wkhtmltopdf.exe’

Now the file is discover.

But now i get the message:

WKHTMLTOPDF didn’t return any data

If i change the engine to: 'CakePdf.DomPdf_ it works, but without the floating.

Why there are no any data?


What happens if you run wkhtmltopdf manually in command prompt?


Good morning dakota,

i get the message

Uncaught ReferenceError: wkhtmltopdf is not defined
at :1:1

Thats the output from StackTrace:

Stack Trace
APP\Plugin\CakePdf\Pdf\CakePdf.php line 236 → WkHtmlToPdfEngine->output()

    $output = $Engine->output();

APP\Plugin\CakePdf\View\PdfView.php line 97 → CakePdf->output(string)

    $this->Blocks->set('content', $this->renderer()->output($content));

    return $this->Blocks->get('content');

CORE\Cake\Controller\Controller.php line 963 → PdfView->render(null, null)

    $this->autoRender = false;
    $this->response->body($this->View->render($view, $layout));

    return $this->response;

CORE\Cake\Routing\Dispatcher.php line 200 → Controller->render()

    if ($render && $controller->autoRender) {
        $response = $controller->render();

    } elseif (!($result instanceof CakeResponse) && $response->body() === null) {

CORE\Cake\Routing\Dispatcher.php line 167 → Dispatcher->_invoke(PropertiesController, CakeRequest)

    $response = $this->_invoke($controller, $request);

    if (isset($request->params['return'])) {

APP\webroot\index.php line 111 → Dispatcher->dispatch(CakeRequest, CakeResponse)
new CakeRequest(),
new CakeResponse()