问题
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