print pdf bug & DOCTYPE

OK

with <!DOCTYPE html>


<!DOCTYPE html>
<html lang="zh-Hans"> <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">
<meta name="author" content="xgqfrms">
<meta name="generator" content="VS code">
<title></title>
</head> <body>
<section>
<h1>
<a href="https://feiqa.xgqfrms.xyz/index.html"></a>
</h1>
</section>
</body> </html>

error

no <!DOCTYPE html>


<html lang="zh-Hans"> <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">
<meta name="author" content="xgqfrms">
<meta name="generator" content="VS code">
<title></title>
</head> <body>
<section>
<h1>
<a href="https://feiqa.xgqfrms.xyz/index.html"></a>
</h1>
</section>
</body> </html>


let html = document.querySelector(`html`);
// let text = html.innerHTML; text += `
<style>
@media print {
@page {
margin: 0;
}
}
</style>
`;

@media print {
@page { margin: 0; }
body { margin: 1.6cm; }
}

https://stackoverflow.com/questions/46077392/additional-options-in-chrome-headless-print-to-pdf


最新文章

  1. seajs hello world
  2. ndk学习15: IPC机制
  3. CentOS 6 使用 yum 安装MongoDB及服务器端配置
  4. 用SDWebImage渐变加载图片
  5. 安装redis监控
  6. iOS8 VPN 应用内连接
  7. ASP.Net 5 上传文件通过虚拟路径存储
  8. java笔记--关于线程通信
  9. svn搭建,很简单
  10. play framework 框架安装及myeclipse 导入项目
  11. uglifyjs使用
  12. Android:创建可穿戴应用 - 自定义布局
  13. hdu 4585 Shaolin_set用法
  14. Php连接及读取和写入mysql数据库的常用代码
  15. jquery.qrcode.min.js(支持中文转化二维码)
  16. JAVAscript学习笔记 js事件 第一节 (原创) 参考js使用表
  17. C# .NET枚举Enum项获取
  18. git教程:添加远程仓库
  19. More is better
  20. odoo 11导入外部数据过程记录

热门文章

  1. Python基础 — Pandas
  2. linux Java环境变了配置
  3. json和Jsonp 使用总结(2)
  4. 236 Lowest Common Ancestor of a Binary Tree 二叉树的最近公共祖先
  5. LN : leetcode 217 Contains Duplicate
  6. js 获取json数组里面数组的长度
  7. oracle dos命令
  8. GetArxPath
  9. CAD得到所有组名(网页版)
  10. spark学习(1)---dataframe操作大全