【发布时间】:2013-12-30 04:53:09
【问题描述】:
我正在尝试使用 iTextSharp 创建 2d Datamatrix 条形码。如果我不提供高度或宽度,条形码生成就好了。但是,当我尝试设置条形码的高度和宽度时,它会返回一个空对象。
BarcodeDatamatrix barcode = new BarcodeDatamatrix
{
Width = 10,
Height = 10
};
barcode.Generate(barcodeData);
Image barcodeImage = barcode.CreateImage();
return barcodeImage;
}
为什么它返回一个空值,我怎样才能让它设置我的尺寸?
【问题讨论】:
-
您需要注意两个不同的维度:图像的像素维度和数据矩阵条码的正方形维度。后者只接受规范中定义的特定组合,它会影响您可以在条形码中存储多少数据。
标签: c# itextsharp itext barcode