0

I am using a TAdvRichEidtor in order to create a chart. Drawing the chart and adding text works perfectly using:

...
 advRichEditor1.Canvas.TextOut(5,5,'TEST');
 advRichEditor1.Canvas.Moveto(10,10);
 advRichEditor1.Canvas.Lineto(20,20);
...

However when I come to create a PDF of this using a TAdvRichEidtorPDFIO the PDF is blank, apart from the default header and footer. I can change settings such as the size, orientation etc. and these work fine, just the canvas I created programmatically is not there.

If I type text in the TAdvRichEidtor manually and then save using TAdvRichEidtorPDFIO then the text saves to the PDF fine.

So how do I save to PDF the canvas in the TAdvRichEidtor that I have created programmatically?

Jsk
  • 159
  • 1
  • 13
  • 3
    This is very much expected. Think of the control as something on your Windows desktop, and the `Canvas` as the physical computer screen or the canvas on which you project the screen in your meeting room. If you use a whiteboard pen to draw on your computer monitor or the projection canvas, you will not find this content to be part of the RTF you create using the control. – Andreas Rejbrand Apr 14 '23 at 11:00
  • If you want to embed a chart in the RTF, you need to create a true OLE chart object or image that you embed in the RTF. – Andreas Rejbrand Apr 14 '23 at 11:02
  • @AndreasRejbrand ...or using [Tipp-Ex](https://en.wikipedia.org/wiki/Tipp-Ex) on the monitor, confusing an output-only device as supporting input, too. – AmigoJack Apr 14 '23 at 11:24
  • A RichEdit is not a drawing surface. It's a container for rich text. It's not surprising that misusing it doesn't work. – Ken White Apr 15 '23 at 03:35

0 Answers0