How to use external css in tcpdf pdf generation

后端 未结 2 964
梦如初夏
梦如初夏 2021-02-13 10:35

I am trying to create a pdf of a web page with tcpdf. But it\'s not working. The page is a php with external css and javascript files.

Can anyone help me with this.

2条回答
  •  无人共我
    2021-02-13 10:53

    To include external CSS file, you can do as below before you add your HTML content

    $html .= '';
    

    By this, while you pass $html to generate pdf it will include those styles.

    As far I am aware, there is no need for including Javascript into a PDF. The purpose of a PDF is to display a non-interactive static content, which can be achieved by HTML and CSS

提交回复
热议问题