如何使用Shell脚本将html转换为pdf

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

我已经在外壳程序脚本中编写了html并将该输出保存到output.html,我想将该output.html转换为output.pdf和output.json该怎么做?

<table class="table table-sm">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First</th>
<th scope="col">Last</th>
<th scope="col">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
bash shell sh html2pdf htmldoc
1个回答
1
投票

要转换为PDF文件,您可能需要安装该实用程序

Follow this link to get this done

一旦安装了相同的文件,使用提到的链接运行此文件

 html2pdf filename
© www.soinside.com 2019 - 2024. All rights reserved.