Load RVF with footer and save to RTF
Posted: Fri May 12, 2017 6:36 pm
Hello!
We use TRichView for own simple report processing. We make and save RVF templates. When user execute template, we load RVF, replace some variables and save to RTF for opening with MS Word or LibreOffice. It works fine, but we have one problem: RVF with footer is loaded without it. We can set footer manualy (commented lines) and it works, but how to get footer from RVF and why procedure LoadRVF does not load footers?
We use TRichView for own simple report processing. We make and save RVF templates. When user execute template, we load RVF, replace some variables and save to RTF for opening with MS Word or LibreOffice. It works fine, but we have one problem: RVF with footer is loaded without it. We can set footer manualy (commented lines) and it works, but how to get footer from RVF and why procedure LoadRVF does not load footers?
Code: Select all
RichView.RTFReadProperties.ReadDocParameters := True;
RichView.RTFReadProperties.ParaStyleMode := rvrsAddIfNeeded;
RichView.RTFReadProperties.TextStyleMode := rvrsAddIfNeeded;
RichView.RTFReadProperties.UnicodeMode := rvruOnlyUnicode;
RichView.RVFOptions := [rvfoLoadDocProperties, rvfoSaveDocProperties,
rvfoSavePicturesBody, rvfoSaveControlsBody,
rvfoIgnoreUnknownPicFmt, rvfoIgnoreUnknownCtrls,
rvfoConvUnknownStylesToZero, rvfoConvLargeImageIdxToZero,
rvfoSaveBinary, rvfoSaveBack, rvfoLoadBack,
rvfoSaveTextStyles, rvfoSaveParaStyles, rvfoSaveLayout,
rvfoLoadLayout];
RichView.RTFOptions :=
[rvrtfDuplicateUnicode, rvrtfSaveEMFAsWMF,
rvrtfSaveJpegAsJpeg, rvrtfSavePngAsPng,
rvrtfSaveDocParameters, rvrtfSaveHeaderFooter,
rvrtfSavePicturesBinary];
RichView.LoadRVF('c:\temp\template.rvf');
// RichFooter.LoadText('c:\temp\footer.txt', 0, 0, True);
// RichView.RTFReadProperties.SetFooter(RichFooter.RVData);
RichView.SaveRTF('c:\temp\result.rtf', False);