Subject | Re: [firebird-support] rtf-to-plaintext udf? |
---|---|
Author | Urs Liska |
Post date | 2005-01-31T16:38:40Z |
Ivan Prenosil schrieb:
Further test showed the "SaveToStream" function causing the problem
(perhaps directing towards the idea that you are right with your
comments below)
blob udfs directly from borland, so I thought it should be correct...
(e.g. a ready-to-use rtf parsing component (or better: function)). To
create one myself seems not feasible because it's not only about
stripping the formatting tags but also to replace all escape characters.
But how can I take care that only plain text gets into the relevant
fields of the database.
Do you think it is enough to document it, so any application developer
(who might be dealing with my db in future) will do as necessary?
Thank you for the comments
Urs
> * perhaps the problem can be somewhere else, before assigningI think so, but I was probably wrong with the place of the crash.
> PlainText property. E.g. do you have correct definition of blob
> structure and get segment function ?
Further test showed the "SaveToStream" function causing the problem
(perhaps directing towards the idea that you are right with your
comments below)
>Ah, this looked a little bit strange to me too. But I used a tutorial on
> * the blob can be potentially segmented, so you need to call
> getsegment in a loop
blob udfs directly from borland, so I thought it should be correct...
>That's right. I changed this already but it didn't help.
> *
>
>> result := ib_util_malloc(length(rtf.text) + 1);
>> ZeroMemory(result, length(rtf.text) + 1);
>> result := resultString(PChar(str.dataString), str.Size + 1);
>
>
> are not you overwriting the pointer allocated by ib_util_malloc ?
> * TRichEdit is visual component, which is probably not much good forThat's what I think also. But I didn't find any working solution yet
> use in UDF.
(e.g. a ready-to-use rtf parsing component (or better: function)). To
create one myself seems not feasible because it's not only about
stripping the formatting tags but also to replace all escape characters.
> * it is many years since I worked with rich edit component, so IThanks for the tip, unfortunately nothing of special interest there
> already forgot the problems I had with it, but perhaps you can find
> some useful info here http://home.att.net/~robertdunn/Yacs.html
> * I would parse plain text fields in UDF, but convert more complexGood point. I think I will go in this direction.
> formats to plain text on client. You may want to support more kinds
> of data later, like Word documents, and calling any Word functions in
> FB server using UDF is not a good idea ...
But how can I take care that only plain text gets into the relevant
fields of the database.
Do you think it is enough to document it, so any application developer
(who might be dealing with my db in future) will do as necessary?
Thank you for the comments
Urs
>
> ----- Original Message ----- From: "Urs Liska" <firebird@...>
> To: <firebird-support@yahoogroups.com> Sent: Friday, January 28,
> 2005 9:32 PM Subject: [firebird-support] rtf-to-plaintext udf?
>