jQuery DataTables 导出 pdf 截断列 [英] jQuery DataTables export pdf cuts off columns

查看:34
本文介绍了jQuery DataTables 导出 pdf 截断列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含大量列的数据集.

I have a dataset with large number of colums.

导出 pdf 时,不适合页面的列会被截断.

When exporting the pdf , columns that dont fit on the page get cut off.

我尝试使用方向"和页面大小"选项,但还不够.

I tried using the 'orientation' and 'page-size' options but its not enough.

    buttons: [
                {
                    extend: 'pdfHtml5',
                    orientation: 'landscape',
                    pageSize: 'LEGAL'
                }
            ]

理想情况下,它应该执行以下操作之一:

Ideally it should do one of the following:

  1. 使数据适合一页(使字体非常小)
  2. 在 pdf 中的另一个页面中继续数据

推荐答案

我设法通过像 pdf 这样的设置选项解决了这个问题

i managed to solve this problem with setting option for pdf like

 {
                extend : 'pdfHtml5',
                title : function() {
                    return "ABCDE List";
                },
                orientation : 'landscape',
                pageSize : 'LEGAL',
                text : '<i class="fa fa-file-pdf-o"> PDF</i>',
                titleAttr : 'PDF'
            } 

变成了

这篇关于jQuery DataTables 导出 pdf 截断列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆