套打.脚本.案例.无边距纸张骑缝章

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

套打.脚本.案例.无边距纸张骑缝章

【场景】套打变通实现骑缝章 【支持补丁】2022/11,如果是作为打印,需要注意必须是无物理边距的打印机 【案例】通过套打图片控件和脚本,对输出的图片根据页码进行切割;输出到纸张上,实现骑缝章的效果 <1>套打设置纸张无左右边距 ![Image_20221114193137.webp](/download/0100d9798afffdd243678a3663578039e827.webp) <2>放置图片控件,绑定好,并记录图片ID ![Image_20221114193200.webp](/download/01000119f22a4c9c489782609cf7ba9f9c6a.webp) <3>配置套打脚本 ![Image_20221114193301.webp](/download/01006f0b15142781444199b8f23965df5e6d.webp) ```python import clr clr.AddReference("System.Drawing") clr.AddReference("Kingdee.BOS.Core") from System.Drawing import * from Kingdee.BOS.Core import * def OutputElement(e): if(e.ControlInfo.ControlID == "Picture1"): QiFengZhang(e); def QiFengZhang(e): devBrick = e.ControlInfo.DevBrick; srcWidth = devBrick.Image.Width; drawWidth = srcWidth / e.TrackInfo.CurPrintInstanceNotePageIdx; drawIdx = e.CurPrintInstanceNotePageIdx-1; srcHeight = devBrick.Image.Height; newImage = Bitmap(drawWidth,srcHeight); drawX = -drawIdx * drawWidth; g = Graphics.FromImage(newImage); g.Clear(Color.Transparent); g.DrawImage(devBrick.Image, drawX, 0, srcWidth, srcHeight); devBrick.Size = Size(drawWidth,srcHeight); devBrick.Location = PointF(devBrick.Location.X+srcWidth-drawWidth,devBrick.Location.Y); devBrick.Image = newImage; devBrick.StaticResKey = None; ``` 【效果】预览效果,骑缝章根据单据进行切割;换另一个单据后重新计算 ![Image_20221114193432.webp](/download/010002ea030907374c9bafc1f299681b19c4.webp) ![Image_20221114193512.webp](/download/0100abdcfb2688e04e838697ba0d54815bcc.webp) ![Image_20221114193531.webp](/download/0100f39dd6ee229e450290aa94353742e9a7.webp) ![Image_20221114193549.webp](/download/0100b8fc220287b442128d5e38a6e38e61d7.webp)

套打.脚本.案例.无边距纸张骑缝章

【场景】套打变通实现骑缝章【支持补丁】2022/11,如果是作为打印,需要注意必须是无物理边距的打印机【案例】通过套打图片控件和脚本,对...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息