Save Header in RTF
Save Header in RTF
Hello,
I will save Header in RTF. For that I have activated the rtfoption rvrtfSaveHeaderFooter. But now I get an error 'Error at reading from rve.RTFOptions'
I will save Header in RTF. For that I have activated the rtfoption rvrtfSaveHeaderFooter. But now I get an error 'Error at reading from rve.RTFOptions'
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Thank you!! That was it.
Now I'm trying to save header like this:
But there will be no Header in the RTF document.. I can't find a solution somewhere in the forum.
Now I'm trying to save header like this:
Code: Select all
rveHeader.clear;
rveHeader.InsertText('test');
rveHeader.Format;
rve.Clear;
rve.RTFReadProperties.SetHeader(rveHeader.RVData);
rve.FORMAT;
rve.SaveRTF(rtfcomplete,FALSE);
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Thanks for your fast answers!!
Now I tried this without any code around it - then it works!
But it doesn't solved my problem.
I am saving the RTF. When I open it with word I can see the Header. Then I open it again with RichViewPDF
and then save it to PDF
I have to set TopMargin and LeftMargin to 0 because I have borders around text. When I don't set it to 0 the borders are on top and the text on the right place.
There is no Header in PDF.
But now I don't know what to do to have a topmargin..
My idea was, to save an empty Header. But it didn't work.
Do you have an idea?
Now I tried this without any code around it - then it works!
But it doesn't solved my problem.
I am saving the RTF. When I open it with word I can see the Header. Then I open it again with RichViewPDF
Code: Select all
RichViewPDF.TopMargin:=0;
RichViewPDF.LeftMargin:=0;
RichViewPDF.RichView.LoadRTF('c:\Programme\idssdb\temp\text.rtf';
Code: Select all
RichViewPDF.SaveToPDFFile(datverzeichnis + 'SDB.pdf');
I have to set TopMargin and LeftMargin to 0 because I have borders around text. When I don't set it to 0 the borders are on top and the text on the right place.
There is no Header in PDF.
But now I don't know what to do to have a topmargin..
My idea was, to save an empty Header. But it didn't work.
Do you have an idea?
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
RichViewPDF does not support headers and footers.
You can look in its source code, in TRichViewPDF.SaveToPDFFile.
It outputs only content of RichView property (by copying it via RTF stream in TRVReportHelper component).
I suggest instead of using this component, use TRolePDF component directly. It provides Canvas where you can draw what you want, including header and footer. You can create your procedure basing on TRichViewPDF.SaveToPDFFile and code from http://www.trichview.com/forums/viewtopic.php?t=2511
If you need help, I'll try to create an example.
You can look in its source code, in TRichViewPDF.SaveToPDFFile.
It outputs only content of RichView property (by copying it via RTF stream in TRVReportHelper component).
I suggest instead of using this component, use TRolePDF component directly. It provides Canvas where you can draw what you want, including header and footer. You can create your procedure basing on TRichViewPDF.SaveToPDFFile and code from http://www.trichview.com/forums/viewtopic.php?t=2511
If you need help, I'll try to create an example.