我似乎无法让PdfSharp为这个注释显示图片.它没有PdfAnnotation.Icon属性,所以我无法设置它. XFont font = new XFont("Verdana", 10);PdfPage page = wDoc.Parent.Page;XGraphics gfx = wDoc.Parent.gfx;XRect rec = gfx.Transfor
XFont font = new XFont("Verdana", 10); PdfPage page = wDoc.Parent.Page; XGraphics gfx = wDoc.Parent.gfx; XRect rec = gfx.Transformer.WorldToDefaultPage(new XRect(new XPoint(30, 60), new XSize(30, 30))); PdfRectangle rect = new PdfRectangle(rec); PdfLinkAnnotation link = PdfLinkAnnotation.CreateFileLink(rect, wDoc.FileLocation); gfx.DrawString("These files were attached:", font, XBrushes.Black, 30, 50, XStringFormat.Default); link.Rectangle = new PdfRectangle(rec); page.Annotations.Add(link);
我已经把它弄到了那么远,并且注释已经存在,除了它是一个空白框!如何让它说些什么,甚至只是展示一张图片?
您需要使用page.AddWebLink(AREArect),然后使用gfx.drawstring(AREArect)添加文本区域