Re: RTF documents as templates

2010-06-09 Thread stephen barncard
Pure RTF text files created by Rev are a styled text format that is
readable by Word and most text editors, but does not include images.

  On the mac, RTF documents (note the suffix .rtfd) created by TextEdit are
actually BUNDLES, not files, and contain the RTF file and the graphic files.
 RTF files saved by Word I believe do not save images either,  that is for
the .doc format.

On 8 June 2010 15:20, JosepM jmye...@mac.com wrote:


 Hi again,

 Some questions for the experts...

 How can open or print a RTF file without Word? TextEdit loss the images and
 format of tables...

 How can open and print from Applescript without view the flashing RTF file?



 Salut,
 Josep
 --
 View this message in context:
 http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2248114.html
 Sent from the Revolution - User mailing list archive at Nabble.com.
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
-
Stephen Barncard
San Francisco
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-06-09 Thread Jan Schenkel
I recall a post from November 2008 where Franz Böhmisch posted a way to embed 
images into RTF files, followed by Ken Ray's abstraction of said method. 
Searching the use-revolution archives, I found these two links for you:
http://mail.runrev.com/pipermail/use-revolution/2008-November/117180.html
http://mail.runrev.com/pipermail/use-revolution/2008-November/117212.html

Other than that, I'm afraid there's no built-in way to print those RTF 
documents and you'd have to rely on the presence of MS Word on the end-user 
machine. While it's nearly ubiquitous on Windows, MacOSX is another matter so 
you may have to decypher the .rtfd bundle format that TextEdit uses, to cram 
your images into it.

Jan Schenkel
=
Quartam Reports  PDF Library for Revolution
http://www.quartam.com

=
As we grow older, we grow both wiser and more foolish at the same time.  (La 
Rochefoucauld)


--- On Wed, 6/9/10, stephen barncard stephenrevoluti...@barncard.com wrote:

 Pure RTF text files created by Rev
 are a styled text format that is
 readable by Word and most text editors, but does not
 include images.
 
   On the mac, RTF documents (note the suffix .rtfd)
 created by TextEdit are
 actually BUNDLES, not files, and contain the RTF file and
 the graphic files.
  RTF files saved by Word I believe do not save images
 either,  that is for
 the .doc format.
 
 On 8 June 2010 15:20, JosepM jmye...@mac.com
 wrote:
 
 
  Hi again,
 
  Some questions for the experts...
 
  How can open or print a RTF file without Word?
 TextEdit loss the images and
  format of tables...
 
  How can open and print from Applescript without view
 the flashing RTF file?
 
 
 
  Salut,
  Josep
  


   

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-06-09 Thread JosepM

Hi List,

Here my tests... 
In MacOSX the RTF is RTFD that is a bundle as explained Jan.
 
Showing the contents of bundle you can found one TXT.rtf file that contain
the text and the n files for the asociated images used in the creation of
the file from TextEdit.

Steps.

1 Open TextEdit and create your template using images and positioning using
tables if you need. If not put your text formated as you need.
2 Where you need replace some part, use the [[myreplacedtext1]] using [[ to
open and ]] to close. As Jan show in her link above.
3 Save as RTFD
4 Open from Rev with the following code. The question is to open the TXT.rtf
file and modify it.
5 Open directly from TextEdit and Print using Rev or Applescript.

Pro
No MS Word need.
Easy way to use templates for the user.

Con
Poor alignment format, only tables, so to build some document A4 or Letter
for example you need to check the lines, footers, etc...

on mouseUp
   
   put mactoiso(áàïô_test) into text1
   put This a long text to see how is showed inside the rtf file into
description
   put Bottom text into footer
   put the system date into tDate
  
   answer file Where is the template file?
   if it is empty then exit mouseUp
   
   put it into theTemplateFile
   
   -- Duplicate the file with a new name

   put TXT.rtf into tFichero
   put theTemplateFile  /  tFichero into tTheFile
   put URL(binfile:  tTheFile) into theRTFtext
   
   set the fileType to MSWDRTF 
   
   put merge(theRTFtext) into URL (binfile:  tTheFile)
end mouseUp


Salut,
Josep
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2249102.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-06-09 Thread JosepM

Update code using theRTFText of field 
The revCopyFile don't copy the bundle, only create the file so searching for
the list I found a piece of code to copy using the shell.

If someone want the stack and the RTF file to test email me and I send you.

Salut,
Josep

on mouseUp
   
   put mactoiso(the RTFText of fld f_texto1) into texto1
   put mactoiso(the RTFText of fld f_texto2) into texto2
   
   put mactoiso(the RTFText of fld f_texto_f1c1) into texto_f1c1
   put mactoiso(the RTFText of fld f_texto_f1c2) into texto_f1c2
   put mactoiso(the RTFText of fld f_texto_f1c3) into texto_f1c3
   
   put mactoiso(the RTFText of fld f_texto_f2c1) into texto_f2c1
   put mactoiso(the RTFText of fld f_texto_f2c2) into texto_f2c2
   put mactoiso(the RTFText of fld f_texto_f2c3) into texto_f2c3
   
   answer file Where is the template file?
   if it is empty then exit mouseUp
   put it into theTemplateFile
   
   ask file Save your message as: with TheResultingRTF.rtfd
   if it is empty then exit mouseUp
   put it into theMergedFile
   
   set the fileType to MSWDRTF 
   --
   put (cp -R -p quotetheTemplateFilequotequotetheMergedFilequote)
into tCommand 
   get shell(tCommand) 
   --
   
   put TXT  .rtf into tFichero
   put theTemplateFile  /  tFichero into tTheFile
   put URL(binfile:  tTheFile) into theRTFtext
   
   set the fileType to MSWDRTF 
   
   put merge(theRTFtext) into URL (binfile:  theMergedFile  / 
tFichero)
end mouseUp
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2249205.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-06-08 Thread JosepM

Hi Jan,

And this can work if the word have images? I can't... :(


Salut,
Josep M.
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2248067.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-06-08 Thread JosepM

Hi again,

Some questions for the experts... 

How can open or print a RTF file without Word? TextEdit loss the images and
format of tables...

How can open and print from Applescript without view the flashing RTF file? 



Salut,
Josep
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2248114.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-06-07 Thread Jan Schenkel
--- On Tue, 6/1/10, Robert Brenstein r...@robelko.com wrote:
 On 31.05.10 at 10:50 -0700 JosepM
 apparently wrote:
  Nop. My solution was store the entire document and
 search and replace before
  to build the document, and then out as PDF using
 Quartam PDF Library and
  Quartam Reports, but also you can print from a card.
  
 
 If you need to just print, producing PDF files might be a
 way to go. Using RTF works as well. I used RTF documents as
 templates to produce Word docs. Basically, I created a full
 blown, properly formatted Word doc as template, then
 replaced variable elements with tokens, in my case things
 like [title], [description]. Rev stack read RTF directly
 into a variable and replaced the tokens, then saved new
 file. One needs to use RTF commands for marking new
 paragraphs, styles, and code non-English characters. I even
 used to produce Word table with varying numbers of rows by
 marking a repeating code for row in RTF and replicating it
 as many times as needed. Some sleuthing required, though, to
 decipher blocks in RTF.
 
 Robert
 

Sorry for the late reply - I'm just resurfacing after several months of 
deadlines at the day-job.

Anyway, a while ago I wrote two articles for the revUp newsletter, titled 'The 
Word of Merge':
- part 1: http://runrev.com/newsletter/november/issue61/newsletter3.php
- part 2: http://www.runrev.com/newsletter/december/issue62/newsletter3.php

In short, create a template file in Word, with double square brackets around 
variable names or revTalk expressions; save the template file in RTF format; 
read the file into a variable and use the 'merge' function to dynamically 
replace the content of each bit of text inside the double square brackets with 
its value.

HTH,

Jan Schenkel
=
Quartam Reports  PDF Library for Revolution
http://www.quartam.com





  

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-06-01 Thread JosepM

Let's try :)
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2238165.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-06-01 Thread Robert Brenstein

On 31.05.10 at 10:50 -0700 JosepM apparently wrote:

Nop. My solution was store the entire document and search and replace before
to build the document, and then out as PDF using Quartam PDF Library and
Quartam Reports, but also you can print from a card.



If you need to just print, producing PDF files might be a way to go. 
Using RTF works as well. I used RTF documents as templates to produce 
Word docs. Basically, I created a full blown, properly formatted Word 
doc as template, then replaced variable elements with tokens, in my 
case things like [title], [description]. Rev stack read RTF directly 
into a variable and replaced the tokens, then saved new file. One 
needs to use RTF commands for marking new paragraphs, styles, and 
code non-English characters. I even used to produce Word table with 
varying numbers of rows by marking a repeating code for row in RTF 
and replicating it as many times as needed. Some sleuthing required, 
though, to decipher blocks in RTF.


Robert
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-06-01 Thread Peter Haworth
I've been trying to figure out how to use an RTF document as a  
template using pretty much this same methodology.  The problem I ran  
into is that sometimes, for reasons I don;t understand,  the token  
names I put into the document get interspersed with RTF commands, so  
something that looks like [myToken] when displayed in Word ends up  
looking like [myRTF commandstoken].  That stops my search for  
tokens dead in it's tracks.


Another method I've tried is to set up a Word document with merge  
fields in it and have my application write out a comma delimited file  
that is the source for the merge data.  That works well if you have a  
predictable number of lines you want to print, not so good for  
variable number of lines.


Right now, I've settled on writing out html code from templates that  
are defined within my Application.  I have some conventions to deal  
with repeating lines.  For example, if I was printing an invoice,  
I'd define one html line in the format of an invoice line and its  
definition would include a code that tells me I need to repeat that  
line for each invoice line I'm printing.  That works quite well  
although so far I haven't figured out how to deal with printing a  
heading at the top of each page.


I guess I should break down and spend some money on a real report  
writer, especially since all my data is stored in an sqlite database  
but it's a fun challenge to figure this stuff out sometimes!


Pete Haworth

On Jun 1, 2010, at 10:00 AM, use-revolution-requ...@lists.runrev.com  
wrote:



Message: 16
Date: Tue, 1 Jun 2010 14:38:10 +0200
From: Robert Brenstein r...@robelko.com
Subject: Re: RTF documents as templates
To: How to use Revolution use-revolution@lists.runrev.com
Message-ID: p06240805c82aae204...@[192.168.1.94]
Content-Type: text/plain; charset=us-ascii ; format=flowed

On 31.05.10 at 10:50 -0700 JosepM apparently wrote:
Nop. My solution was store the entire document and search and  
replace before
to build the document, and then out as PDF using Quartam PDF  
Library and

Quartam Reports, but also you can print from a card.



If you need to just print, producing PDF files might be a way to go.
Using RTF works as well. I used RTF documents as templates to produce
Word docs. Basically, I created a full blown, properly formatted Word
doc as template, then replaced variable elements with tokens, in my
case things like [title], [description]. Rev stack read RTF directly
into a variable and replaced the tokens, then saved new file. One
needs to use RTF commands for marking new paragraphs, styles, and
code non-English characters. I even used to produce Word table with
varying numbers of rows by marking a repeating code for row in RTF
and replicating it as many times as needed. Some sleuthing required,
though, to decipher blocks in RTF.

Robert


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-06-01 Thread Andrew Kluthe

Tinkering with the demo version of wordLib. It seems wordLib enters it into
the field as HTMLText. This should make searching and replacing very easy,
no?  But i've noticed the formatting doesn't stay exact on the import. The
alignments are off on even the sample documents. Is there anyway to prevent
this I wonder?
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2239058.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-05-31 Thread Andrew Kluthe

Did you ever find a solution for this josep? I am in the early phases of
planning to do something exactly like this.
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2237515.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-05-31 Thread JosepM

Nop. My solution was store the entire document and search and replace before
to build the document, and then out as PDF using Quartam PDF Library and
Quartam Reports, but also you can print from a card. 

But now, some customers need customize reports and documents and again I
need do something. Actually I customize the docs and send to the customer
her document to use from Quartam Reports.

I was thinking to create the template from a card for example, and convert
for Quartam PDF or maybe using the new PrintToPDF when this will be
available in the next release 5.0

If you have any idea about I'm very glad to help and collaborate.

Salut,
Josep
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2237670.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-05-31 Thread Andrew Kluthe

What about using wordLib 1.3 to import template documents into a field, pull
the records you need from the database, do the calculations necessary and
fill the data into the placeholders saved into the word doc? 

This was the approach I was thinking of trying out. I would very much love
to collaborate on a solution along these lines. Something customizable, a
word Document template based reporting system.

My timeframe on needing this solution is starting to look like the end of
the week. How would you best like to work on this? via email?
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2237801.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-05-31 Thread JosepM

Hi Andrew,

You guess that is posible use the doc template with some graphic or  
images inside the word and fill all the data respecting the images  
format? I don't know wordLib 1.3
Also I think that maybe we can found other non-propietary format to  
use..., but let's try

As you wish, email is fine for me.

Salut,
Josep

El 31/05/2010, a las 22:27, Andrew Kluthe [via Runtime Revolution]  
escribió:

 What about using wordLib 1.3 to import template documents into a  
 field, pull the records you need from the database, do the  
 calculations necessary and fill the data into the placeholders saved  
 into the word doc?

 This was the approach I was thinking of trying out. I would very  
 much love to collaborate on a solution along these lines. Something  
 customizable, a word Document template based reporting system.

 My timeframe on needing this solution is starting to look like the  
 end of the week. How would you best like to work on this? via email?

 View message @ 
 http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2237801.html
 To unsubscribe from Re: RTF documents as templates, click here.



-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2237897.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: RTF documents as templates

2010-05-31 Thread Andrew Kluthe

*WordLib* supports many document features, from text fonts, sizes, and
styles to highlights, hyperlinks, and bullet lists and even images, tables,
and footnotes. Supported file formats are *MS Word 2007* (.docx, .docm,
.xml), *MS Word 2003*(.xml), *OpenOffice* (.odt), and *MS Word 97-2003* (.doc,
limited support).

http://curryk.com/wordlib.html

http://curryk.com/wordlib.html:) images and then some. It utilizes an HTML
rendering of the formatting, so searching and replacing the data should be
fine if we construct the templates correctly.

I am going to tinker with this tomorrow afternoon and see what I can come up
with.

On Mon, May 31, 2010 at 6:11 PM, JosepM [via Runtime Revolution] 
ml-node+2237897-163429925-139...@n4.nabble.comml-node%2b2237897-163429925-139...@n4.nabble.com
 wrote:

 Hi Andrew,

 You guess that is posible use the doc template with some graphic or images
 inside the word and fill all the data respecting the images format? I don't
 know wordLib 1.3
 Also I think that maybe we can found other non-propietary format to use...,
 but let's try

 As you wish, email is fine for me.

 Salut,
 Josep

 El 31/05/2010, a las 22:27, Andrew Kluthe [via Runtime Revolution]
 escribió:

 What about using wordLib 1.3 to import template documents into a field,
 pull the records you need from the database, do the calculations necessary
 and fill the data into the placeholders saved into the word doc?

 This was the approach I was thinking of trying out. I would very much love
 to collaborate on a solution along these lines. Something customizable, a
 word Document template based reporting system.

 My timeframe on needing this solution is starting to look like the end of
 the week. How would you best like to work on this? via email?

 --
  View message @
 http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2237801.html
 To unsubscribe from Re: RTF documents as templates, click here.




 --
  View message @
 http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2237897.html
 To unsubscribe from Re: RTF documents as templates, click 
 herehttp://runtime-revolution.278305.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=YW5kcmV3QHJqZGZhcm0uY29tfDIyMzc4MDF8MTMwNjMzOTU0Mg==.




-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/RTF-documents-as-templates-tp322967p2237974.html
Sent from the Revolution - User mailing list archive at Nabble.com.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RTF documents as templates

2007-10-29 Thread Josep

Hi everyone,

I need to use some word like docs like templates. Searching and replacing
some words or sentences to generate a new document. Any idea or sample to
how get the content of a word file and modify it?

Thanks,
Josep M
-- 
View this message in context: 
http://www.nabble.com/RTF-documents-as-templates-tf4712738.html#a13470913
Sent from the Revolution - User mailing list archive at Nabble.com.

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution