1:背景:
我们的产品把用户输入的富文本rtf通过C1的RenderRichText和PrintDocument保存成一个Metafile,然后把这个Metafile赋值给AR的Picture对象,之后把这个Picture用AR的Viewer来预览,以及通过AR的PdfExport功能来导出。代码示意如下:---------------------------------------------------------------------
Dim rtfCtl As New C1.C1Preview.RenderRichText(rtf)
Dim doc As New C1.C1Preview.C1PrintDocument()
doc.Body.Children.Add(rtfCtl)
doc.Generate()
Dim img As System.Drawing.Imaging.Metafile
img = doc.Pages(0).AsMetafile(True).Clone()
doc.Dispose()
Dim picCtl As GrapeCity.ActiveReports.SectionReportModel.Picture
picCtl.Image = img