Re: FO to RTF, request for a systematic approach
On Mon, 2002-07-29 at 17:52, Bertrand Delacretaz wrote: I'd go for 2.2 as this avoids having to maintain two RTF document libraries (jfor and FOP) during the transition. I think that's what Chris Scott is working on, but I haven't seen his code or design yet, hence my request to him for an early release. That sounds like a good idea. Release early and release often as they say. Hope this helps clarify things. -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: FO to RTF
On Friday 26 July 2002 20:05, J.U. Anderegg wrote: . . . RTF is the format of yesterday: better generate MicroSoft Office XML or Open Office XML. Depends on what you're aiming for. RTF is a terrible format, yes, but at least it allows documents to be opened by a fair number of wordprocessors. -Bertrand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: FO to RTF (new jfor license)
Hello, On Friday 26 July 2002 10:20, Mulet, Jordi wrote: . . . We have started to experiment with jfor (FO-RTF) and we don't know the best path to follow and if there are plans to integrate jfor in FOP as a RTF renderer. . . . Note that the jfor license was recently changed to allow it to an ASF-compatible one, see www.jfor.org for more info. This allows jfor to be distributed with ASF projects. This means that the RTF library part of jfor can be used in binary form as a back-end for FOP (StructureHandler) to generate RTF, without having to maintain two RTF libraries (which would be the case if the jfor RTF code was moved to the FOP codebase). I think this will ease the transition from jfor to FOP for RTF generation, until FOP 1.x is released. -- Bertrand Delacrétaz (codeconsult.ch, jfor.org) buzzwords: XML, java, XSLT, cocoon, mentoring/teaching/coding. disclaimer: eternity is very long. mostly towards the end. get ready. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: FO to RTF
RTF is the format of yesterday: better generate MicroSoft Office XML or Open Office XML. I agree. I very much dislike RTF as a markup language. It is cumbersome, limited, verbose, awkward and terribly outdated. But RTF is a widely used standard, whose format is recognized by many lagacy programs. So the trend towards XSL:FO becomes much easier if it can be converted to be displayed to whichever format is most convenient. For many users that is RTF. In the future when/if Microsoft XML becomes standard we can focus on that target. ~Chris Scott P.S. I can't even work with Microsoft XML yet, we are still using office 97 and it works just fine. Is there a compelling reason to upgrade? Is microsoft XML an open standard? - Original Message - From: J.U. Anderegg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 26, 2002 2:05 PM Subject: AW: FO to RTF Document formats can be layered very roughly like this: 1. Structured documents: marked up, tagged CONTENT - document elements like heading, index entry and even customer address in a specific application: - presentation, pagination controlled by style sheets/macros, perhaps depending on output device/target - examples: HTML, Word with templates 2. Document formats controlling pagination - examples: WordPad, XSL:FO 3. Device dependent, paginated output streams - examples: PCL, PostScript An other view is: revisable vs. final formats RTF at layer 1) and 2): a text generator outputs RTF. A transform from XML data can be implemented with XSLT. A conversion from XSL:FO might be realized at layer 2), but probably fail because of incompatible concepts/details. RTF is the format of yesterday: better generate MicroSoft Office XML or Open Office XML. ___ PDF Java Viewer: who can do much better than Adobe? If no Acrobat Reader is available, output PostScript and use GhostView instead of AWT. Hansuli Anderegg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: FO to RTF
i'm also looking for it. i'm a student working on this RTF converter. do you know anything about OLE? i want to try embedding a bmp image into RTF to see if it works, but i've found there's something more than that. what i mean is there seems to be some more hex data apart from the proper bmp data. and i've spent the whole day looking for the documentation in microsoft.com but still can't find the OLE documentation. and the \par is also a problem. sometimes \par can't be applied to the end of some blocks, otherwise there'll be extra linefeeds, and i really don't know how to make the program very general. marco Jean-François Selber wrote: Do you know a way to transforme XSL-FO to RTF? Thanks JF - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: FO to RTF
Here is a hack that I did to openjade.1.3 (http://openjade.sourceforge.net/) I don't know if it will help or not. bool RtfFOTBuilder::includePicture(const ExternalGraphicNIC nic) { StringC filename; char fileNbuf[30]; char fileCbuf[35]; char scalex[35]; char scaley[35]; char picw[35]; char pich[35]; char picwgoal[35]; char pichgoal[35]; char x, y, *ptr; int buf; int ii = 1; FILE *inFile; FILE *inCFile; size_t i; if (systemIdFilename(nic.entitySystemId, filename)) { if(getenv(JADE_EMBED) != (char *)0) { for (i = 0; i filename.size(); i++) { fileNbuf[i] = filename[i]; } fileNbuf[i] = 0; if((ptr = strrchr(fileNbuf, '.')) == NULL){ printf(ERROR: graphic file %s those not have extension\n, fileNbuf); exit(1); } ptr++; if(strcmp(ptr, jpg) == 0) { os() \r\n{\\pict\\jpegblip\r\n; } else if (strcmp(ptr, gif) == 0) { os() \r\n{\\pict\\pngblip\r\n; } else if (strcmp(ptr, wmf) == 0) { os() \r\n{\\pict\\wmetafile8; } else { printf(ERROR:graphic file %s has a NONsupported extension\n, fileNbuf); exit(1); } strcpy(fileCbuf, C.); strcat(fileCbuf, fileNbuf); if((inCFile = fopen((const char *)fileCbuf[0], r)) != NULL){ // fscanf(inCFile, %s %s %s %s %s %s, scalex, scaley, picw, pich, picwgoal, pichgoal); fscanf(inCFile, %s %s, scalex, scaley); os() \\picscalex; os() scalex; os() \\picscaley; os() scaley; // os() \\picw; // os() picw; // os() \\pich; // os() pich; // os() \\picwgoal; // os() picwgoal; // os() \\pichgoal; // os() pichgoal; os() \r\n; fclose(inCFile); } if((inFile = fopen((const char *)fileNbuf[0], r)) == NULL){ printf(ERROR:opening graphic file %s errno=%i\n, fileNbuf, errno); exit(1); } while((buf = fgetc(inFile)) != EOF){ x = (buf 0xF0) 4; y = (buf 0x0F); x = ((x 10) ? (x + 48) : (x + 87)); os() x; y = ((y 10) ? (y + 48) : (y + 87)); os() y; if(!(ii++ % 78)){os() \r\n;} } fclose(inFile); os() \r\n}; } else { os() {\\field\\flddirty{\\*\\fldinst INCLUDEPICTURE \; // FIXME non-ascii characters for (i = 0; i filename.size(); i++) { if (filename[i] == '\\') os() ; else os() char(filename[i]); } os() \ }{\\fldrslt }}; } return 1; } return 0; } The part you may be interested in is: while((buf = fgetc(inFile)) != EOF){ x = (buf 0xF0) 4; y = (buf 0x0F); x = ((x 10) ? (x + 48) : (x + 87)); os() x; y = ((y 10) ? (y + 48) : (y + 87)); os() y; if(!(ii++ % 78)){os() \r\n;} } you have to convert the binary image to 7bit Steven Oney [EMAIL PROTECTED] -Original Message- From: Kin-Yip Tsang [mailto:[EMAIL PROTECTED]] Sent: Monday, July 30, 2001 9:22 AM To: [EMAIL PROTECTED] Subject: Re: FO to RTF i'm also looking for it. i'm a student working on this RTF converter. do you know anything about OLE? i want to try embedding a bmp image into RTF to see if it works, but i've found there's something more than that. what i mean is there seems to be some more hex data apart from the proper bmp data. and i've spent the whole day looking for the documentation in microsoft.com but still can't find the OLE documentation. and the \par is also a problem. sometimes \par can't be applied to the end of some blocks, otherwise there'll be extra linefeeds, and i really don't know how to make the program very general. marco Jean-François Selber wrote: Do you know a way to transforme XSL-FO to RTF? Thanks JF - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
Re: FO to RTF
hi steve, it looks quite helpful, but how to do it in Java? i'm doing it in Java marco Steve Oney wrote: Here is a hack that I did to openjade.1.3 (http://openjade.sourceforge.net/) I don't know if it will help or not. bool RtfFOTBuilder::includePicture(const ExternalGraphicNIC nic) { StringC filename; char fileNbuf[30]; char fileCbuf[35]; char scalex[35]; char scaley[35]; char picw[35]; char pich[35]; char picwgoal[35]; char pichgoal[35]; char x, y, *ptr; int buf; int ii = 1; FILE *inFile; FILE *inCFile; size_t i; if (systemIdFilename(nic.entitySystemId, filename)) { if(getenv(JADE_EMBED) != (char *)0) { for (i = 0; i filename.size(); i++) { fileNbuf[i] = filename[i]; } fileNbuf[i] = 0; if((ptr = strrchr(fileNbuf, '.')) == NULL){ printf(ERROR: graphic file %s those not have extension\n, fileNbuf); exit(1); } ptr++; if(strcmp(ptr, jpg) == 0) { os() \r\n{\\pict\\jpegblip\r\n; } else if (strcmp(ptr, gif) == 0) { os() \r\n{\\pict\\pngblip\r\n; } else if (strcmp(ptr, wmf) == 0) { os() \r\n{\\pict\\wmetafile8; } else { printf(ERROR:graphic file %s has a NONsupported extension\n, fileNbuf); exit(1); } strcpy(fileCbuf, C.); strcat(fileCbuf, fileNbuf); if((inCFile = fopen((const char *)fileCbuf[0], r)) != NULL){ // fscanf(inCFile, %s %s %s %s %s %s, scalex, scaley, picw, pich, picwgoal, pichgoal); fscanf(inCFile, %s %s, scalex, scaley); os() \\picscalex; os() scalex; os() \\picscaley; os() scaley; // os() \\picw; // os() picw; // os() \\pich; // os() pich; // os() \\picwgoal; // os() picwgoal; // os() \\pichgoal; // os() pichgoal; os() \r\n; fclose(inCFile); } if((inFile = fopen((const char *)fileNbuf[0], r)) == NULL){ printf(ERROR:opening graphic file %s errno=%i\n, fileNbuf, errno); exit(1); } while((buf = fgetc(inFile)) != EOF){ x = (buf 0xF0) 4; y = (buf 0x0F); x = ((x 10) ? (x + 48) : (x + 87)); os() x; y = ((y 10) ? (y + 48) : (y + 87)); os() y; if(!(ii++ % 78)){os() \r\n;} } fclose(inFile); os() \r\n}; } else { os() {\\field\\flddirty{\\*\\fldinst INCLUDEPICTURE \; // FIXME non-ascii characters for (i = 0; i filename.size(); i++) { if (filename[i] == '\\') os() ; else os() char(filename[i]); } os() \ }{\\fldrslt }}; } return 1; } return 0; } The part you may be interested in is: while((buf = fgetc(inFile)) != EOF){ x = (buf 0xF0) 4; y = (buf 0x0F); x = ((x 10) ? (x + 48) : (x + 87)); os() x; y = ((y 10) ? (y + 48) : (y + 87)); os() y; if(!(ii++ % 78)){os() \r\n;} } you have to convert the binary image to 7bit Steven Oney [EMAIL PROTECTED] -Original Message- From: Kin-Yip Tsang [mailto:[EMAIL PROTECTED]] Sent: Monday, July 30, 2001 9:22 AM To: [EMAIL PROTECTED] Subject: Re: FO to RTF i'm also looking for it. i'm a student working on this RTF converter. do you know anything about OLE? i want to try embedding a bmp image into RTF to see if it works, but i've found there's something more than that. what i mean is there seems to be some more hex data apart from the proper bmp data. and i've spent the whole day looking for the documentation in microsoft.com but still can't find the OLE documentation. and the \par is also a problem. sometimes \par can't be applied to the end of some blocks, otherwise there'll be extra linefeeds, and i really don't know how to make the program very general. marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]