
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
cesium-print
Advanced tools
Cesium 动态打印插件 cesium-print is a plugin for cesium printing
Include it in your code after importing npm, like:
npm install cesium-print -dev
Use it like:
import CesiumPrint from "cesium-print";
viewer = new Cesium.Viewer("cesiumContainer", {
contextOptions: {
id: "cesiumCanvas",//must
webgl: {
preserveDrawingBuffer: true
}
}
}
//打印cesium canvas dom
CesiumPrint.drawArea("cesiumCanvas", {
penColor: "yellow", //画笔颜色
strokeWidth: 1 //单位 px
})
.then(base64url => {
//base64url is images
//print drawArea dom
CesiumPrint.print(base64url);
})
.catch(error => {
console.error(error);
});
You can submit the options object like:
//打印cesium canvas dom
CesiumPrint.drawArea("cesiumCanvas", {
penColor: "yellow", //画笔颜色
strokeWidth: 1 //单位 px
})
.then(base64url => {
//自定义打印(设置纸张大小,打印标题)
// 高 宽
// A0:1189mm * 841mm
// A1:841mm * 594mm
// A2:594mm * 420mm
// A3:420mm * 297mm
// A4:297mm * 210mm
// 页边距: 0.75 inch
// A1: 23.39x33.11 inch
// 打印机DPI:300DPI
// 屏幕DPI : 96DPI
// width = (23.39 - 0.75 * 2) * 96 = 2101 px
// height = (33.11 - 0.75 * 2)* 96 = 3034 px
// A4: 8.27x11.69 inch
// 打印机DPI:300DPI
// 屏幕DPI : 96DPI
// width = (8.27 - 0.75 * 2) * 96 = 650 px
// height = (11.69 - 0.75 * 2)* 96 = 978 px
// 所以,当<table> 的width=650px, height=978px时,用IE 打印时,刚好能打印一页的A4纸.
// //a1横向打印尺寸
// var a1 = { width: "3034", height: "2101" };
// //a4横向打印尺寸
var a4 = { width: "978", height: "650" };
let printOptions = {
title: "打印标题(print title)",
width: a4.width,
height: a4.height,
fontSize: "30",
downLoadEnable: true //是否下载打印文件
};
CesiumPrint.print(base64url, printOptions);
});
})
.catch(error => {
console.error(error);
});
Currently this plugin supports the following options:
red
1
978
650
, creates a hidden iframe if no-vaild iframe selector is passed32
true
print
, uses the host page title....
https://github.com/richard1015/cesium-vue-example /(cesium-print,cesium-navigation-es6)
Like our work? Get in touch 51844712@qq.com!
FAQs
cesium print plugin
We found that cesium-print 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.