WPCubed Product Support

Problem concatenating RTF files

Hello,

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!

what's wrong with this?

#1 ♥ 0
4.6k Views 2 users read 2 min
support

Hi,

RTF.HeaderFooter.AppendAsSection(TempRTF.HeaderFooter)

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 ?

Julian

#2 ♥ 0

Hi,

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

RTF.SaveToFile('d:\test.rtf');
WPPreviewDlg1:= TWPPreviewDlg.Create(nil);
WPPreviewDlg1.EditBox:= RTF;
WPPreviewDlg1.execute;

test.rtf is correct, preview not

any idea? (I have v5.17.4)

#3 ♥ 0

Hi,

I use a class which inherits from TWPRichText. If I use TWPRichText directly it works...

needs further investigation...

#4 ♥ 0
This category is archived. No new posts are possible.