
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
var pdf = require("ht-pdf");
头部 底部 img 必须是 base64
pdf.create(html,options).toFile(filename,callback); pdf.create(html,options).toBuffer(callback);
callback has two argument 1、错误 2、pdf 3、pdf 的 张数
var pdf = require("../");
var fs = require("fs");
var html = fs.readFileSync(__dirname+"/a.html").toString();
var opts = {
width: "1060px",
height: "1500px",
type: "pdf",
phantomPath: "/usr/local/bin/phantomjs",
margin: {
top: "30px",
left: "35px",
right: "15px",
bottom: "0px"
},
timeout: 15000,
header: {
height: "315px",
contents: null
},
footer: {
height: "124px",
contents: null
}
};
pdf.create(html, opts).toBuffer(function(err,res,total){
console.log(total)
})
###1.0.10 增加新页码字段 {{pagenum}} 从1开始
###1.0.7
增加了起始页码 影响字段{{page}} options.start = 10 默认是 0
###1.0.5 获得 html 结构中 所有 class="getHeight" 的 clientHeight;
pdf.create(html,opts).getHeight(function(){
console.log(arguments);
})FAQs
use phantomjs and use image in header content
We found that ht-pdf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.