在嵌入 HTML 页面的 PDF 的新选项卡/窗口中打开锚链接

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

我正在使用 mPDF 通过 PHP 从 HTML 创建 PDF。

<object id="pdfObject" class="pdf" data="<?php echo $pdf ?>"></object>

但是当我单击锚链接时,它不会在新选项卡中打开。我尝试了 target='_blank' 和 pdf_open_window='1' 但它仍然在同一个父选项卡中打开。

$html = "<html> ...
<a href='https://example.test/starter-monthly' target='_blank' pdf_open_window='1'>
Get Starter<br/>Monthly
</a>
... </html>";
$mpdf->WriteHTML($html);

如何获取锚链接以在新选项卡/窗口中打开?

pdf anchor mpdf
1个回答
0
投票

$document->Output('user_information.pdf', "I");

你应该输出内容...

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.