I want to create an RTF-Document by appending smaller RTF-documents. Each RTF-document can have its own header/footer. I use the AppendAsSection function somewhat like this:
for i:= 0 to NumberOfModules - 1 do begin
TempRTF := TDmsText.CreateDynamic;
TempRTF.LoadFromStream(Database.ReadDmsModule(ModuleList[i]), '', True);
RTF.HeaderFooter.AppendAsSection(TempRTF.HeaderFooter);
end;
The whole document has header and footer of the first RTF-document in the module-list. The headers and footers of the other documents are ignored!
does not automatically select certain properties for the created new section. You can use the returned reference, a TWPSectionProps object ans use its property 'Select' to set which props it should use. This is important for page size, landscape etc.
I assume you have latest release, at least V5.17.3 ?
meanwhile I figured out that the preview does not work correctly. When saving the document as RTF-file, the headers and footers are correct, but the preview window shows only header and footer of the first document!
I tried it with the standard preview dialog like this