如何将lavachart导出为PDF

时间:2018-10-03 11:41:42

标签: php laravel-5

我正在使用http://lavacharts.com/在网站上显示图表。 但是我无法将带有lavacharts的laravel视图导出为PDF。

我使用了以下代码

$lava = new Lavacharts; // See note below for Laravel

        $reasons = $lava->DataTable();

        $reasons->addStringColumn('Messages')
                ->addNumberColumn('Percent')
                ->addRow(['Delivered SMS', $messageCount['successCount']])
                ->addRow(['Failed SMS', $messageCount['failedCount']])
                ->addRow(['Pending SMS', $messageCount['pendingCount']])
                ->addRow(['Others', $messageCount['othersCount']]);

        $lava->DonutChart('IMDB', $reasons, [
            'title' => 'SMS Broadcast stats'
        ]);

        view()->share('broadcasts', $broadcasts);
        view()->share('lava', $lava);
        view()->share('messageCount', $messageCount);
        view()->share('broadcastPaginated', $broadcastPaginated);
        \PDF::setOptions(['dpi' => 150]);
        $pdf = \PDF::loadView('manager.sms.broadcasts-pdf');
        return $pdf->download('Invoice.pdf');

我正在使用的PDF库是

https://github.com/barryvdh/laravel-snappy

https://github.com/KnpLabs/snappy

以下是我在尝试执行以上页面时遇到的错误

The exit status code '1' says something went wrong: stderr: "Loading pages (1/6) [> ] 0% [======> ] 10% QSslSocket: cannot resolve CRYPTO_num_locks QSslSocket: cannot resolve CRYPTO_set_id_callback QSslSocket: cannot resolve CRYPTO_set_locking_callback QSslSocket: cannot resolve sk_free QSslSocket: cannot resolve sk_num QSslSocket: cannot resolve sk_pop_free QSslSocket: cannot resolve sk_value QSslSocket: cannot resolve SSL_library_init QSslSocket: cannot resolve SSL_load_error_strings QSslSocket: cannot resolve SSLv3_client_method QSslSocket: cannot resolve SSLv23_client_method QSslSocket: cannot resolve SSLv3_server_method QSslSocket: cannot resolve SSLv23_server_method QSslSocket: cannot resolve X509_STORE_CTX_get_chain QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf QSslSocket: cannot resolve SSLeay QSslSocket: cannot call unresolved function CRYPTO_num_locks QSslSocket: cannot call unresolved function CRYPTO_set_id_callback QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function sk_num [==========> ] 18% QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function 

0 个答案:

没有答案