Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

打印时如何设置自定义布局 #703

Open
WeijianLi-dve opened this issue Feb 21, 2024 · 1 comment
Open

打印时如何设置自定义布局 #703

WeijianLi-dve opened this issue Feb 21, 2024 · 1 comment

Comments

@WeijianLi-dve
Copy link

image

在点击打印的时候我希望实现右侧的 审批记录 区域的内容会排列到表单内容的最下面,而不是默认的左右结构。请问该如何实现

表单内容
流程记录内容

import Print from "print-js";
printClick() {
let params = {
printable: "printFrom",
header: "申请表",
ignore: ["no-print"],
};
Print({
printable: params.printable, // 'printFrom', // 标签元素id
type: params.type || "html",
header: params.header, // '表单',
targetStyles: ["*"],
style: .sidebar { position: absolute; bottom: 0; left: 0; right: 0; width: 100%; }, // 可选-打印时去掉眉页眉尾
ignoreElements: params.ignore || [], // ['no-print']
properties: params.properties || null,
});
}
最终想要的效果:
image

@shuishen49
Copy link

我也遇到了 使用 https://printjs-4de6.kxcdn.com/print.min.js
https://printjs-4de6.kxcdn.com/print.min.css 就行了 但是不是所有的表格都能打印

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants