Saving a tab formatted field to a file and retaining its formatting

Robert J. Earp rjearp99 at gmail.com
Fri Apr 19 19:05:02 EDT 2019


Dear Håkan,
Please accept my apologies at not replying to you before, and many thanks for contacting me and the suggestion.  For our current use we can manually set the tab positions in a field, and now that we have learnt to combine "open printing to pdf" and “ evPrintField" we can easily output formatted .pdf docs.  Why this is not identified in the dictionary I don’t know, but like a lot of things in LC, and all of its predecessors, the dictionary leaves a lot to be desired and really you have to use it a lot to get proficient, to use the expertise of the user lists !!

Again, many thanks for the help, I hope I can reciprocate at some time.

Kind regards, Bob...



> On Apr 11, 2019, at 07:01, hakan at exformedia.se wrote:
> 
> If you want the tab stops to be included in the file I guess you need to add them manually to the rtf file. There is a \tx command in rtf that sets the tab size. I used it long time ago so I don’t remember of it was relative or absolut positions but I do think it should be doable…
> 
> :-Håkan
> On 8 Apr 2019, 18:25 +0200, Robert J. Earp via use-livecode <use-livecode at lists.runrev.com>, wrote:
>> Thanks for the reply Paul. Yes, tried that but there are problems. It saves a .rtf file but when you open that in MSWord (OS X or Windows) the tabs are changed to underscores. If you open the file in OS X TextEdit it does have tabs but the position/spacing is not retained. I’ve created a sample/test stack if anybody wants to play ;-)
>> 
>> Our project is supposed to create a formatted file that external to the LC project, gets assembled with other documents/files to make a presentable report. The other docs/files are .rtf (created in MSWord or Pages or TextEdit) and an .eps file. The final report will be a .pdf and Acrobat is likely what will get used to manually assemble the final report.
>> 
>> To quote my valued colleague (RogerG) on this problem, and who has spent inordinate hours trying to find a solution, tabs have turned out to be tricky little devils in LC !!
>> 
>> best, Bob...
>> 
>>> From: Paul Dupuis <paul at researchware.com <mailto:paul at researchware.com>>
>>> To: use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>
>>> Subject: Re: Saving a tab formatted field to a file and retaining its
>>> formatting
>>> Message-ID: <ce0de0c4-5daa-22c0-bf46-cfeceb79a2c7 at researchware.com <mailto:ce0de0c4-5daa-22c0-bf46-cfeceb79a2c7 at researchware.com>>
>>> Content-Type: text/plain; charset=utf-8; format=flowed
>>> 
>>> I take it your have tried:
>>> 
>>> put the rtfText of field "X" into URL
>>> ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
>>> 
>>> And then reading it back to a new field with:
>>> 
>>> set the rtfText of field "Y" to URL
>>> ("file:"&specialFolderPath("desktop")&slash&"savedfield.rtf")
>>> 
>>> and the tab spacing is not preserved?
>>> 
>>> 
>>> 
>>> On 4/7/2019 7:57 PM, Robert J. Earp via use-livecode wrote:
>>>> Dear all, we have a field that is formatted nicely with tabs and want to save that as a file, retaining the tab formatting. The saved file format ideally should be .rtf but we may be able to use other formats such as .pdf
>>>> 
>>>> Anybody got any ideas how to do this ?
>>>> 
>>>> Thanks in advance for your suggestions.
>>>> 
>>>> best, Bob?
>>>> 
>>>> Bob Earp - White Rock, BC, Canada
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list