Multiple RichEditor Entries to PDF

I am trying to take multiple TMSFMXRichEditor User Entries and string them all together into one PDF report. I tried using the TMSFMXPDFLib pulling the Oracle DB Blobs all out and concatenating them together in HTML but then I lose the Graphics users enter.

I also want to be able to force Page Breaks between each User Entry for section breaks.

Suggestions what I should be using to generate this multiple page, section PDF?


It should actually be possible to use one TTMSFMXRichEditor together with the TTMSFMXRichEditorPDFIO and concatenate all content, and then export it at once in a PDF. The PDF will automatically create new pages. If you want to control the content for each page, then you'll need to manually construct a TTMSFMXPDFLib instance and use the NewPage to create a page, and you can use the DrawText and enter HTML manually.

First issue is how to concatenate the multiple stored RTE objects stored in Blobs. The Rich Editor accepts the Blob from the database as a Stream. I can't concatenate Blobs or Stream types and putting two Streams into the TMSFMX components just overwrites the first.


   if qryGetText.Recordcount > 0 then begin

      blobF := qryGetText.Fields.Fields[0] as TBlobField;

      StreamTxt := getText.CreateBlobStream(blobF, bmRead);



If I use PDFLib and convert to HTML so I can concatenate each Blob from the database in a string, I lose any graphics pasted in the user's Rich Text document. I need each users fully saved document so I can build one larger document of sections.


        MyTxtString := TMSFMXRichEditorFoot1.ContentAsHTML;



        rh := p.GetHeaderRect;

        p.Graphics.Font.Size := 10;

        r := RectF(rh.Left, rh.Top, rh.Right, rh.Bottom);

        tr := p.Graphics.DrawHTMLText(RationaleTxt, r);


You could create one TTMSFMXRichEditor and use an intermediate TTMSFMXRichEditor to load all blobs, and then append the intermediate rich editor content as HTML to the original instance of TTMSFMXRichEditor, and then export it all with the TTMSFMXRichEditorPDFIO.

Except moving the user's document to HTML loses the graphics of Tables they pasted into the document. Didn't work for me unless I am not understanding your process. I'll have to look at the HTML again.

Please note that TTMSFMXRichEditor has at this time no built-in support for tables, so HTML tables can't be imported as tables. You mention "graphics of tables" , so I suppose this is what you mean?

Basically any screenshot I paste into my TMSFMXRichEditor I can save to the database with SavetoStream but if I use PDFLib to format printing to PDF using HTML, it strips out any graphics I have saved in my text.