我有两个 PDF 文件。如果我选择第二个 PDF (kfz) 进行打印,第一个 PDF (bike) 无论如何都会打印。为什么是这样?有两种不同的路径。
<script>
function printTrigger(elementId) {
var getMyFrame = document.getElementById(elementId);
getMyFrame.focus();
getMyFrame.contentWindow.print();
}
</script>
<tr>
<td>
Fahrrad Kaufvertrag
</td>
<td>
<%= Html.ActionLink("Download", "DownloadBikeContract", new { id = 1 }, new { @class = "SaveContract" })%>
</td>
<td>
<img src="../../Styles/Images/Buttons/printer.png" onclick="printTrigger('iFramePdf');" />
<iframe id="iFramePdf" src="../../Files/KaufvertragFahrrad.pdf" style="display: none;">
</iframe>
</td>
</tr>
<tr>
<td>
KFZ - Kaufvertrag
</td>
<td>
<%= Html.ActionLink("Download", "DownloadKFZContract", new { id = 2 }, new { @class = "SaveContract" })%>
</td>
<td>
<img src="../../Styles/Images/Buttons/printer.png" onclick="printTrigger('iFramePdf');" />
<iframe id="iFrame1" src="../../Files/KaufvertragKFZ.pdf" style="display: none;">
</iframe>
</td>
</tr>