Added a RPM Spec file, and added some bug fixes. Also removed toplevel
Change Log and AUTHORS file.
This commit is contained in:
parent
ddf4a5df21
commit
8570ed47db
@ -1,7 +1,7 @@
|
|||||||
xlHtml ChangeLog
|
xlHtml ChangeLog
|
||||||
|
|
||||||
HEAD
|
HEAD
|
||||||
- Vaclav Dvorak:
|
- Vaclav Dvorak <dvorakv@idas.cz>
|
||||||
* Temporary fix for non-Unicode 8-bit characters in utf-8 output until
|
* Temporary fix for non-Unicode 8-bit characters in utf-8 output until
|
||||||
real charset conversion is in place
|
real charset conversion is in place
|
||||||
* Fixed some typos and formatting
|
* Fixed some typos and formatting
|
||||||
@ -17,6 +17,7 @@ HEAD
|
|||||||
output, or MaxStringsExceeded
|
output, or MaxStringsExceeded
|
||||||
* Enabled compilation warnings, made sure there are none
|
* Enabled compilation warnings, made sure there are none
|
||||||
* More code modularization
|
* More code modularization
|
||||||
|
* Fixed handling of fonts (fixes some segfaults, closes bug 529044)
|
||||||
* Added some Alpha portability fixes.
|
* Added some Alpha portability fixes.
|
||||||
|
|
||||||
0.5 04/13/02
|
0.5 04/13/02
|
||||||
|
106
xlhtml/xlhtml.1
106
xlhtml/xlhtml.1
@ -1,15 +1,33 @@
|
|||||||
.\"Created with GNOME Manpages Editor Wizard
|
.\"Created with GNOME Manpages Editor Wizard
|
||||||
.\"http://gmanedit.sourceforge.net
|
.\"http://gmanedit.sourceforge.net
|
||||||
.\"Sergio Rua <srua@gpul.org>
|
.\"Sergio Rua <srua@gpul.org>
|
||||||
|
.\"Updated by hand of Vaclav Dvorak <dvorakv@idas.cz>
|
||||||
.\"
|
.\"
|
||||||
.TH xlhtml 1 "October 13, 2001" "xlhtml"
|
.TH xlhtml 1 "May 15, 2002" "xlhtml"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
xlhtml \- A program for converting Microsoft Excel Files .xls
|
xlhtml \- A program for converting Microsoft Excel Files .xls
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B xlhtml
|
.B xlhtml
|
||||||
.RI [ -nc ] [ -a ] [ -fw ] [ -bcNNNNNN ] [ -tcNNNNNN ] [ -bi/path ] [ -c ] [ -te ] [ -v ] [ -m ] [ -asc ] [ -dp ] [ -xp:N ] [ -xc:N ] [ -xr:N ] [ -xml ] [ -csv ]
|
.RB [ \-nc ]
|
||||||
|
.RB [ \-a ]
|
||||||
|
.RB [ \-fw ]
|
||||||
|
.RB [ \-bc\fINNNNNN\fP ]
|
||||||
|
.RB [ \-tc\fINNNNNN\fP ]
|
||||||
|
.RB [ \-bi\fI/path\fP ]
|
||||||
|
.RB [ \-c ]
|
||||||
|
.RB [ \-te ]
|
||||||
|
.RB [ \-v ]
|
||||||
|
.RB [ \-m ]
|
||||||
|
.RB [ \-asc ]
|
||||||
|
.RB [ \-dp ]
|
||||||
|
.RB [ \-xp:\fIN\fP ]
|
||||||
|
.RB [ \-xc:\fIN\fP ]
|
||||||
|
.RB [ \-xr:\fIN\fP ]
|
||||||
|
.RB [ \-xml ]
|
||||||
|
.RB [ \-csv ]
|
||||||
|
.RB \fIFILE\fP
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
@ -17,59 +35,93 @@ This manual page explains the
|
|||||||
.B xlhtml
|
.B xlhtml
|
||||||
program. The program
|
program. The program
|
||||||
.B xlhtml
|
.B xlhtml
|
||||||
is used to convert Microsoft Excel Spreadsheet files into either html or tab delimitted ASCII. The program can be interfaced with helper scripts for viewing email attachments. Most use of this program is through the helper scripts and one would probably rarely resort to using the commandline interface.
|
is used to convert Microsoft Excel Spreadsheet files into either html or tab
|
||||||
|
delimitted ASCII. The program can be interfaced with helper scripts for viewing
|
||||||
|
email attachments. Most use of this program is through the helper scripts and
|
||||||
|
one would probably rarely resort to using the commandline interface.
|
||||||
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.B
|
.TP
|
||||||
.IP -nc
|
.BR \-nc
|
||||||
tells it not to colorize the output.
|
tells it not to colorize the output.
|
||||||
.IP -a
|
.TP
|
||||||
aggressively optimize html by removing </TR> </TD> or VALIGN="bottom" Some older browsers may not display properly in this mode.
|
.BR \-a
|
||||||
.IP -fw
|
aggressively optimize html by removing </TR> </TD> or VALIGN="bottom". Some
|
||||||
|
older browsers may not display properly in this mode.
|
||||||
|
.TP
|
||||||
|
.BR \-fw
|
||||||
suppress formula warnings about accuracy
|
suppress formula warnings about accuracy
|
||||||
.IP -bc
|
.TP
|
||||||
|
.BR \-bc
|
||||||
Override the background color. e.g. -bg808080 for gray
|
Override the background color. e.g. -bg808080 for gray
|
||||||
.IP -tc
|
.TP
|
||||||
|
.BR \-tc
|
||||||
Override the text color. e.g. -tcFF0000 for red
|
Override the text color. e.g. -tcFF0000 for red
|
||||||
.IP -bi
|
.TP
|
||||||
|
.BR \-bi
|
||||||
Use background image. e.g. -bi/home/httpd/icon/tar.gif
|
Use background image. e.g. -bi/home/httpd/icon/tar.gif
|
||||||
.IP -c
|
.TP
|
||||||
|
.BR \-c
|
||||||
Centers the tables horizontally
|
Centers the tables horizontally
|
||||||
.IP -te
|
.TP
|
||||||
|
.BR \-te
|
||||||
Trims empty rows & columns at the edges of a worksheet
|
Trims empty rows & columns at the edges of a worksheet
|
||||||
.IP -v
|
.TP
|
||||||
|
.BR \-v
|
||||||
Prints program version
|
Prints program version
|
||||||
.IP -m
|
.TP
|
||||||
|
.BR \-m
|
||||||
No encoding for multibyte
|
No encoding for multibyte
|
||||||
.IP -asc
|
.TP
|
||||||
|
.BR \-asc
|
||||||
Ascii out of -dp and extraction data (-x?)
|
Ascii out of -dp and extraction data (-x?)
|
||||||
.IP -dp
|
.TP
|
||||||
|
.BR \-dp
|
||||||
Dump page count and max columns and rows per page
|
Dump page count and max columns and rows per page
|
||||||
.IP -xp
|
.TP
|
||||||
|
.BR \-xp
|
||||||
Page for extraction (zero based)
|
Page for extraction (zero based)
|
||||||
.IP -xc
|
.TP
|
||||||
|
.BR \-xc
|
||||||
Columns (separated by a dash) for extraction (zero based)
|
Columns (separated by a dash) for extraction (zero based)
|
||||||
.IP -xr
|
.TP
|
||||||
|
.BR \-xr
|
||||||
Rows (separated by a dash) to be extracted (zero based)
|
Rows (separated by a dash) to be extracted (zero based)
|
||||||
.IP -xml
|
.TP
|
||||||
|
.BR \-xml
|
||||||
Output in XML
|
Output in XML
|
||||||
.IP -csv
|
.TP
|
||||||
|
.BR \-csv
|
||||||
Output in Comma Separated Values
|
Output in Comma Separated Values
|
||||||
.IP -nh
|
.TP
|
||||||
|
.BR \-nh
|
||||||
Suppress header and body tags in html output
|
Suppress header and body tags in html output
|
||||||
|
.PP
|
||||||
An example of the extraction command line is:
|
An example of the extraction command line is:
|
||||||
xlhtml -fw -asc -xp:0 -xr:2-6 -xc:0-1 Test.xls
|
xlhtml -fw -asc -xp:0 -xr:2-6 -xc:0-1 Test.xls
|
||||||
|
|
||||||
The extraction output is:
|
The extraction output is:
|
||||||
Formatted output of cells by column left to right, columns separated by a tab, end of row is: 0x0A, end of file: \n\n
|
Formatted output of cells by column left to right, columns separated by a tab,
|
||||||
|
end of row is: 0x0A, end of file: \\n\\n
|
||||||
|
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
To interface to Netscape Navigator: first locate the help scripts nsxlview & nsopen. Go into the Edit Preferences dialog box. Click on the Navigator Category and hilight the Applications menu item. Look for Microsoft Excel Worksheet. If you don't see it create one. The MIME type should be: application/vnd.ms-excel The suffixes should be: xls,xlt,xlm,xld,xla,xlc,xlw,xll In the handled by section of the dialog box, check the Application checkbox and set the path to wherever the nsxlview helper script is located and pass a %s argument. For example, if nsxlview is located in /usr/local/bin, then you would put:
|
To interface to Netscape Navigator: first locate the help scripts nsxlview &
|
||||||
|
nsopen. Go into the Edit Preferences dialog box. Click on the Navigator
|
||||||
|
Category and hilight the Applications menu item. Look for Microsoft Excel
|
||||||
|
Worksheet. If you don't see it create one. The MIME type should be:
|
||||||
|
application/vnd.ms-excel, the suffixes should be:
|
||||||
|
xls,xlt,xlm,xld,xla,xlc,xlw,xll. In the handled by section of the dialog box,
|
||||||
|
check the Application checkbox and set the path to wherever the nsxlview helper
|
||||||
|
script is located and pass a %s argument. For example, if nsxlview is located
|
||||||
|
in /usr/local/bin, then you would put:
|
||||||
|
|
||||||
/usr/local/bin/nsxlview %s
|
/usr/local/bin/nsxlview %s
|
||||||
|
|
||||||
in the Application path box.. (As a side note, make sure the nsxlview script can find the xlhtml program or it won't work.) Click on the OK and you are done. You should be able to use the Test.xls file that is distributed with the program to verify its configured correctly.
|
in the Application path box. (As a side note, make sure the nsxlview script can
|
||||||
|
find the xlhtml program or it won't work.) Click on the OK and you are done.
|
||||||
|
You should be able to use the Test.xls file that is distributed with the
|
||||||
|
program to verify its configured correctly.
|
||||||
|
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
|
Steve Grubb,
|
||||||
Charles N Wyble
|
Charles N Wyble
|
||||||
|
130
xlhtml/xlhtml.c
130
xlhtml/xlhtml.c
@ -1145,82 +1145,72 @@ void main_line_processor(U16 opcode, U16 version, U32 count, U16 last, U8 data)
|
|||||||
break;
|
break;
|
||||||
case 0x31: /* Font */
|
case 0x31: /* Font */
|
||||||
working_buffer[bufidx++] = data;
|
working_buffer[bufidx++] = data;
|
||||||
if (bufidx > 14) /* Address 14 has length in unicode chars */
|
if ((file_version == EXCEL95) && (bufidx == last) && (last >= 15))
|
||||||
{
|
{ /* Microsoft doesn't stick to their documentation. Excel 97 is supposed
|
||||||
if ((file_version == EXCEL95)&&(bufidx == last))
|
to be 0x0231...but it's not. Have to use file_version to separate them. */
|
||||||
{ /* Microsoft doesn't stick to their documentation. Excel 97 is supposed
|
unsigned int i;
|
||||||
to be 0x0231...but it's not. Have to use file_version to separate them. */
|
U16 size, attr, c_idx, b, su;
|
||||||
unsigned int i;
|
U8 u;
|
||||||
U16 size, attr, c_idx, b, su;
|
|
||||||
U8 u;
|
|
||||||
|
|
||||||
size = getShort(&working_buffer[0]);
|
size = getShort(&working_buffer[0]);
|
||||||
attr = getShort(&working_buffer[2]);
|
attr = getShort(&working_buffer[2]);
|
||||||
c_idx = getShort(&working_buffer[4]);
|
c_idx = getShort(&working_buffer[4]);
|
||||||
b = getShort(&working_buffer[6]);
|
b = getShort(&working_buffer[6]);
|
||||||
su = getShort(&working_buffer[8]);
|
su = getShort(&working_buffer[8]);
|
||||||
u = working_buffer[10];
|
u = working_buffer[10];
|
||||||
buflast = working_buffer[14];
|
buflast = working_buffer[14];
|
||||||
for (i=0; i<buflast; i++)
|
for (i=0; i<buflast; i++)
|
||||||
working_buffer[i] = working_buffer[i+15];
|
working_buffer[i] = working_buffer[i+15];
|
||||||
|
|
||||||
working_buffer[buflast] = 0;
|
working_buffer[buflast] = 0;
|
||||||
/* printf("S:%04X A:%04X C:%04X B:%04X SU:%04X U:%02X\n",
|
/* printf("S:%04X A:%04X C:%04X B:%04X SU:%04X U:%02X\n",
|
||||||
size, attr,c_idx,b,su,u);
|
size, attr,c_idx,b,su,u);
|
||||||
printf("f:%s\n", working_buffer); */
|
printf("f:%s\n", working_buffer); */
|
||||||
add_font(size, attr, c_idx, b, su, u, 0, &working_buffer[0], 0);
|
add_font(size, attr, c_idx, b, su, u, 0, working_buffer, buflast);
|
||||||
|
}
|
||||||
|
else if ((file_version == EXCEL97) && (bufidx == last) && (last >= 16))
|
||||||
|
{ /* Microsoft doesn't stick to their documentation. Excel 97 is supposed
|
||||||
|
to be 0x0231...but it's not. Have to use file_version to separate them. */
|
||||||
|
unsigned int i;
|
||||||
|
U16 len;
|
||||||
|
U16 size, attr, c_idx, b, su;
|
||||||
|
U8 u, uni;
|
||||||
|
|
||||||
|
size = getShort(&working_buffer[0]);
|
||||||
|
attr = getShort(&working_buffer[2]);
|
||||||
|
c_idx = getShort(&working_buffer[4]);
|
||||||
|
b = getShort(&working_buffer[6]);
|
||||||
|
su = getShort(&working_buffer[8]);
|
||||||
|
u = working_buffer[10];
|
||||||
|
buflast = working_buffer[14];
|
||||||
|
|
||||||
|
if (working_buffer[15] & 0x01)
|
||||||
|
{
|
||||||
|
uni = 2;
|
||||||
|
len = 2 * (U16)buflast;
|
||||||
|
for (i=0; i<len; i++)
|
||||||
|
working_buffer[i] = working_buffer[i+16];
|
||||||
}
|
}
|
||||||
else if ((file_version == EXCEL97)&&(bufidx == last))
|
else
|
||||||
{ /* Microsoft doesn't stick to their documentation. Excel 97 is supposed
|
{
|
||||||
to be 0x0231...but it's not. Have to use file_version to separate them. */
|
uni = 0;
|
||||||
unsigned int i;
|
len = (U16)buflast;
|
||||||
U16 len;
|
for (i=0; i<len; i++)
|
||||||
U16 size, attr, c_idx, b, su;
|
|
||||||
U8 u, uni=0;
|
|
||||||
|
|
||||||
size = getShort(&working_buffer[0]);
|
|
||||||
attr = getShort(&working_buffer[2]);
|
|
||||||
c_idx = getShort(&working_buffer[4]);
|
|
||||||
b = getShort(&working_buffer[6]);
|
|
||||||
su = getShort(&working_buffer[8]);
|
|
||||||
u = working_buffer[10];
|
|
||||||
buflast = working_buffer[14];
|
|
||||||
|
|
||||||
for (i=0; i<(buflast-2); i++)
|
|
||||||
{ /* This looks at the 2nd byte to see if it's unicode... */
|
|
||||||
if (working_buffer[(i<<1)+17] != 0)
|
|
||||||
uni = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uni == 2)
|
|
||||||
len = (U16)(buflast<<1);
|
|
||||||
else
|
|
||||||
len = (U16)buflast;
|
|
||||||
|
|
||||||
if (uni == 0)
|
|
||||||
{
|
{
|
||||||
for (i=0; i<len; i++)
|
working_buffer[i] = working_buffer[i+16];
|
||||||
{
|
if (working_buffer[i] >= 0x80U)
|
||||||
working_buffer[i] = working_buffer[(i<<1)+16];
|
uni = 1;
|
||||||
if ((working_buffer[i] > 0x0080U) && (uni == 0))
|
|
||||||
uni = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
for (i=0; i<len; i++)
|
|
||||||
working_buffer[i] = working_buffer[i+16];
|
|
||||||
}
|
|
||||||
|
|
||||||
working_buffer[len] = 0;
|
|
||||||
|
|
||||||
/* printf("S:%04X A:%04X C:%04X B:%04X SU:%04X U:%02X\n",
|
|
||||||
size, attr,c_idx,b,su,u);
|
|
||||||
printf("BL:%d L:%d Uni:%d\n", buflast, len, uni);
|
|
||||||
printf("%X %X %X %X\n", working_buffer[15], working_buffer[16], working_buffer[17], working_buffer[18]);
|
|
||||||
printf("f:%s\n", working_buffer); */
|
|
||||||
add_font(size, attr, c_idx, b, su, u, uni, &working_buffer[0], len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
working_buffer[len] = 0;
|
||||||
|
|
||||||
|
/* printf("S:%04X A:%04X C:%04X B:%04X SU:%04X U:%02X\n",
|
||||||
|
size, attr,c_idx,b,su,u);
|
||||||
|
printf("BL:%d L:%d Uni:%d\n", buflast, len, uni);
|
||||||
|
printf("%X %X %X %X\n", working_buffer[15], working_buffer[16], working_buffer[17], working_buffer[18]);
|
||||||
|
printf("f:%s\n", working_buffer); */
|
||||||
|
add_font(size, attr, c_idx, b, su, u, uni, &working_buffer[0], len);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x14: /* Header */
|
case 0x14: /* Header */
|
||||||
|
Loading…
Reference in New Issue
Block a user