如果它是简单的条形码字体,则嵌入字体,然后添加文本。就像是:
doc.Font = doc.EmbedFont(@"c:\myean13.ttf");
// check return value != 0
doc.AddText("12345");
如果您想要图像而不是嵌入字体,那么在完成此操作后,您可以将文档的部分栅格化并将其添加到新的 PDF 中。像这样的东西:
using (Bitmap bm = doc.Rendering.GetBitmap()) {
otherDoc.AddImageObject(bm);
}