Generate pdf from HTML in div using Javascript

前端 未结 12 997
你的背包
你的背包 2020-11-22 06:10

I have the following html code:



    
        

don\'t print th

12条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 06:32

    If you want to export a table, you can take a look at this export sample provided by the Shield UI Grid widget.

    It is done by extending the configuration like this:

    ...
    exportOptions: {
        proxy: "/filesaver/save",
        pdf: {
            fileName: "shieldui-export",
            author: "John Smith",
            dataSource: {
                data: gridData
            },
            readDataSource: true,
            header: {
                cells: [
                    { field: "id", title: "ID", width: 50 },
                    { field: "name", title: "Person Name", width: 100 },
                    { field: "company", title: "Company Name", width: 100 },
                    { field: "email", title: "Email Address" }
                ]
            }
        }
    }
    ...
    

提交回复
热议问题