jQuery打印此ASP.net核心颜色不可见

jQuery打印此ASP.net核心颜色不可见,jquery,asp.net-core,colors,summernote,printthis,Jquery,Asp.net Core,Colors,Summernote,Printthis,我对ASP.net内核中的jQuery打印插件有问题 我使用summernote创建了一个html字符串,其格式为,例如一个黄色字体的表格。如果我用jQuery插件打印它,所有东西都会正确显示,但颜色不会显示。颜色仍然是黑色 有人能帮我吗 先谢谢你 奇尼 更新: 这是我的密码: 我在其中调用函数的Index.cshtml和来自PrintThis插件的css /* *打印此v1.15.1 *@desc打印jQuery插件 *@作者杰森·戴 * *资源(基于): *-区域:http://plugi

我对ASP.net内核中的jQuery打印插件有问题

我使用summernote创建了一个html字符串,其格式为,例如一个黄色字体的表格。如果我用jQuery插件打印它,所有东西都会正确显示,但颜色不会显示。颜色仍然是黑色

有人能帮我吗

先谢谢你 奇尼

更新: 这是我的密码: 我在其中调用函数的Index.cshtml和来自PrintThis插件的css

/*
*打印此v1.15.1
*@desc打印jQuery插件
*@作者杰森·戴
*
*资源(基于):
*-区域:http://plugins.jquery.com/project/jPrintArea
*-jqPrint:https://github.com/permanenttourist/jquery.jqprint
*-本·纳达尔:http://www.bennadel.com/blog/1591-Ask-Ben-Print-Part-Of-A-Web-Page-With-jQuery.htm
*
*根据麻省理工学院许可证获得许可:
*              http://www.opensource.org/licenses/mit-license.php
*
*(c)2015-2019年杰森日
*
*用法:
*
*$(“#mySelector”)。打印此({
*debug:false,//显示用于调试的iframe
*importcs:true,//导入父页面css
*importStyle:false,//导入样式标记
*printContainer:true,//获取外部容器以及选择器的内容
*loadCSS:“path/to/my.css”,//附加css文件的路径-对多个css文件使用数组[]
*pageTitle:,//将标题添加到打印页
*removeInline:false,//从打印元素中删除所有内联样式
*removeInlineSelector:“body*”,//用于筛选内联样式的自定义选择器。removeInline必须为true
*printDelay:333,//可变打印延迟
*header:null,//html的前缀
*页脚:null,//html后缀
*base:false,//保留base标记,或接受URL的字符串
*formValues:true,//保留输入/表单值
*画布:false,//复制画布元素
*doctypeString:“…”,//为旧标记输入其他doctype
*RemoveScript:false,//从打印内容中删除脚本标记
*copyTagClasses:false//从html和body标记复制类
*beforePrintEvent:null,//iframe中printEvent的回调函数
*beforePrint:null,//在填充iframe之前调用函数
*afterPrint:null//在删除iframe之前调用的函数
*  });
*
*注:
*-loadCSS将额外的CSS(带或不带@media print)加载到iframe中,调整布局
*/
;
(函数($){
函数appendContent($el,content){
如果(!content)返回;
//jQuery元素的简单测试
$el.append(content.jquery?content.clone():content);
}
函数appendBody($body,$element,opt){
//克隆是为了安全和方便
//调用clone(withDataAndEvents=true)复制表单值。
var$content=$element.clone(opt.formValues);
if(opt.formValues){
//将原始select和textarea值复制到克隆的对应值
//弥补无法使用clone(true)克隆select和textarea值
copyValues($element,$content,'select,textarea');
}
if(opt.removescript){
$content.find('script').remove();
}
if(可选打印容器){
//抓取$.selector作为容器
$content.appendTo($body);
}否则{
//否则只需打印容器的内部元素
$content.each(函数(){
$(this.children().appendTo($body)
});
}
}
//将传入elementSelector的值从原点复制到克隆
函数copyValues(源、克隆、元素选择器){
var$originalElements=origin.find(elementSelector);
clone.find(elementSelector).each(函数(索引,项){
$(item.val($originalElements.eq(index.val));
});
}
var-opt;
$.fn.printThis=函数(选项){
opt=$.extend({},$.fn.printThis.defaults,options);
var$element=jQuery的这个实例?this:$(this);
var strFrameName=“printThis-”+(新日期()).getTime();
if(window.location.hostname!==document.domain&&navigator.userAgent.match(/msie/i)){
//由于IE未从父级继承document.domain,导致IE黑客行为丑陋
//通过将主机名与document.domain进行比较,检查是否设置了document.domain
var iframeSrc=“javascript:document.write(\”document.domain=\\\\”“+document.domain+“\\\\\”;\”);
var printI=document.createElement('iframe');
printI.name=“printIframe”;
printI.id=strFrameName;
printI.className=“MSIE”;
文件.body.appendChild(printI);
printI.src=iframeSrc;
}否则{
//其他浏览器继承document.domain,如果没有显式设置document.domain,IE也可以工作
变量$frame=$(“”);
$frame.appendTo(“正文”);
}
变量$iframe=$(“#”+strFrameName);
//在调试模式下显示帧
如果(!opt.debug)$iframe.css({
位置:“绝对”,
宽度:“0px”,
高度:“0px”,
左:“-600px”,
顶部:“-600px”
});
//打印前回拨
if(opt.beforePrint的类型==“函数”){
opt.beforePrint();
}
//$iframe.ready()和$iframe.load在浏览器之间不一致
setTimeout(函数(){
//添加doctype以修复打印和渲染之间的样式差异
函数setDocType($iframe,doctype){
var win,d
$('#advanced').on("click", function () {
    $('#table2print').printThis({
        importCSS: true,
        importStyle: true,
        removeInline: false
    });
});