Foot notes in exported documents?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10220
Joined: Fri Feb 19, 2010 10:17 am

Foot notes in exported documents?

Post by richmond62 » Sat Nov 08, 2025 1:05 pm

Imagine, if you will, a routine to export the contents of a field to an RTF document . . .
-
SS 2025-11-08 at 13.22.08.png
-
(screenshot from my latest trick)

BUT, instead of 'just' exporting the contents of the field you want to APPEND a line that ALWAYS ends up at the end of the RTF document and in a small textSize, so this is NO GOOD:
-
SS 2025-11-08 at 13.25.44.png
-
BUT, the same text should be resized AND at the bottom of one's A4 / US letter size document ready for printing:
-
SS 2025-11-08 at 13.30.44.png

Klaus
Posts: 14267
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Foot notes in exported documents?

Post by Klaus » Sat Nov 08, 2025 1:52 pm

Hi Richmond,

I'm afraid this can only be done by manipulating the raw rtf text before exporting.

Best
Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10220
Joined: Fri Feb 19, 2010 10:17 am

Re: Foot notes in exported documents?

Post by richmond62 » Sat Nov 08, 2025 2:25 pm

I'm afraid this can only be done by manipulating the raw rtf text before exporting.
Well, I have nothing against that, but I am not sure how to do that.

Adding a header is dead easy, and adding some text directly after the text to be exported is also dead easy.

What is NOT so easy is to append a line of text in such a way that when an RTF document is exported it lands up at the bottom of the page.
Last edited by richmond62 on Sat Nov 08, 2025 2:58 pm, edited 1 time in total.

Klaus
Posts: 14267
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Foot notes in exported documents?

Post by Klaus » Sat Nov 08, 2025 2:44 pm

What si NOT so easy is to append a line of text in such a way that when an RTF document is exported it lands up at the bottom of the page.
Yep, exactly what I was thinking!

stam
Posts: 3141
Joined: Sun Jun 04, 2006 9:39 pm

Re: Foot notes in exported documents?

Post by stam » Sat Nov 08, 2025 3:00 pm

I've not tested, but how about manipulating the htmlText of the field and then exporting to RTF?

I would imagine it's possible to lock screen, add a line at the end, style it with html, export it, delete the last line and unlock screen or some such.

Klaus
Posts: 14267
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Foot notes in exported documents?

Post by Klaus » Sat Nov 08, 2025 3:05 pm

Good idea!
As long as LCs thml implementation supports the "footer" tag.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10220
Joined: Fri Feb 19, 2010 10:17 am

Re: Foot notes in exported documents?

Post by richmond62 » Sat Nov 08, 2025 3:08 pm

One of my favourite pieces of software:

https://wordsearchcreator.org/downloads/

does what I'd like to do:
-
SS 2025-11-08 at 16.06.18.jpg

Klaus
Posts: 14267
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Foot notes in exported documents?

Post by Klaus » Sat Nov 08, 2025 3:11 pm

Can't see any relation to your problem? :shock:

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10220
Joined: Fri Feb 19, 2010 10:17 am

Re: Foot notes in exported documents?

Post by richmond62 » Sat Nov 08, 2025 4:14 pm

Klaus, please don't start on about 'my problem' as that's a personal matter between me and my psychiatrist. 8)

The screenshot of the document produced by the wordsearch software illustrates EXACTLY what I wish to achieve.

Klaus
Posts: 14267
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Foot notes in exported documents?

Post by Klaus » Sat Nov 08, 2025 5:03 pm

Oops, sorry, did not scroll, so I didn't see the "footer".

OK, Wordsearchcreator can do it, but that does not help you, or does it?
Did you try with HTML text?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10220
Joined: Fri Feb 19, 2010 10:17 am

Re: Foot notes in exported documents?

Post by richmond62 » Sat Nov 08, 2025 5:35 pm

that does not help you
No, indeed, it does not, but I thocht I'd just bung that in as an example of some software that did what I want to do, forbye.

I suppose one could 'go round the houses' via HTML to RTF . . . off for a fiddle around.

As far as I recall LC only copes with a reduced subsection of HTML code.

SparkOut
Posts: 2961
Joined: Sun Sep 23, 2007 4:58 pm

Re: Foot notes in exported documents?

Post by SparkOut » Sat Nov 08, 2025 11:10 pm

Here's an approach you might find actually quite simple (for some definition of simple)

Create a template rtf file with the header and footer layout you want.
In the places you want content generated from your app to be inserted, put a placeholder label surrounded by doubled square brackets.
After you have created the rtf file, open it in a text editor. Make sure your placeholders are surrounded by the [[ ]] markers, it could be that the rtf formatting code has inserted itself between the square brackets and the placeholder label, so if necessary, move the brackets to the correct place immediate surrounding the placeholder label.

If you want, you can import the template as a "binfile" and set a custom property to that data, for simple portability, assuming you don't regularly want to edit the template layout/styling.

Put your desired content into variables named to match the placeholders, and call the merge function. Export the returned content to another binfile and you will have an rtf document with headers and footers. The styling of the headers and footers from LC may not translate very well, at least colours anyway, I noticed. I'm sure more analysis of the rtf format would reveal a better way, but it might be easier to style the header and footer in the template as you wish, then leave the variable content from LC to merge as plain text, and inherit the styling from the document. The body rtf text should cope with most... I think. I've not tested exhaustively.
Attachments
RTFmerge.zip
(11.61 KiB) Downloaded 9 times
Last edited by SparkOut on Sun Nov 09, 2025 5:10 am, edited 2 times in total.

SparkOut
Posts: 2961
Joined: Sun Sep 23, 2007 4:58 pm

Re: Foot notes in exported documents?

Post by SparkOut » Sat Nov 08, 2025 11:12 pm

Content in LC.png
RTF template.png
RTF template.png (5.52 KiB) Viewed 228 times
placeholder brackets surround label.png
placeholder brackets surround label.png (10.08 KiB) Viewed 228 times

SparkOut
Posts: 2961
Joined: Sun Sep 23, 2007 4:58 pm

Re: Foot notes in exported documents?

Post by SparkOut » Sat Nov 08, 2025 11:14 pm

RTF output.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10220
Joined: Fri Feb 19, 2010 10:17 am

Re: Foot notes in exported documents?

Post by richmond62 » Sun Nov 09, 2025 1:28 pm

Tried appending this:

<footer>
<p>© 2025 MyWebsite. All rights reserved.</p>
</footer>

to HTML export and got nowhere:
-
SS 2025-11-09 at 14.31.43.png
SS 2025-11-09 at 14.31.43.png (10.8 KiB) Viewed 159 times

Post Reply