图像未显示在打印预览中

时间:2019-05-14 13:27:38

标签: javascript html printjs

我正在学习print.js,但是在打印图像时遇到了麻烦。我尝试调用printJS,但是图像未显示在打印预览中。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="https://printjs-4de6.kxcdn.com/print.min.css"/>
    <script src="https://printjs-4de6.kxcdn.com/print.min.js"></script>
    <title>Document</title>
</head>
<body>
    <image src="test-01.jpg"/>
    <button type="button" onclick="printJS('test-01.jpg','image')">
        Print
     </button>
</body>
</html>

0 个答案:

没有答案