ABCpdf convert text to image

流过昼夜 提交于 2020-01-04 06:17:09

问题


I use ABCpdf to output pdf documents. The EAN-13 font is successfully used for barcode printing and I want to convert it to an image on the PDF document. Any ideas?


回答1:


If it's a simple barcode font then embed the font and then add the text. Something like:

doc.Font = doc.EmbedFont(@"c:\myean13.ttf");
// check return value != 0
doc.AddText("12345");

If you want an image rather than an embedded font then after you've done this you can rasterize the section of the doc and add it to a new PDF. Something like this:

using (Bitmap bm = doc.Rendering.GetBitmap()) {
  otherDoc.AddImageObject(bm);
}


来源:https://stackoverflow.com/questions/7414887/abcpdf-convert-text-to-image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!