Hi,
I'm trying to print a rich text, but run into problems when I include bullet points. The troubling thing is that it's not constant. What happens is, I have a TWPRichText-object, and use its Memo->PaintRTFPage()-method to print the text to a canvas, which I then output to either a print preview, a printer, or a pdf-file depending on user input. When continuing to preview or to printer, everything seems fine, but when I try to export to pdf my bullet points disappear. At first glance this didn't seem like problem with the component, so I did some additional testing with a separate canvas which I exported to a metafile, just to have a glance at what's going on. And lo and behold, this metafile has the same problem, even though it's completely independent of any devices. To confuse the matter even more, I at the same time export the rich text as an rtf-file, which looks great in all cases.
Ok, this got confusing. Maybe a bit of code can clarify:
prwp->wp->Memo->PaintRTFPage(0, x, y, Rich_TextWidth(prwp->wp), Rich_TextHeight(prwp->wp, true), PPC, MForm->WPPaintMode, Faktor, Faktor, 0, MaxLongint, MForm->WPPaintPageMode);
prwp->wp->SaveToFile("c:\\temp3.rtf", false, "rtf");
TMetafile* pMF = new TMetafile();
TMetafileCanvas* pMFC = new TMetafileCanvas(pMF, 0);
pMFC->Pen->Color = clBlack;
pMFC->Brush->Color = clBlack;
prwp->wp->Memo->PaintRTFPage(0, 10, 10, Rich_TextWidth(prwp->wp), Rich_TextHeight(prwp->wp, true), pMFC, MForm->WPPaintMode, 200, 200, 0, MaxLongint, MForm->WPPaintPageMode);
delete pMFC;
pMF->SaveToFile("c:\\temp.emf");
delete pMF;
Alles anzeigen
Here, prwp->wp is my original TWPRichText-object, and PPC is the canvas that eventually goes to print.
So, when the user wants to preview or print, PPC, temp.emf and temp3.rtf all looks good, with bullet points
When the user wants to export to pdf, temp3.rtf looks good, but PPC and temp.emf both loose the bullet points.
I can't understand why this would happen for both the result coming from PPC and temp.emf if the PaintRTFPage()-method is good. And I can't understand how this method would be affected by how the user wants the result to be produced...
This all seems very weird to me, hope you have some insight for me :) I use CodeGear C++ Builder 2007 and wptools 6