码迷,mamicode.com
首页 > Web开发 > 详细

.net 导出带条码的PDF

时间:2018-11-14 14:26:16      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:binding   dingo   image   width   条形码   单元   rebar   enc   asp   

  1. Nuget添加引用:ZXing.Net生成条形码,ZXing.Net.Bindings.ImageSharp生成图片
  2. 将图片流插入单元格
举个栗子:

BarcodeWriter writer = new BarcodeWriter();
writer.Format = BarcodeFormat.CODE_128;
writer.Options = new ZXing.Common.EncodingOptions
{
Height = 40,
Width = 200,
PureBarcode = true
};
MemoryStream stream = new MemoryStream();

using (var image = writer.Write("条码字符"))
{
image.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp);
}
Aspose.Cells.Drawing.PictureCollection pictures = sheet.Pictures;
pictures.Add(0, 12, stream);

.net 导出带条码的PDF

标签:binding   dingo   image   width   条形码   单元   rebar   enc   asp   

原文地址:https://www.cnblogs.com/MSIKRUBY/p/9957350.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!