Page 1 of 1

Extracting long text fields, rich text, carriage returns etc

Posted: 30 Mar 2022 14:13
by Talln
Hi again - another API question...

I've had some fun trying to figure out how to extract long text fields, e.g. Notes or Text from Source, with all the html formatting in tact (or with known control char behaviour). These can either be rich text/embedded html or plain text with/without carriage returns.

Using fhGetItemText or fhGetDisplayText I seem to get cropped versions with all the paragraphs munged into a single unformatted text sentence.

This might be a LUA string handling artefact or the way the FH API returns the data in the way I've been using it.

Do you have to use the GetParagraph function ? What if a para is too long for the API ?

Can anyone provide a snippet of how it should be done please!

Thanks in anticipation!

Cheers
Paul

Re: Extracting long text fields, rich text, carriage returns etc

Posted: 30 Mar 2022 14:36
by Jane
You need to create a Rich Text Object and pull the note into that.

See
https://www.family-historian.co.uk/help ... h_text.htm
and
https://www.family-historian.co.uk/help ... syntax.htm
in the plugin help.

Re: Extracting long text fields, rich text, carriage returns etc

Posted: 30 Mar 2022 14:45
by tatewise
Use the fhGetValueAsRichText(...) function to extract the Notes or Text from Source.
See https://www.family-historian.co.uk/help ... chtext.htm

Re: Extracting long text fields, rich text, carriage returns etc

Posted: 30 Mar 2022 18:06
by Talln
Thanks for the help. Will give it a go! :D