rtf is a very popular file structure, many text editors support it, vb and other development tools and even provides richtxtbox control. Programmers write general-purpose tools, the software should be considered in their own reading and writing rtf files to add functionality, so that the structure of rtf need to fully understand.
directory
structural analysis and its application to discuss special algorithm for structural analysis difficult problem of image representation RTF version About the benefits of the characteristics of the standard document rtf RTF format, what software to open the expansion of the structure Analysis and Its Applications Qiu Liming Wang Jian is a very popular rtf file structure, many text editors support it, vb and other development tools and even provides richtxtbox control. Programmers write general-purpose tools, the software should be considered in their own reading and writing rtf files to add features, so that the structure of rtf need to fully understand. And now the most important means of information dissemination than the www, and in the editing software to provide rtf to html conversion is something that should be considered a programmer. Although the word already has this feature, but not on that of your customers said: The following will discuss the structure of rtf file structure analysis and its application discussed. A,
air force 1 high, rtf rtf file structure of the structure is not complicated, but the content range, this is impossible to explain, can only discuss in general (if you want to read a detailed rtf document, you can find on the internet or contact with the author .) each rtf file is a text file that is displayed by the reader rtf format. Beginning of the file is {tf, mark it as a rtf file is essential,
nike air force 1 high, rtf reader to determine under which a file is a rtf format. Then the header and body, including the font header table file table, color table, and several other data structures, text fonts, forms the style is based on header information to formatted. Each table with a pair of brackets, which contain a lot of the characters For example, a color table is as follows: {colortbl; ed0green0? Lue0; ed0green0? Lue255; ed0green255? Lue255; ed0green255? Lue0; ed255green0? Lue255; ed255green0? Lue0; ed255green255? Lue0; ed255green255? Lue255; ed0green0? Lue128; ed0green128? Lue128 ; ed0green128? lue0; ed128green0? lue128; ed128green0? lue0; ed128green128? lue0; ed128green128? lue128; ed192green192? lue192;} special marked the beginning of great use colortbl color table in brackets, followed by ed0green0? lue0, registered a colors, red, green and blue components of this color are to 0. Other tables and so on. Header followed by the text, the text formatting commands from the layout, text, and various special commands. Special order only with braces, and layout and text formatting command is End of file when there is a Throughout the document, This format is rtf viewer and converter algorithm based. rtf format, there is a special feature is that some characters in the command has a special meaning, so when they need to appear as text in front of them plus a In fact, this form in most programming languages is very common. Algorithm analysis algorithms described in this section for rtf to read and write, though, but it is also common to the general method of file filters for file conversion between various formats. Specifically, the various documents are converted into an intermediate format and then displayed or converted according to requirements. There is a principle which must be followed: Program must be able to filter out the format did not know. A variety of file has its own unique format, the conversion process appears inevitable phenomenon of loss of form, in the algorithm to consider this situation. Rtf text file format for these, the most important thing is to properly display or convert the file size, colors, fonts and other styles. Therefore, in the program should be a data structure to save this information, this structure is called the intermediate format, and how the provisions as you wish. The following is the flow chart: difficulty of representation in the development process, we encountered many problems, there are two particularly interesting questions. The first problem is the Chinese representation. Rtf in the Chinese language in the form of the command, said: Characters within the code is machine code. However, please note: rtf is a text file, the code is used to store ascii code, and must convert it to digital to use. For example, the . rtf exist in the picture in two ways: The first way is embedded directly to {pict start; The second way is as embedded ole object, then the {object start. When rtf ole when the processor can be used directly, rtf file data to provide a ole; otherwise, the document image data directly to {esult start. The most commonly used image format that includes meta-dib bitmap file (metafile), this format is not described in the sdk, but in compressed form is stored in rtf,
nike air force one, so there are certain difficulties in the conversion. We have taken a relatively new approach: first meta file read out the data stored as a file, and then use getmetafile and playmetafile function to print the graphics file in a memory dc, and last, keep it to capture method into a bitmap file. The following are specific procedures: void wmftobmp (int width, int height, char * metafile) {/ / width to image width, height for the image height, * metafile file name for the element static hmetafile hmf; char num [4]; file * fh ; hdc hmemdc; hbitmap hbmp, hold; bitmapfileheader hdr; lpbitmapinfoheader lpbmpih; hglobal hg; bitmapcount + +; if (bitmapcount == 3) {width = 128; height = 132;} if (bitmapcount == 1) {width = 80; height = 50;} tostring10 (bitmapcount, num); / / convert string into a number of functions lstrcpy (bmpfile, filepath); lstrcat (bmpfile, num); lstrcpy (giffile, bmpfile); lstrcat (bmpfile, ;); lstrcat (giffile, sizeof (bitmapinfoheader)); lpbmpih = (lpbitmapinfoheader) globallock (hg); lpbmpih-> bisize = sizeof (bitmapinfoheader); lpbmpih-> biwidth = width; lpbmpih-> biheight = height; lpbmpih-> biplanes = 1 ; lpbmpih-> bibitcount = 8; lpbmpih-> bicompression = 0; hbmp = createcompatiblebitmap (hdisplaydc, width, height); globalunlock (hg); globalfree (hg); hold = selectobject (hmemdc, hbmp); setmapmode (hmemdc , mm_anisotropic); setwindoworgex (hmemdc, 0,0, null); setviewportextex (hmemdc, width, height,
nike air force one high, null); playmetafile (hmemdc,
air force one shoes, hmf); hbmp = selectobject (hmemdc, hold); if ((fh = fopen (bmpfile , bfreserved1 = 0; hdr.bfreserved2 = 0; hdr.bfoffbits = sizeof (bitmapfileheader) + sizeof (bitmapinfoheader) +256 * sizeof (rgbquad); fwrite ((lpstr) & hdr, sizeof (bitmapfileheader), 1, fh); hg = globalalloc (ghnd, sizeof (bitmapinfoheader) +256 * sizeof (rgbquad)); lpbmpih = (lpbitmapinfoheader) globallock (hg); lpbmpih-> bisize = sizeof (bitmapinfoheader); lpbmpih-> biwidth = width; lpbmpih- > biheight = height; lpbmpih-> biplanes = 1; lpbmpih-> bibitcount = 8; lpbmpih-> bicompression = 0; lpbmpih-> bisizeimage = width * height; lpbmpih-> biclrused = 256; lpbmpih- > biclrimportant = 0; j = getdibits (hmemdc, hbmp, 0, height, null, (bitmapinfo *) lpbmpih, dib_rgb_colors); lpbmpih-> bisize = sizeof (bitmapinfoheader); fwrite (lpbmpih, sizeof (bitmapinfoheader) +256 * sizeof (rgbquad), 1, fh); getdibits (hmemdc, hbmp, 0, height, (lpstr) filebuffer, (bitmapinfo *) lpbmpih, dib_rgb_cols); fwrite (filebuffer, width * height, 1, fh); globalunlock ( hg); globalfree (hg); fclose (fh); deletedc (hmemdc); deletedc (hdisplaydc); deleteobject (hbmp); deleteobject (hold); deletemetafile (hmf);} / / end function wmftobmp () the benefits of using this method has another advantage, that is, when you started to develop from the bottom rtf reader, just to playmetafile dc parameters from the memory dc into the screen to display pictures. Introduction description of the contents in plain text can be saved in various formats of information, you can use to write version, Word, etc. created. Also known as rich text format (Rich Text Format, generally referred to as RTF) is a cross-platform developed by Microsoft document format. Most word processors can read and save the RTF document. RTF version of the standard file as a Microsoft standard documents require tens of dollars outside the early payment to the company, to buy a thin standard RTF files. However, with the RTF format using standard software more and more, RTF format is also more common, Microsoft put the standard file open, on the Internet for developers to download. Now available for download the standard version of each file as RTF: RTF 1.9.1 specification (March 2008) RTF 1.8 specification (April 2004) RTF 1.6 specification (May 1999) RTF 1.5 specification (April 1997) RTF 1.3 and 1.5 specifications RTF 1.0 specification (June 1992) RTF format is a lot of software can recognize the file format. Such as Word, WPS Office, Excel and so can open the RTF file formats, indicating that this format is more common. Rich Text Format RTF is an abbreviation, which means more text. This is a similar DOC format (Word document) file, a very good compatibility, use the Windows Using the This means you can edit the HTML file as the same, use the RTF features for normal users, RTF format is a good file format conversion tool for different applications in the formatted text documents between the transmission. Universal compatibility should be the greatest advantage of RTF, but also has its disadvantages, such as the file is usually relatively large (perhaps because a variety of applications compatible embedded control symbol bar), WORD and other software-specific format may not be normal preservation. rtf format, rtf format to discuss the expansion of the last expansion. rtf format as a standard should be uniform, but in some cases the extension is necessary. The most obvious example is Microsoft's word, it has its own unique rtf command. If you want to make their software an advantage in technology, you can also create new rtf command. For example, if you want the software to support dhtml, you can embed in rtf or {java {dhtml sort of order. Rtf reader as a filter does not know the function of command, so this will not affect the generality of rtf files. What software to open RTF format is a lot of software can recognize the file format. Such as Word, WPS Office, Excel and so can open the RTF file formats, indicating that this format is more common. Rich Text Format RTF is an abbreviation, which means more text. This is a similar DOC format (Word document) file,
air force one low nike, a very good compatibility, use the Windows Using the This means you can edit the HTML file as the same, use the For ordinary users, RTF format is a good file format conversion tool for formatting between different applications to send text documents. Universal compatibility should be the maximum bit RTF, but also has its disadvantages, such as the file is usually relatively large (perhaps because a variety of applications compatible embedded control symbol bar), WORD and other software-specific format may not be normal preservation. More Atlas Atlas entry Open Category: rtf, rtf file