将QR码作为位图添加到ABCPDF文档:
Doc pdf = new Doc();
pdf.Rendering.AntiAliasImages = false;
...
pdf.AddImageBitmap(bmp, true);
渲染为PDF文件时,图像显示为锯齿:
直接打印到打印机时,QR码相同:
我的问题是:我做错了什么?
您需要根据图像大小和分辨率调整Doc.Rect的大小,例如
// Set PDF image size from image size and resolution (PDF coord space is 72dpi)
doc.Rect.Height = bmp.Height * 72 / bmp.VerticalResolution;
doc.Rect.Width = bmp.Width * 72 / bmp.HorizontalResolution;
doc.AddImageBitmap(bmp, true);
(并且Rendering类属性仅在从PDF导出到图像时适用。)