1. Blatt wrapper question
- Posted by George Walters <gwalters at sc.rr.com> May 03, 2005
- 459 views
If I use eublatt to email a txt file (i.e an invoice or quotation) does the result seen by the receiver look like it would if printed on a printer? In the past (on another OS) spaces have been removed and then columnar data is no longer lined up? If it is not lined up how can I solve this problem.
2. Re: Blatt wrapper question
- Posted by cklester <cklester at yahoo.com> May 03, 2005
- 475 views
- Last edited May 04, 2005
George Walters wrote: > > If I use eublatt to email a txt file (i.e an invoice or quotation) does > the result seen by the receiver look like it would if printed on a printer? You can't know that unless you know how the user will be viewing it. If someone views a text file in Microsoft Word, it's quite possible that it will NOT look the same as when viewed in Notepad. That's simply because of the different fonts used by each application. However, if you create the file in Notepad and the viewer uses Notepad to view it, then yes, it will look the same as when printed. -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
3. Re: Blatt wrapper question
- Posted by Bernie Ryan <xotron at bluefrog.com> May 03, 2005
- 472 views
- Last edited May 04, 2005
cklester wrote: > > George Walters wrote: > > > > If I use eublatt to email a txt file (i.e an invoice or quotation) does > > the result seen by the receiver look like it would if printed on a printer? > > You can't know that unless you know how the user will be viewing it. > > If someone views a text file in Microsoft Word, it's quite possible that it > will NOT look the same as when viewed in Notepad. That's simply because of > the different fonts used by each application. > > However, if you create the file in Notepad and the viewer uses Notepad to > view it, then yes, it will look the same as when printed. > > -=ck > "Programming in a state of EUPHORIA." > <a > href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a> > CK: If he sent it in HTML then it would look the same wouldn't it ? Bernie My files in archive: w32engin.ew mixedlib.e eu_engin.e win32eru.ew Can be downloaded here: http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan
4. Re: Blatt wrapper question
- Posted by cklester <cklester at yahoo.com> May 04, 2005
- 452 views
Bernie Ryan wrote: > cklester wrote: > > George Walters wrote: > > > If I use eublatt to email a txt file (i.e an invoice or quotation) does > > > the result seen by the receiver look like it would if printed on a > > > printer? > > You can't know that unless you know how the user will be viewing it. > > If someone views a text file in Microsoft Word, it's quite possible that it > > will NOT look the same as when viewed in Notepad. That's simply because of > > the different fonts used by each application. > > However, if you create the file in Notepad and the viewer uses Notepad to > > view it, then yes, it will look the same as when printed. > If he sent it in HTML then it would look the same > wouldn't it ? Yeah, I'd think that HTML would be a good format for distribution of something like that... as long as the user viewed it in a browser and not in, say, Notepad! heheh. -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
5. Re: Blatt wrapper question
- Posted by George Walters <gwalters at sc.rr.com> May 04, 2005
- 442 views
I think that would work. I've looked in the archives for a txt to html converter but did not find one. There's one in pearl and some for sale. Has anyone attempted this in EU?
6. Re: Blatt wrapper question
- Posted by Juergen Luethje <j.lue at gmx.de> May 04, 2005
- 441 views
George Walters wrote: > I think that would work. I've looked in the archives for a txt to html > converter but did not find one. There's one in pearl and some for sale. > Has anyone attempted this in EU? Yep. If you want to buy a converter, please tell me. Or use the following code. It is deliberately simple (for instance if there is a URL in the text, it won't be "clickable" in the generated HTML file). However, it exactly shows the text like it is in the plain text file, with all columns at their correct position.
function rextract (sequence source, object x) for i = length(source) to 1 by -1 do if equal(source[i], x) then return source[1..i-1] end if end for return source end function constant HTML_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" & "<html>\n" & "<head>\n" & "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-15\">\n" & "<title>%s</title>\n" & "</head>\n\n" & "<body>\n", HTML_FOOTER = "</body>\n" & "</html>" global procedure text2html (sequence infile) object line sequence title, outfile integer ifn, ofn title = rextract(infile, '.') outfile = title & ".htm" ifn = open(infile, "r") ofn = open(outfile, "w") printf(ofn, HTML_HEADER, {title}) puts(ofn, "<pre>\n") while 1 do line = gets(ifn) if atom(line) then exit end if puts(ofn, line) end while puts(ofn, "</pre>\n") puts(ofn, HTML_FOOTER) close(ifn) close(ofn) end procedure include file.e -- for dir() include get.e -- for wait_key() constant CMD = command_line() object list, void if length(CMD) < 3 then puts(1, "Usage: txt2html <filespec>") void = wait_key() abort(1) end if list = dir(CMD[3]) if atom(list) then puts(1, "No matching file found: " & CMD[3]) void = wait_key() abort(1) end if for i = 1 to length(list) do text2html(list[i][D_NAME]) end for
Regards, Juergen
7. Re: Blatt wrapper question
- Posted by George Walters <gwalters at sc.rr.com> May 04, 2005
- 421 views
Wonderful, thanks. I'll give it a try.
8. Re: Blatt wrapper question
- Posted by Juergen Luethje <j.lue at gmx.de> May 04, 2005
- 448 views
George Walters wrote: > Wonderful, thanks. I'll give it a try. The code that I had posted previously is not correct. I had assumed by mistake, that between <pre> and </pre> it's not necessary to mask certain characters. But it _is_ necessary. Here is the corrected version:
-- simple txt2HTML program, 2005-05-04 by Juergen Luethje -- (requires at least Eu 2.5 because of $) -------------------------[ utility functions ]-------------------------- function rextract (sequence source, object x) for i = length(source) to 1 by -1 do if equal(source[i], x) then return source[1..i-1] end if end for return source end function function matchs (sequence s, sequence source, integer start) integer posn if start >= 1 and start <= length(source) then posn = match(s, source[start..$]) if posn then return posn + start - 1 end if end if return 0 end function function replace (sequence source, sequence whatToReplace, sequence replaceWith) integer posn if length(whatToReplace) then posn = match(whatToReplace, source) while posn do source = source[1..posn-1] & replaceWith & source[posn+length(whatToReplace)..$] posn = matchs(whatToReplace, source, posn+length(replaceWith)) end while end if return source end function ----------------------------[ text to HTML ]---------------------------- constant HTML_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" & "<html>\n" & "<head>\n" & "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-15\">\n" & "<title>%s</title>\n" & "</head>\n\n" & "<body>\n", HTML_FOOTER = "</body>\n" & "</html>" global procedure text2html (sequence infile) object line sequence title, outfile integer ifn, ofn title = rextract(infile, '.') outfile = title & ".htm" ifn = open(infile, "r") ofn = open(outfile, "w") printf(ofn, HTML_HEADER, {title}) puts(ofn, "<pre>\n") while 1 do line = gets(ifn) if atom(line) then exit end if line = replace(line, "&", "&") line = replace(line, "<", "<") line = replace(line, ">", ">") line = replace(line, "\"", """) line = replace(line, {128}, "€") puts(ofn, line) end while puts(ofn, "</pre>\n") puts(ofn, HTML_FOOTER) close(ifn) close(ofn) end procedure --------------------------------[ main ]-------------------------------- include file.e -- for dir() include get.e -- for wait_key() constant CMD = command_line() object list, void if length(CMD) < 3 then puts(1, "Usage: txt2html <filespec>") void = wait_key() abort(1) end if list = dir(CMD[3]) if atom(list) then puts(1, "No matching file found: " & CMD[3]) void = wait_key() abort(1) end if for i = 1 to length(list) do text2html(list[i][D_NAME]) end for
Regards, Juergen
9. Re: Blatt wrapper question
- Posted by Juergen Luethje <j.lue at gmx.de> May 04, 2005
- 452 views
I wrote: > George Walters wrote: > >> Wonderful, thanks. I'll give it a try. > > The code that I had posted previously is not correct. > I had assumed by mistake, that between <pre> and </pre> it's not necessary > to mask certain characters. But it _is_ necessary. Here is the corrected > version: > > }}} <eucode> Unfortunately, the code partly is shown incorrect on EUforum (e-mail is currently "dead" again anyway ...). <snip> > line = replace(line, "&", "&") > line = replace(line, "<", "<") > line = replace(line, ">", ">") <snip> The above lines are not correct. The software that generates the EUforum HTML pages probably is confused what parts of my code that looks like HTML should be interpreted, and what parts should be displayed unchanged. So I'll try out the new EUforum attachment feature. The corrected version of my little program should be here: http://www.RapidEuphoria.com/uploads/txt2html.zip Regards, Juergen
10. Re: Blatt wrapper question
- Posted by cklester <cklester at yahoo.com> May 04, 2005
- 439 views
George Walters wrote: > > I think that would work. I've looked in the archives for a txt to html > converter but did not find one. There's one in pearl and some for sale. > Has anyone attempted this in EU? Do your original template in HTML so you don't have to convert... or do you have a txt file already and you want to convert it? -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
11. Re: Blatt wrapper question
- Posted by cklester <cklester at yahoo.com> May 04, 2005
- 461 views
Juergen Luethje wrote: > > So I'll try out the new EUforum attachment feature. The corrected version > of my little program should be here: > http://www.RapidEuphoria.com/uploads/txt2html.zip Rob, you can make URLs clicky... :) -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
12. Re: Blatt wrapper question
- Posted by "Juergen Luethje" <j.lue at gmx.de> May 04, 2005
- 443 views
George Walters wrote: > If I use eublatt to email a txt file (i.e an invoice or quotation) does > the result seen by the receiver look like it would if printed on a printer? > > In the past (on another OS) spaces have been removed and then columnar data > is no longer lined up? If it is not lined up how can I solve this problem. What is eublatt? I searched for "blatt" and "eublatt" in the archieves, but didn't get a result. Regards, Juergen
13. Re: Blatt wrapper question
- Posted by cklester <cklester at yahoo.com> May 04, 2005
- 432 views
Juergen Luethje wrote: > > What is eublatt? I searched for "blatt" and "eublatt" in the archieves, > but didn't get a result. Look for "blat." It's an SMTP library for Windows. -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
14. Re: Blatt wrapper question
- Posted by Juergen Luethje <j.lue at gmx.de> May 04, 2005
- 444 views
cklester wrote: > Juergen Luethje wrote: >> >> So I'll try out the new EUforum attachment feature. The corrected version >> of my little program should be here: >> http://www.RapidEuphoria.com/uploads/txt2html.zip > > Rob, you can make URLs clicky... :) In your post, the quoted URL is clicky. I believe it was my fault, because by mistake I wrote the URL between [eudode][/eudode]. Regards, Juergen
15. Re: Blatt wrapper question
- Posted by cklester <cklester at yahoo.com> May 04, 2005
- 442 views
Juergen Luethje wrote: > cklester wrote: > > Juergen Luethje wrote: > >> So I'll try out the new EUforum attachment feature. The corrected version > >> of my little program should be here: > >> <a > >> href="http://www.RapidEuphoria.com/uploads/txt2html.zip">http://www.RapidEuphoria.com/uploads/txt2html.zip</a> > > Rob, you can make URLs clicky... :) > In your post, the quoted URL is clicky. > I believe it was my fault, because by mistake I wrote the URL between > [eudode][/eudode]. Yeah, I noticed that it was clickly in the reply to my message... which baffled me for a moment. heheh. -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
16. Re: Blatt wrapper question
- Posted by Juergen Luethje <j.lue at gmx.de> May 04, 2005
- 438 views
cklester wrote: > Juergen Luethje wrote: >> >> What is eublatt? I searched for "blatt" and "eublatt" in the archieves, >> but didn't get a result. > > Look for "blat." It's an SMTP library for Windows. Ah, I see. In the expression "bla" & repeat('t', n) n must be 1 rather than 2. Thanks, Juergen
17. Re: Blatt wrapper question
- Posted by George Walters <gwalters at sc.rr.com> May 04, 2005
- 434 views
They are text files destined to be printed (5 form types for invoices, and 5 form types for quotations, and purchase orders). Some of them, after being printed need to also be either faxed, or emailed, or both.
18. Re: Blatt wrapper question
- Posted by cklester <cklester at yahoo.com> May 04, 2005
- 442 views
- Last edited May 05, 2005
George Walters wrote: > They are text files destined to be printed (5 form types for invoices, > and 5 form types for quotations, and purchase orders). Some of them, after > being printed need to also be either faxed, or emailed, or both. Just decide on a nice text-only format and create a template for it. That's what I've done for an emailed notice I send to clients. I embed "field codes" and then just insert the appropriate data. For an invoice and quote system, you'd probably want to come up with some fancy stuff to be able to lay out the line items. I wonder if Kanary would be useful here... http://users.telenet.be/tommycarlier/eu/genlib.htm If you want to go "nicely formatted," with "graphics" (logos, etc), non-monospaced fonts, etc., wxWidgets has a wxHTML widget that would let you display the invoice in HTML and print it out that way as well. You could use graphics, logos, etc. That would be very cool. You could also alert the customer that the documents you send are HTML formatted, and give them a clue that they should view and print them with a web browser. -=ck "Programming in a state of EUPHORIA." http://www.cklester.com/euphoria/
19. Re: Blatt wrapper question
- Posted by Mario Steele <eumario at trilake.net> May 05, 2005
- 446 views
Juergen Luethje wrote: > <snip> > > > line = replace(line, "&", "&") > > line = replace(line, "<", "<") > > line = replace(line, ">", ">") > > <snip> How about:
line = replace(line,"&","&amp;") line = replace(line,"&","&lt;") line = replace(line,"&","&gt;")
Mario Steele http://enchantedblade.trilake.net Attaining World Dominiation, one byte at a time...
20. Re: Blatt wrapper question
- Posted by Michael Raley <thinkways at yahoo.com> May 05, 2005
- 441 views
George Walters wrote: > > They are text files destined to be printed (5 form types for invoices, > and 5 form types for quotations, and purchase orders). Some of them, after > being printed need to also be either faxed, or emailed, or both. > Inhouse I build reports using RTF (rich text format) tags. the managers couldn't bother with setting font size, margins, and landscape layout, so I preconfigured them for optimal printing. They file type is associated with Word, so they open in that on reciept. You can't do that with plain HTML. Internally the documents carry tags identifying the author, source, keywords, page header and footer tags, and securty classification that could potentially be tracked by the email system to see if propietary info is being leaked out. you could also embed your graphic objects into the document. you might also look at a text to PDF converter that's in the archives. --"ask about our layaway plan". --
21. Re: Blatt wrapper question
- Posted by "Juergen Luethje" <j.lue at gmx.de> May 10, 2005
- 447 views
Mario Steele wrote: > Juergen Luethje wrote: >> <snip> >> >>> line = replace(line, "&", "&") >>> line = replace(line, "<", "<") >>> line = replace(line, ">", ">") >> >> <snip> > How about: Not exactly. > }}} <eucode> > line = replace(line,"&","&amp;") > line = replace(line,"&","&lt;") Must be "<" here. > line = replace(line,"&","&gt;") Must be ">" here. > </eucode> {{{ > > However, now it looks on EUforum as expected, but not in e-mail. When it's written as plain text (in the EUforum input field or in e-mail), it looks correct in e-mail, but not on EUforum. I think this is a bug in the "text to HTML" functionality of the EUforum software. Regards, Juergen PS: The program http://www.RapidEuphoria.com/uploads/txt2html.zip that I uploaded some says ago converts such expressions correctly to HTML.