在将数据表中的数据打印为pdf时,我想根据CodeIgniter 3中类似的列值获取单独的pdf

问题描述 投票:0回答:1

我的一栏中有很多医生的名字。在将表格数据打印为 pdf 时,我想要为每位医生提供单独的 pdf。我正在 CodeIgniter 3 上做这个项目。我使用 window.print() 将数据表中的数据打印为 pdf。

我的一栏中有很多医生的名字。在将表数据打印为 pdf 时,我希望通过使用 window.print() 将数据表中的数据打印为 pdf,为 CodeIgniter 3 中的每个医生单独生成 pdf。

javascript php jquery codeigniter
1个回答
0
投票
function printContent(el) {
    var rp =
        document.body.innerHTML;
    var pc =
        document.getElementById(el).innerHTML;
    document.body.innerHTML = pc;
    window.print();
    document.body.innerHTML = rp;
} < script src = "print.js" > < /script>

    <
    link rel = "stylesheet"
type = "text/css"
href = "print.css" >

    <
    button type = "button"
onclick = "printJS({ printable: 'table_print', type: 'html', header: 'Title' })" > Print < /button> <
    div class = "table-responsive"
id = "table_print" >
    <
    !--table-- >
    <
    /div>
© www.soinside.com 2019 - 2024. All rights reserved.