in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

data field to save formatted text in i.e. rtf file

Last post 09-25-2007 8:29 AM by Robert Simpson. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-12-2007 11:10 PM

    data field to save formatted text in i.e. rtf file

    Hi,

    I am new to sqlite. I am trying to write an application that performs a lot of text manipulation which results in a pdf file complete with table of contents, page numbers, columns and formatted text. Using .Net and the rtf (rich format text box) I can display rtf files, maintaining all their formatting, but I can't find a database that will store formatted text in such a way that it will again show up in the rtf box with it's formatting. I would like to store the information in a database rather than a file since I will need to maintain numerous copies, not to mention default copies and I do not want files around that the user could find and make changes to.

    sqlite was used to create formatted html files for a similar project and seemed to work very nicely but when I try to display the same field in an rtf box through .net, I see the format characters i.e. <p>some text aljfa ljlfaljlljlasjf;lsajf oif jl la jld alfjla <\p> . I also see the format characters when I try to write the text into a word document. If I double click the field in my sqlite database browser, the text is shown with all of it's formatting in place and not the format characters.

    I tried importing an rtf file with the formatted text into the database field (created as a text field in the sqlite db) and it showed me the formatting symbols again, along with the text but did not perform the formatting.

     Does anyone know of a way to do this? Documentation I have read on rtf boxes says that they are particulary nice for displaying rtf files since they will show the formatting and that it is possible to save to a file or to save in a database as long as it can handle large amounts of data, such as a memo field.

     Any ideas? Thanks for any help anyone can give.

  • 09-25-2007 8:29 AM In reply to

    Re: data field to save formatted text in i.e. rtf file

    This is actually beyond the scope of the database.  There's no such thing as "formatted html" and "formatted text" the way you describe.  HTML is "formatted" by interpreting the embedded codes like <p> and </p> and rendering the text appropriately.  In otherwords, the "formatting" is done by interpretation and rendering, and not by the database.

    Save a webpage as an HTM file to disk and then open it with notepad.  You'll see the formatting codes needed to render the document.  Same thing with rich text.

    If you want to save rich text and preserve the formatting when its rendered, get and set the .Rtf property of the RichTextBox control.  It contains the raw RTF data and codes necessary for the rich text box to format the text.

    Robert

     

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems