illustrator插件移除非纯黑叠印AI插件
1 方法原理
illustrator是矢量编辑软件,画板是绘制处理的重要容器,在印刷方面的一个重要功能就是移除非纯黑叠印,开发一个 移除非纯黑叠印功能 ,以下功能仅用于学习交流,请勿用于非法用途和商业用途,源代码如下所示: var doc = documents[0]; var pgItm = doc.pageItems; app.selection = null; for (var i = 0; i < pgItm.length; i += 1) { if (pgItm[i].typename == "TextFrame") { var fiTxtColor = pgItm[i].textRange.fillColor; if (pgItm[i].textRange.overprintFill == true) { if (fiTxtColor.black == 100 && fiTxtColor.cyan == 0 && fiTxtColor.magenta == 0 && fiTxtColor.yellow == 0) { continue; } else { pgItm[i].selected = true; } } } else { var fiColor = pgItm[i].fillColor; if (pgItm[i].fillOverprint == true) { if (fiColor.black == 100 && fiColor.cyan == 0 && fiColor.magenta == 0 && fiColor.yellow == 0) { continue; } else { pgItm[i].selected = true; } } } } removeOVPfill(app.selection); app.selection = null; for (var i = 0; i < pgItm.length; i += 1) { if (pgItm[i].typename == "TextFrame") { var stTxtColor = pgItm[i].textRange.strokeColor; if (pgItm[i].textRange.overprintStroke == true) { if (stTxtColor.black == 100 && stTxtColor.cyan == 0 && stTxtColor.magenta == 0 && stTxtColor.yellow == 0) { continue; } else { pgItm[i].selected = true; } } } else { var stColor = pgItm[i].strokeColor; if (pgItm[i].strokeOverprint == true) { if (stColor.black == 100 && stColor.cyan == 0 && stColor.magenta == 0 && stColor.yellow == 0) { continue; } else { pgItm[i].selected = true; } } } } removeOVPstroke(app.selection); function removeOVPfill(sel) { if (sel.length == 0) { return; } c = confirm("删除填充叠印?", false, "Paint"); if (c == true) { for (var i = 0; i < sel.length; i += 1) { sel[i].fillOverprint = false; try { sel[i].textRange.overprintFill = false; } catch (e) { } sel[i].selected = false; } } } function removeOVPstroke(sel) { if (sel.length == 0) { return; } c = confirm("删除描边叠印?", false, "Does not"); if (c == true) { for (var i = 0; i < sel.length; i += 1) { sel[i].strokeOverprint = false; try { sel[i].textRange.overprintStroke = false; } catch (e) { } sel[i].selected = false; } } }2.使用方式
AI源代码转执行脚本
>文章引用至 作者联系方式