How to use external css in tcpdf pdf generation
To include external CSS file, you can do as below before you add your HTML
content
$html .= '<style>'.file_get_contents(_BASE_PATH.'stylesheet.css').'</style>';
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