pm.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  7. <title>Document</title>
  8. <style>
  9. body,
  10. html {
  11. padding: 0;
  12. margin: 0;
  13. font-size: 14px;
  14. }
  15. @page {
  16. margin: 0px;
  17. }
  18. .text-center {
  19. text-align: center;
  20. }
  21. .mt {
  22. /* margin-top: 5px; */
  23. }
  24. .mt-1 {
  25. margin-top: 10px;
  26. }
  27. .mt-2 {
  28. margin-top: 20px;
  29. }
  30. .mt-3 {
  31. margin-top: 30px;
  32. }
  33. .ml-1 {
  34. margin-left: 10px;
  35. }
  36. .p-1 {
  37. padding: 10px;
  38. }
  39. .font-bold {
  40. font-weight: bold;
  41. }
  42. .w-50 {
  43. width: 50%;
  44. }
  45. .itemtitle{
  46. width: 25%;
  47. padding:4px 5px;
  48. border-right:1px solid #000;
  49. }
  50. .itemstyle{
  51. width: 75%;
  52. padding:4px 5px;
  53. }
  54. </style>
  55. </head>
  56. <body id="bd" style="padding:15px 5px;box-sizing: border-box;">
  57. </body>
  58. <script>
  59. const { ipcRenderer } = require('electron')
  60. ipcRenderer.on('webview-print-render', (event, info) => {
  61. // 执行渲染
  62. console.log(info);
  63. document.getElementById('bd').innerHTML = info.html
  64. ipcRenderer.sendToHost('webview-print-do')
  65. })
  66. </script>
  67. <style>
  68. #bd {}
  69. </style>
  70. </html>