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

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

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

Post by saeid2016 » Mon Jan 22, 2018 2:55 pm

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 » Tue Jan 23, 2018 8:25 am

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: 64
Joined: Wed Mar 16, 2016 11:56 am

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

Post by saeid2016 » Tue Jan 23, 2018 3:08 pm

That's right. Thank you very much.

Post Reply