deleting CARRIAGE RETURN(#13) and LINE FEED(#10) characters from footnote

General TRichView support forum. Please post your questions here
Post Reply
saeid2016
Posts: 72
Joined: Wed Mar 16, 2016 11:56 am

deleting CARRIAGE RETURN(#13) and LINE FEED(#10) characters from footnote

Post by saeid2016 »

Hello support,

I want to insert a footnote with text that has CR, LF characters. but after insert, this characters have been deleted.

Code: Select all

procedure TForm1.mitInsertFootnoteClick(Sender: TObject);
var
  FootNote: TRVFootnoteItemInfo;
  NoteRef:  TRVNoteReferenceItemInfo;
  MyNoteText : string;
begin

  MyNoteText := 'This is first line'+#13+#10+'This is second line'+#13+#10+'This is third line';

  FootNote := TRVFootnoteItemInfo.CreateEx(rveMain.RVData,
    RVGetNoteTextStyleNo(rvs, rveMain.CurTextStyleNo), 1, False);
  NoteRef := TRVNoteReferenceItemInfo.CreateEx(FootNote.Document,
    RVGetNoteTextStyleNo(rvs, 0));
  FootNote.Document.AddItem('', NoteRef);
  
  FootNote.Document.AddNL(' '+MyNoteText, 0, -1);
  
  if rveMain.InsertItem('', FootNote) then
    rveNote.SetFocus;
end;
Steku
Posts: 9
Joined: Fri Dec 13, 2013 4:01 pm

Re: deleting CARRIAGE RETURN(#13) and LINE FEED(#10) characters from footnote

Post by Steku »

From online help: https://www.trichview.com/help/index.ht ... latag.html
s is a text string to add. It must not contain CR, LF, TAB, FF characters (#13, #10, #9, #12). To add several lines of text use AddTextNL.
Maybe it helps...

Regards...
saeid2016
Posts: 72
Joined: Wed Mar 16, 2016 11:56 am

Re: deleting CARRIAGE RETURN(#13) and LINE FEED(#10) characters from footnote

Post by saeid2016 »

That's right. Thank you very much.
Post Reply