我正在使用PDFTOHTML(一个 php 库)将 pdf 文件转换为 html,它工作正常,但它在浏览器中显示转换后的文件,而不是存储在本地文件夹中,我想使用 php 将转换后的 html 存储在本地文件夹中,名称与pdf 即mydata.pdf到mydata.html 将 pdf 转换为 html 的代码是:-
<?php
// if you are using composer, just use this
include 'vendor/autoload.php';
$pdf = new \TonchikTm\PdfToHtml\Pdf('cv.pdf', [
'pdftohtml_path' => 'C:/wamp64/www/new/poppler-0.51/bin/pdftohtml.exe',
'pdfinfo_path' => 'C:/wamp64/www/new/poppler-0.51/bin/pdfinfo.exe'
]);
// get content from all pages and loop for they
foreach ($pdf->getHtml()->getAllPages() as $page) {
echo $page . '<br/>';
}
?>