5

I am using the laravel php framework, version 4.1 and the wkhtml2pdf package. I am using the following code in routes.php:

Route::get('/test/export', function() {
    return PDF::url('http://google.com');
});

But I get this error saying WKHTMLTOPDF didn't return any data: Error I get I also tried using an internal view like this:

Route::get('/test/export', function() {
    return PDF::html('Auth.home');
});

But I got the same error I have also tried giving my whole project recursive permissions and that did not fix it either. I am running OS X 10.9 on a 2011 macbook pro and using mamp

6
  • 1
    aren't there any config where you set something like this? or why not try to debug it. this might help.. Dec 27, 2013 at 22:06
  • 1
    @reikyoushin I am using the laravel framework. I don't have to include() anything because it is set in app/config/apps.php to automatically load it. If that was the problem it would give me an unknown function error.
    – 735Tesla
    Dec 27, 2013 at 22:09
  • 1
    Can you try this on a local page? It strikes me that you may not be allowed to do this to external pages without additional configuration. Dec 27, 2013 at 22:33
  • 1
    @JamesBinford remote includes was disabled in my config but I enabled it and tried using an internal view and I get the same exact error.
    – 735Tesla
    Dec 27, 2013 at 22:37
  • 1
    If you're using it on an internal view, you'll have to use return PDF::html(); Can you try that and see if it errors out? Dec 27, 2013 at 22:49

1 Answer 1

3

I see this in the Troubleshooting manual for this package:

1. Some users have noted a strange permissions issue executing the drivers. Try chmod'ing the driver files to solve the issue.

Have you given this a shot?

5
  • 1
    I tried chmod -R 777 ./ from inside my project directory and did a hard server restart. I still get the same error. I know recursive permissions are dangerous so I have changed them back now.
    – 735Tesla
    Dec 27, 2013 at 22:56
  • 1
    I'm sure Laravel's logs will just say what's displayed in the Debug stack. Anything in Apache's logs? (Or your OS of choice's logs?) Dec 27, 2013 at 23:05
  • 1
    stabs self Has this helped at all? github.com/aur1mas/Wkhtmltopdf/issues/8 Dec 27, 2013 at 23:12
  • That was a windows file path related issue I am running MAMP on OS X 10.9
    – 735Tesla
    Dec 27, 2013 at 23:14
  • 2
    After a while of fiddling with permissions i finally got it to work. Apparently it couldn't have execute set.
    – 735Tesla
    Dec 29, 2013 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.