Laravel-datatables: v6.0 How to edit settings for PDF export and print

Created on 4 Dec 2015  路  6Comments  路  Source: yajra/laravel-datatables

Is there any way to influence how the PDF is built up? Or the print export?
I'd like to be able to add our company logo for example, and add a title. Maybe repeat headers on each page (both in PDF and in print).

If this is possible, where should I look for documentation?

documentation question

Most helpful comment

For PDF, Excel & CSV, we use Laravel Excel package. You can also override the following methods to accomplish what you want to do.

protected function buildExcelFile() // build main excel file.
public function excel()
public function csv()
public function pdf()

For printing, you can create your own print preview file by setting the property:

protected $printPreview = 'path.to.view';

Lastly, there is no documentation yet for these developments.

All 6 comments

For PDF, Excel & CSV, we use Laravel Excel package. You can also override the following methods to accomplish what you want to do.

protected function buildExcelFile() // build main excel file.
public function excel()
public function csv()
public function pdf()

For printing, you can create your own print preview file by setting the property:

protected $printPreview = 'path.to.view';

Lastly, there is no documentation yet for these developments.

Dear @rogierborst are you done pdf . If(true) then please guide me.
Thank you.

Better exporting of PDF via laravel-snappy was released on v6.15.0. See PR https://github.com/yajra/laravel-datatables/pull/626 for more info. Thanks!

Dear @yajra how to config if using another pdf library? such as dompdf. thanks

@setiawans see https://yajrabox.com/docs/laravel-datatables/master/buttons-config#pdf-generator for ref. However, it's been a long time since I used dompdf and not sure if it's still working. Thanks!

file in vendor/datatables/print.blade.pdf is a template for generate pdf. It is general right? if i want to just change the html file what should i do? where should i define "user.blade.php"/"user" for the view template? and how passing the data? @yajra

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kamrava picture kamrava  路  3Comments

SGarridoDev picture SGarridoDev  路  3Comments

t0n1zz picture t0n1zz  路  3Comments

techguydev picture techguydev  路  3Comments

FilipeBorges1993 picture FilipeBorges1993  路  3Comments