Initial revision
This commit is contained in:
15
ppthtml/ChangeLog
Normal file
15
ppthtml/ChangeLog
Normal file
@@ -0,0 +1,15 @@
|
||||
ppthtml ChangeLog
|
||||
|
||||
0.3 10/19/2001
|
||||
* Renamed the program to ppthtml...all lowercase
|
||||
|
||||
0.2.8 01/14/2000
|
||||
* Added man page
|
||||
* Added Unicode patch from Hironori
|
||||
* Many Bug Fixes
|
||||
|
||||
0.0.0 10/13/1999
|
||||
*So far its just a dream. :)
|
||||
|
||||
|
||||
|
14
ppthtml/Makefile.am
Normal file
14
ppthtml/Makefile.am
Normal file
@@ -0,0 +1,14 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
EXTRA_DIST = README ChangeLog TODO THANKS test.ppt ppthtml.1
|
||||
|
||||
INCLUDES = -I../cole
|
||||
|
||||
noinst_PROGRAMS = pptdump
|
||||
man_MANS = ppthtml.1
|
||||
bin_SCRIPTS = nspptview
|
||||
bin_PROGRAMS = ppthtml
|
||||
LDADD = ../cole/libcole.a
|
||||
ppthtml_SOURCES = ppthtml.c
|
||||
AM_CFLAGS = -Wall -Wshadow -Wcast-align -Wpointer-arith
|
||||
|
381
ppthtml/Makefile.in
Normal file
381
ppthtml/Makefile.in
Normal file
@@ -0,0 +1,381 @@
|
||||
# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
CC = @CC@
|
||||
COLE_MAJOR = @COLE_MAJOR@
|
||||
COLE_MICRO = @COLE_MICRO@
|
||||
COLE_MINOR = @COLE_MINOR@
|
||||
HOST_ALIAS_NAME = @HOST_ALIAS_NAME@
|
||||
HOST_CANONICAL_NAME = @HOST_CANONICAL_NAME@
|
||||
HOST_CPU = @HOST_CPU@
|
||||
HOST_OS = @HOST_OS@
|
||||
HOST_VENDOR = @HOST_VENDOR@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
|
||||
EXTRA_DIST = README ChangeLog TODO THANKS test.ppt ppthtml.1
|
||||
|
||||
INCLUDES = -I../cole
|
||||
|
||||
noinst_PROGRAMS = pptdump
|
||||
man_MANS = ppthtml.1
|
||||
bin_SCRIPTS = nspptview
|
||||
bin_PROGRAMS = ppthtml
|
||||
LDADD = ../cole/libcole.a
|
||||
ppthtml_SOURCES = ppthtml.c
|
||||
AM_CFLAGS = -Wall -Wshadow -Wcast-align -Wpointer-arith
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I..
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
ppthtml_OBJECTS = ppthtml.o
|
||||
ppthtml_LDADD = $(LDADD)
|
||||
ppthtml_DEPENDENCIES = ../cole/libcole.a
|
||||
ppthtml_LDFLAGS =
|
||||
pptdump_SOURCES = pptdump.c
|
||||
pptdump_OBJECTS = pptdump.o
|
||||
pptdump_LDADD = $(LDADD)
|
||||
pptdump_DEPENDENCIES = ../cole/libcole.a
|
||||
pptdump_LDFLAGS =
|
||||
SCRIPTS = $(bin_SCRIPTS)
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
man1dir = $(mandir)/man1
|
||||
MANS = $(man_MANS)
|
||||
|
||||
NROFF = nroff
|
||||
DIST_COMMON = README ChangeLog Makefile.am Makefile.in THANKS
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
SOURCES = $(ppthtml_SOURCES) pptdump.c
|
||||
OBJECTS = $(ppthtml_OBJECTS) pptdump.o
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .o .s
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps ppthtml/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
mostlyclean-binPROGRAMS:
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
|
||||
distclean-binPROGRAMS:
|
||||
|
||||
maintainer-clean-binPROGRAMS:
|
||||
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
|
||||
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
done
|
||||
|
||||
mostlyclean-noinstPROGRAMS:
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
|
||||
|
||||
distclean-noinstPROGRAMS:
|
||||
|
||||
maintainer-clean-noinstPROGRAMS:
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
|
||||
ppthtml: $(ppthtml_OBJECTS) $(ppthtml_DEPENDENCIES)
|
||||
@rm -f ppthtml
|
||||
$(LINK) $(ppthtml_LDFLAGS) $(ppthtml_OBJECTS) $(ppthtml_LDADD) $(LIBS)
|
||||
|
||||
pptdump: $(pptdump_OBJECTS) $(pptdump_DEPENDENCIES)
|
||||
@rm -f pptdump
|
||||
$(LINK) $(pptdump_LDFLAGS) $(pptdump_OBJECTS) $(pptdump_LDADD) $(LIBS)
|
||||
|
||||
install-binSCRIPTS: $(bin_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_SCRIPTS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
else if test -f $(srcdir)/$$p; then \
|
||||
echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
else :; fi; fi; \
|
||||
done
|
||||
|
||||
uninstall-binSCRIPTS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(bin_SCRIPTS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
done
|
||||
|
||||
install-man1:
|
||||
$(mkinstalldirs) $(DESTDIR)$(man1dir)
|
||||
@list='$(man1_MANS)'; \
|
||||
l2='$(man_MANS)'; for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
|
||||
uninstall-man1:
|
||||
@list='$(man1_MANS)'; \
|
||||
l2='$(man_MANS)'; for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
rm -f $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
install-man: $(MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-man1
|
||||
uninstall-man:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) uninstall-man1
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = ppthtml
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am: install-binPROGRAMS install-binSCRIPTS
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am: install-man
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-man
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir) \
|
||||
$(DESTDIR)$(mandir)/man1
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
|
||||
mostlyclean-compile mostlyclean-tags \
|
||||
mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile \
|
||||
clean-tags clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-binPROGRAMS distclean-noinstPROGRAMS \
|
||||
distclean-compile distclean-tags distclean-generic \
|
||||
clean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-binPROGRAMS \
|
||||
maintainer-clean-noinstPROGRAMS \
|
||||
maintainer-clean-compile maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
|
||||
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
|
||||
mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
|
||||
clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile uninstall-binSCRIPTS install-binSCRIPTS \
|
||||
install-man1 uninstall-man1 install-man uninstall-man tags \
|
||||
mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
|
||||
distdir info-am info dvi-am dvi check check-am installcheck-am \
|
||||
installcheck install-exec-am install-exec install-data-am install-data \
|
||||
install-am install uninstall-am uninstall all-redirect all-am all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
69
ppthtml/README
Normal file
69
ppthtml/README
Normal file
@@ -0,0 +1,69 @@
|
||||
Welcome to ppthtml.
|
||||
|
||||
|
||||
I. INTRODUCTION
|
||||
The ppthtml program will take a PowerPoint 97/95 file as input and convert
|
||||
it to html. The output is via standard out so it can be re-directed
|
||||
to files or piped to filters or used as a gateway to the internet.
|
||||
|
||||
II. INSTALLATION
|
||||
To build this application, from the top directory, type:
|
||||
|
||||
./configure --prefix=/<target installation directory e.g. /usr/local or /opt>
|
||||
make
|
||||
make install
|
||||
|
||||
Then to finish it up, you will need to go into netscape and tell the navigator
|
||||
to use the nspptview script to handle Microsoft Excel files.
|
||||
|
||||
e.g. <path to executable>/nspptview %s
|
||||
|
||||
You should be able to then browse to a file and open it. There is a file
|
||||
included in the ppthtml directory you can test with, test.ppt.
|
||||
|
||||
The shell script nspptview works well. You may need to modify the
|
||||
path in it to fit you system, though. Also, depending on where you install
|
||||
it, you may have to modify your PATH environmental variable.
|
||||
|
||||
|
||||
III. UNINSTALLING
|
||||
You may want to keep the tar directory around since you can do a make uninstall
|
||||
later. In the meantime, I suggest doing a make clean after installation to
|
||||
get the size down.
|
||||
|
||||
|
||||
IV. COMMANDLINE OPTIONS
|
||||
ppthtml now has several command line options that let you tailor its output. The
|
||||
command is now: ppthtml [] file.ppt
|
||||
|
||||
|
||||
V. PERFORMANCE TUNING
|
||||
There are also some user "tunable" parameters in the beginning of the
|
||||
ppthtml.c file. If you get a red message at the bottom of your web browser after
|
||||
converting a big presentation, these are the parameters to adjust. Generally, you
|
||||
would adjust them up in value. I have them adjusted to what I call normal for
|
||||
my usage. Your usage may differ. Don't increase them greatly...just 10-15% and
|
||||
re-compile. If that don't work, increase another 10-15% until it works.
|
||||
|
||||
|
||||
VI. TROUBLESHOOTING
|
||||
Using Netscape, you may occassionally see a file not found error. This usually
|
||||
comes when printing or going back to a previously converted file. This is
|
||||
the default behavior and it can be changed by commenting out the rm $tmp*
|
||||
in nspptview. I do this so you don't have files hanging around in your tmp
|
||||
directory where other people might be able to see them.
|
||||
|
||||
In general, if you can type ppthtml and get a usage error message, the PATH
|
||||
is working. If you don't, your PATH environmental variable needs adjusting.
|
||||
Next try passing the full path to ppthtml of the file you want converted. If it
|
||||
has problems with it, you may have a file the system can't interpret. To check
|
||||
your installation, try passing the full path of ppthtml/threads.ppt and see what
|
||||
it does with that.
|
||||
|
||||
|
||||
|
||||
|
||||
Charles N Wyble
|
||||
jackshck@yahoo.com
|
||||
|
||||
|
4
ppthtml/THANKS
Normal file
4
ppthtml/THANKS
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
Arturo Tena for the cole 2.0 library
|
||||
Caolan McNamara for MSWordView...where I got the nsopen & nsxlview scripts
|
||||
Hironori Sakamoto for the unicode patch
|
BIN
ppthtml/Test.ppt
Normal file
BIN
ppthtml/Test.ppt
Normal file
Binary file not shown.
29
ppthtml/nspptview
Executable file
29
ppthtml/nspptview
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/csh
|
||||
|
||||
if ($#argv != 1) then
|
||||
echo "Usage: $0 file.doc"
|
||||
exit 1
|
||||
endif
|
||||
|
||||
set source = $argv[1]
|
||||
|
||||
#Generate a unique html filename (/tmp/scriptname.pidnum.html)
|
||||
#set com = $0
|
||||
#set tmp = /tmp/$com:t.$$
|
||||
#set html = $tmp.html
|
||||
|
||||
set tmp = `mktemp -q /tmp/nspptview.XXXXXX` || exit 1
|
||||
set tmp2 = `mktemp -q $tmp/nspptview.XXXXXX` || exit 1
|
||||
set html = $tmp2.html
|
||||
|
||||
ppthtml $source > $html
|
||||
if ((!(-r $html)) | ($status)) then
|
||||
echo "$0"": failed to generate HTML file"
|
||||
exit 1
|
||||
endif
|
||||
|
||||
#File exists and is of length > 0, so open it
|
||||
nsopen $html
|
||||
rm -rf $tmp*
|
||||
|
||||
exit 0
|
515
ppthtml/pptdump.c
Normal file
515
ppthtml/pptdump.c
Normal file
@@ -0,0 +1,515 @@
|
||||
/*
|
||||
pptdump - dumps individual records for analysis
|
||||
Copyright 2002 Charles N Wyble <jackshck@yahoo.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#if !(defined( __BORLANDC__ ) || defined( __WIN32__ ))
|
||||
#include "config.h" /* Created by ./configure script */
|
||||
#include "support.h" /* Needs to be before internal.h */
|
||||
#include "internal.h" /* Needs to be before cole */
|
||||
#include "cole.h"
|
||||
#else
|
||||
#include "config.h.in" /* Created by ./configure script */
|
||||
#include "support.h" /* Needs to be before internal.h */
|
||||
#include "internal.h" /* Needs to be before cole */
|
||||
#include "cole.h.in"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h> /* for strcpy() */
|
||||
#include <ctype.h> /* For isprint */
|
||||
|
||||
|
||||
#define MODE 1
|
||||
|
||||
#define PRGNAME "pptdump"
|
||||
#define MAX_COLS 64
|
||||
#define MAX_ROWS 512
|
||||
|
||||
static char FileName[2][32] = /* The section of the PowerPoint File we read */
|
||||
{
|
||||
"/PowerPoint Document", /* Power Point 97 & 2000 */
|
||||
"/PP40" /* Everything else ? */
|
||||
};
|
||||
|
||||
/* Function Prototypes */
|
||||
COLE_LOCATE_ACTION_FUNC dump_file;
|
||||
static void output_type_string(int);
|
||||
|
||||
/* Global data */
|
||||
static char filename[128];
|
||||
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
int f_ptr = 0;
|
||||
COLEFS * cfs;
|
||||
COLERRNO colerrno;
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
fprintf (stderr, "pptdump - Outputs PowerPoint file records for analysis.\n"
|
||||
"Usage: "PRGNAME" <FILE>\n");
|
||||
exit (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(filename, argv[1], 124);
|
||||
cfs = cole_mount (filename, &colerrno);
|
||||
if (cfs == NULL)
|
||||
{
|
||||
cole_perror (PRGNAME, colerrno);
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
while (cole_locate_filename (cfs, FileName[f_ptr], NULL, dump_file, &colerrno))
|
||||
{
|
||||
if (f_ptr)
|
||||
{
|
||||
cole_perror (PRGNAME, colerrno);
|
||||
if (colerrno == COLE_EFILENOTFOUND)
|
||||
fprintf(stderr, "Section: PowerPoint Document\n");
|
||||
break;
|
||||
}
|
||||
else /* Don't do this... */
|
||||
f_ptr++;
|
||||
}
|
||||
|
||||
if (cole_umount (cfs, &colerrno))
|
||||
{
|
||||
cole_perror ("travel", colerrno);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void dump_file(COLEDIRENT *cde, void *_info)
|
||||
{
|
||||
unsigned long cversion=0, cinstance=0, ctype=0, clength=0, ctarget=0, ccount = 0;
|
||||
unsigned char buf[16];
|
||||
COLEFILE *cf;
|
||||
COLERRNO err;
|
||||
|
||||
cf = cole_fopen_direntry(cde, &err);
|
||||
|
||||
/* Ouput Header */
|
||||
printf("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">\n");
|
||||
printf("<HTML><HEAD><TITLE>%s", filename);
|
||||
printf("</TITLE></HEAD><BODY>\n");
|
||||
|
||||
/* Output body */
|
||||
#if (MODE == 1)
|
||||
while (cole_fread(cf, buf, 8, &err)) /* For mode >= 1 */
|
||||
#else
|
||||
while (cole_fread(cf, buf, 1, &err))
|
||||
#endif
|
||||
{
|
||||
if (MODE == 0)
|
||||
{
|
||||
if (ccount == 0)
|
||||
{
|
||||
cinstance = buf[0];
|
||||
ctype = 0;
|
||||
clength = 0;
|
||||
ctarget = 80; /* ficticious number */
|
||||
printf("\n<br>\n");
|
||||
}
|
||||
else if (ccount == 1)
|
||||
{
|
||||
cinstance |= (buf[0]<<8);
|
||||
cversion = cinstance &0x000F;
|
||||
cinstance = (cinstance>>4);
|
||||
}
|
||||
else if (ccount == 2)
|
||||
ctype = (unsigned)buf[0];
|
||||
else if (ccount == 3)
|
||||
ctype |= (buf[0]<<8)&0x00000FFFL;
|
||||
else if (ccount == 4)
|
||||
clength = (unsigned)buf[0];
|
||||
else if (ccount == 5)
|
||||
clength |= (buf[0]<<8);
|
||||
else if (ccount == 6)
|
||||
clength |= (buf[0]<<16);
|
||||
else if (ccount == 7)
|
||||
{
|
||||
clength |= (buf[0]<<24);
|
||||
ctarget = clength;
|
||||
if (cversion == 0x0F)
|
||||
{
|
||||
printf("Container");
|
||||
ccount = -1;
|
||||
}
|
||||
else
|
||||
printf("Atom");
|
||||
printf(" - Version:%02X Instance:%02X, Type:%03X, Length:%08X - ",
|
||||
(int)cversion, (int)cinstance, (int)ctype, (int)clength);
|
||||
output_type_string(ctype);
|
||||
puts("<br>\n");
|
||||
}
|
||||
if (ccount > 7)
|
||||
{ /* Here is where we want to process the data */
|
||||
/* based on the opcode... */
|
||||
/* process_atom(buf[0]); */
|
||||
if (isprint(buf[0]))
|
||||
putc(buf[0], stdout);
|
||||
}
|
||||
if (ccount == (ctarget+7))
|
||||
ccount = 0;
|
||||
else
|
||||
ccount++;
|
||||
}
|
||||
else /* mode >= 1 */
|
||||
{
|
||||
printf("%02x %02x %02x %02x %02x %02x %02x %02x ",
|
||||
(unsigned)buf[0], (unsigned)buf[1], (unsigned)buf[2], (unsigned)buf[3],
|
||||
(unsigned)buf[4], (unsigned)buf[5], (unsigned)buf[6], (unsigned)buf[7]);
|
||||
putchar(buf[0]); putchar(buf[1]);
|
||||
putchar(buf[2]); putchar(buf[3]);
|
||||
putchar(buf[4]); putchar(buf[5]);
|
||||
putchar(buf[6]); putchar(buf[7]);
|
||||
printf("<br>");
|
||||
}
|
||||
}
|
||||
|
||||
/* Output Tail */
|
||||
printf("</BODY></HTML>\n");
|
||||
cole_fclose(cf, &err);
|
||||
}
|
||||
|
||||
static void output_type_string(int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case 0x0001:
|
||||
puts("SubContainerCompleted");
|
||||
break;
|
||||
case 0x0002:
|
||||
puts("IRRAtom");
|
||||
break;
|
||||
case 0x0003:
|
||||
puts("PSS");
|
||||
break;
|
||||
case 0x0004:
|
||||
puts("SubContainerException");
|
||||
break;
|
||||
case 0x0006:
|
||||
puts("ClientSignal1");
|
||||
break;
|
||||
case 0x0007:
|
||||
puts("ClientSignal2");
|
||||
break;
|
||||
case 0x000A:
|
||||
puts("PowerPointStateAtom");
|
||||
break;
|
||||
case 0x03E8:
|
||||
puts("Document");
|
||||
break;
|
||||
case 0x03E9:
|
||||
puts("Document Atom");
|
||||
break;
|
||||
case 0x03EA:
|
||||
puts("End Document");
|
||||
break;
|
||||
case 0x03EB:
|
||||
puts("Slide Persist");
|
||||
break;
|
||||
case 0x03EC:
|
||||
puts("SlideBase");
|
||||
break;
|
||||
case 0x03ED:
|
||||
puts("SlideBase Atom");
|
||||
break;
|
||||
case 0x03EE:
|
||||
puts("Slide");
|
||||
break;
|
||||
case 0x03EF:
|
||||
puts("Slide Atom");
|
||||
break;
|
||||
case 0x03F0:
|
||||
puts("Notes");
|
||||
break;
|
||||
case 0x03F1:
|
||||
puts("Notes Atom");
|
||||
break;
|
||||
case 0x03F2:
|
||||
puts("Environment");
|
||||
break;
|
||||
case 0x03F3:
|
||||
puts("SlidePersistAtom");
|
||||
break;
|
||||
case 0x03F4:
|
||||
puts("Scheme");
|
||||
break;
|
||||
case 0x03F5:
|
||||
puts("Scheme Atom");
|
||||
break;
|
||||
case 0x03F6:
|
||||
puts("DocViewInfo");
|
||||
break;
|
||||
case 0x03F7:
|
||||
puts("SlideLayout Atom");
|
||||
break;
|
||||
case 0x03F8:
|
||||
puts("MainMaster");
|
||||
break;
|
||||
case 0x03F9:
|
||||
puts("SlideInfo Atom");
|
||||
break;
|
||||
case 0x03FA:
|
||||
puts("SlideViewInfo");
|
||||
break;
|
||||
case 0x03FB:
|
||||
puts("Guide Atom");
|
||||
break;
|
||||
case 0x03FC:
|
||||
puts("ViewInfo");
|
||||
break;
|
||||
case 0x03FD:
|
||||
puts("ViewInfo Atom");
|
||||
break;
|
||||
case 0x03FE:
|
||||
puts("SlideViewInfo Atom");
|
||||
break;
|
||||
case 0x03FF:
|
||||
puts("VBAInfo");
|
||||
break;
|
||||
case 0x0400:
|
||||
puts("VBAInfo Atom");
|
||||
break;
|
||||
case 0x0401:
|
||||
puts("SSDocInfo Atom");
|
||||
break;
|
||||
case 0x0402:
|
||||
puts("Summary");
|
||||
break;
|
||||
case 0x0403:
|
||||
puts("Texture");
|
||||
break;
|
||||
case 0x0404:
|
||||
puts("VBASlideInfo");
|
||||
break;
|
||||
case 0x0405:
|
||||
puts("VBASlideInfo Atom");
|
||||
break;
|
||||
case 0x0406:
|
||||
puts("DocRoutingSlip");
|
||||
break;
|
||||
case 0x0407:
|
||||
puts("OutlineViewInfo");
|
||||
break;
|
||||
case 0x0408:
|
||||
puts("SorterViewInfo");
|
||||
break;
|
||||
case 0x0409:
|
||||
puts("ExObjList");
|
||||
break;
|
||||
case 0x040A:
|
||||
puts("ExObjList Atom");
|
||||
break;
|
||||
case 0x040B:
|
||||
puts("PPDrawingGroup");
|
||||
break;
|
||||
case 0x040C:
|
||||
puts("PPDrawing");
|
||||
break;
|
||||
case 0x0410:
|
||||
puts("NamedShows - Several");
|
||||
break;
|
||||
case 0x0411:
|
||||
puts("NamedShow - One");
|
||||
break;
|
||||
case 0x0412:
|
||||
puts("NamedShowSlides");
|
||||
break;
|
||||
case 0x07D0:
|
||||
puts("List");
|
||||
break;
|
||||
case 0x07D5:
|
||||
puts("Font Collection");
|
||||
break;
|
||||
case 0x07E1:
|
||||
puts("ListPlaceHolder");
|
||||
break;
|
||||
case 0x07E3:
|
||||
puts("BookMarkCollection");
|
||||
break;
|
||||
case 0x07E4:
|
||||
puts("SoundCollection");
|
||||
break;
|
||||
case 0x07E5:
|
||||
puts("SoundColl Atom");
|
||||
break;
|
||||
case 0x07E6:
|
||||
puts("Sound");
|
||||
break;
|
||||
case 0x07E7:
|
||||
puts("SoundData");
|
||||
break;
|
||||
case 0x07E9:
|
||||
puts("BookMarkSeed Atom");
|
||||
break;
|
||||
case 0x07EA:
|
||||
puts("GuideList");
|
||||
break;
|
||||
case 0x07EB:
|
||||
puts("RunArray");
|
||||
break;
|
||||
case 0x07EC:
|
||||
puts("RunArray Atom");
|
||||
break;
|
||||
case 0x07ED:
|
||||
puts("ArrayElement Atom");
|
||||
break;
|
||||
case 0x07EE:
|
||||
puts("Int4Array Atom");
|
||||
break;
|
||||
case 0x07EF:
|
||||
puts("ColorScheme Atom");
|
||||
break;
|
||||
case 0x07F0:
|
||||
puts("ColorSchemeAtom");
|
||||
break;
|
||||
case 0x0BC0:
|
||||
puts("OEShape");
|
||||
break;
|
||||
case 0x0BC1:
|
||||
puts("ExObjRef Atom");
|
||||
break;
|
||||
case 0x0BC3:
|
||||
puts("OEPlaceholder Atom");
|
||||
break;
|
||||
case 0x0BCC:
|
||||
puts("GrColor");
|
||||
break;
|
||||
case 0x0BD1:
|
||||
puts("Grect Atom");
|
||||
break;
|
||||
case 0x0BD7:
|
||||
puts("GRatio Atom");
|
||||
break;
|
||||
case 0x0BD8:
|
||||
puts("GScaling");
|
||||
break;
|
||||
case 0x0BDA:
|
||||
puts("GPoint Atom");
|
||||
break;
|
||||
case 0x0BDB:
|
||||
puts("OEShape Atom");
|
||||
break;
|
||||
case 0x0F9E:
|
||||
puts("OutlineTextRef Atom");
|
||||
break;
|
||||
case 0x0F9F:
|
||||
puts("TextHeader Atom");
|
||||
break;
|
||||
case 0x0FA0:
|
||||
puts("TextChars Atom");
|
||||
break;
|
||||
case 0x0FA1:
|
||||
puts("StyleTextProp Atom");
|
||||
break;
|
||||
case 0x0FA2:
|
||||
puts("BaseTextProp Atom");
|
||||
break;
|
||||
case 0x0FA3:
|
||||
puts("TxMasterStyle Atom");
|
||||
break;
|
||||
case 0x0FA4:
|
||||
puts("TxCFStyle Atom");
|
||||
break;
|
||||
case 0x0FA5:
|
||||
puts("TxPFStyle Atom");
|
||||
break;
|
||||
case 0x0FA6:
|
||||
puts("TextRuler Atom");
|
||||
break;
|
||||
case 0x0FA7:
|
||||
puts("TextBookMark Atom");
|
||||
break;
|
||||
case 0x0FA8:
|
||||
puts("TextBytes Atom");
|
||||
break;
|
||||
case 0x0FA9:
|
||||
puts("TxSiStyle Atom");
|
||||
break;
|
||||
case 0x0FAA:
|
||||
puts("TextSpecInfo");
|
||||
break;
|
||||
case 0x0FAB:
|
||||
puts("DefaultRuler Atom");
|
||||
break;
|
||||
case 0x0FB7:
|
||||
puts("FontEntity Atom");
|
||||
break;
|
||||
case 0x0FB8:
|
||||
puts("FontEmbedData");
|
||||
break;
|
||||
case 0x0FB9:
|
||||
puts("TypeFace");
|
||||
break;
|
||||
case 0x0FBA:
|
||||
puts("CString");
|
||||
break;
|
||||
case 0x0FBB:
|
||||
puts("ExternalObject");
|
||||
break;
|
||||
case 0x0FC1:
|
||||
puts("MetaFile");
|
||||
break;
|
||||
case 0x0FC2:
|
||||
puts("ExOleObj");
|
||||
break;
|
||||
case 0x0FC3:
|
||||
puts("ExOleObj Atom");
|
||||
break;
|
||||
case 0x0FE9:
|
||||
puts("ExQuickTime");
|
||||
break;
|
||||
case 0x0FD9:
|
||||
puts("HeadersFooters");
|
||||
break;
|
||||
case 0x0FDA:
|
||||
puts("HeadersFooters Atom");
|
||||
break;
|
||||
case 0x0FF0:
|
||||
puts("SlideListWithText");
|
||||
break;
|
||||
case 0x0FF1:
|
||||
puts("AnimationInfoAtom");
|
||||
break;
|
||||
case 0x0FF2:
|
||||
puts("InteractiveInfo");
|
||||
break;
|
||||
case 0x0FF5:
|
||||
puts("UserEditAtom");
|
||||
break;
|
||||
case 0x0FF6:
|
||||
puts("CurrentUserAtom");
|
||||
break;
|
||||
case 0x0FF7:
|
||||
puts("DateTimeMCAtom ");
|
||||
break;
|
||||
default:
|
||||
puts("Unknown Type");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
26
ppthtml/ppthtml.1
Normal file
26
ppthtml/ppthtml.1
Normal file
@@ -0,0 +1,26 @@
|
||||
.TH ppthtml 1 "October 13, 2001" "ppthtml"
|
||||
|
||||
.SH NAME
|
||||
ppthtml \- A program for converting Microsoft Power Point Files .ppt
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B ppthtml
|
||||
.RI Filename
|
||||
.br
|
||||
|
||||
.SH DESCRIPTION
|
||||
This manual page explains the
|
||||
.B ppthtml
|
||||
program. The program
|
||||
.B ppthtml
|
||||
is used to convert Microsoft Power Point 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 NOTES
|
||||
To interface to Netscape Navigator: first locate the help scripts nspptview & 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-powerpoint The suffixes should be: ppt,ppa,pps,pot,pwz In the handled by section of the dialog box, check the Application checkbox and set the path to wherever the nspptview helper script is located and pass a %s argument. For example, if nspptview is located in /usr/local/bin, then you would put:
|
||||
|
||||
/usr/local/bin/nspptview %s
|
||||
|
||||
in the Application path box.. (As a side note, make sure the nspptview script can find the ppthtml program or it won't work.) Click on the OK and you are done. You should be able to use the Test.ppt file that is distributed with the program to verify its configured correctly.
|
||||
|
||||
.SH AUTHOR
|
||||
Charles N Wyble
|
429
ppthtml/ppthtml.c
Normal file
429
ppthtml/ppthtml.c
Normal file
@@ -0,0 +1,429 @@
|
||||
/*
|
||||
pptHtml - Format a PowerPoint Presentation into Html
|
||||
Copyright 2002 Charles N Wyble <jackshck@yahoo.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#if !(defined( __BORLANDC__ ) || defined( __WIN32__ ))
|
||||
#include "config.h" /* Created by ./configure script */
|
||||
#include "support.h" /* Needs to be before internal.h */
|
||||
#include "internal.h" /* Needs to be before cole */
|
||||
#include "cole.h"
|
||||
#else
|
||||
#include "config.h.in" /* Created by ./configure script */
|
||||
#include "support.h" /* Needs to be before internal.h */
|
||||
#include "internal.h" /* Needs to be before cole */
|
||||
#include "cole.h.in"
|
||||
#include <dir.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h> /* for strcpy() */
|
||||
#include <ctype.h> /* For isprint */
|
||||
#include <stdlib.h> /* For exitt() */
|
||||
|
||||
|
||||
#define PRGNAME "pptHtml"
|
||||
#if !(defined( __WIN32__ ) || defined( __BORLANDC__ ))
|
||||
#define PRGVER VERSION
|
||||
#else
|
||||
#define PRGVER "0.4"
|
||||
#endif
|
||||
#define WORK_SIZE 8192
|
||||
static char FileName[2][32] = /* The section of the PowerPoint File we read */
|
||||
{
|
||||
"/PowerPoint Document", /* Power Point 97 & 2000 */
|
||||
"/PP40" /* Everything else ? */
|
||||
};
|
||||
|
||||
|
||||
/* Function Prototypes */
|
||||
COLE_LOCATE_ACTION_FUNC dump_file;
|
||||
static void container_processor(int);
|
||||
static void atom_processor(int, int, int, unsigned char);
|
||||
static void print_unicode(unsigned char *, int);
|
||||
static void print_utf8(unsigned short c);
|
||||
static void put_utf8(unsigned short c);
|
||||
|
||||
/* Global data */
|
||||
static char filename[128];
|
||||
static unsigned char working_buffer[WORK_SIZE];
|
||||
static int buf_idx=0;
|
||||
static int output_this_container = 0;
|
||||
static int past_first_slide = 0;
|
||||
static int last_container = 0;
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
int f_ptr = 0;
|
||||
COLEFS * cfs;
|
||||
COLERRNO colerrno;
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
fprintf (stderr, "pptHtml - Outputs Power Point files as Html.\n"
|
||||
"Usage: "PRGNAME" <FILE>\n");
|
||||
exit (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(filename, argv[1], 124);
|
||||
#if defined( __WIN32__ ) || defined( __BORLANDC__ )
|
||||
{
|
||||
char *ptr = strchr(filename, ':');
|
||||
if (ptr)
|
||||
{
|
||||
int len;
|
||||
char new_drive[MAXPATH];
|
||||
fnsplit(filename, new_drive, 0, 0, 0);
|
||||
if (new_drive[0] >= 'a')
|
||||
setdisk(new_drive[0] - 'a');
|
||||
else
|
||||
setdisk(new_drive[0] - 'A');
|
||||
ptr++; /* Get past the colon */
|
||||
len = strlen(ptr);
|
||||
memmove(filename, ptr, len);
|
||||
filename[len] = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
cfs = cole_mount (filename, &colerrno);
|
||||
if (cfs == NULL)
|
||||
{
|
||||
cole_perror (PRGNAME, colerrno);
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
while (cole_locate_filename (cfs, FileName[f_ptr], NULL, dump_file, &colerrno))
|
||||
{
|
||||
if (f_ptr)
|
||||
{ /* Two strikes...we're out! */
|
||||
cole_perror (PRGNAME, colerrno);
|
||||
if (colerrno == COLE_EFILENOTFOUND)
|
||||
fprintf(stderr, "Section: PowerPoint Document\n");
|
||||
break;
|
||||
}
|
||||
else /* Don't do this... */
|
||||
f_ptr++;
|
||||
}
|
||||
|
||||
if (cole_umount (cfs, &colerrno))
|
||||
{
|
||||
cole_perror ("travel", colerrno);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void dump_file(COLEDIRENT *cde, void *_info)
|
||||
{
|
||||
unsigned long version=0, instance=0, type=0, length=0, target=0, count=0;
|
||||
unsigned char buf[16];
|
||||
COLEFILE *cf;
|
||||
COLERRNO err;
|
||||
|
||||
cf = cole_fopen_direntry(cde, &err);
|
||||
|
||||
/* Ouput Header */
|
||||
printf("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">\n");
|
||||
printf("<HTML><HEAD><TITLE>%s", filename);
|
||||
printf("</TITLE></HEAD><BODY>\n");
|
||||
|
||||
/* Output body */
|
||||
while (cole_fread(cf, buf, 1, &err))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
instance = buf[0];
|
||||
type = 0;
|
||||
length = 0;
|
||||
target = 80; /* ficticious number */
|
||||
}
|
||||
else if (count == 1)
|
||||
{
|
||||
instance |= (buf[0]<<8);
|
||||
version = instance &0x000F;
|
||||
instance = (instance>>4);
|
||||
}
|
||||
else if (count == 2)
|
||||
type = (unsigned)buf[0];
|
||||
else if (count == 3)
|
||||
type |= (buf[0]<<8)&0x00000FFFL;
|
||||
else if (count == 4)
|
||||
length = (unsigned)buf[0];
|
||||
else if (count == 5)
|
||||
length |= (buf[0]<<8);
|
||||
else if (count == 6)
|
||||
length |= (buf[0]<<16);
|
||||
else if (count == 7)
|
||||
{
|
||||
length |= (buf[0]<<24);
|
||||
target = length;
|
||||
if (version == 0x0F)
|
||||
{ /* Do container level Processing */
|
||||
container_processor(type);
|
||||
count = -1;
|
||||
}
|
||||
}
|
||||
if (count > 7)
|
||||
{ /* Here is where we want to process the data
|
||||
based on the Atom type... */
|
||||
atom_processor(type, count-8, target-1, buf[0]);
|
||||
}
|
||||
if (count == (target+7))
|
||||
count = 0;
|
||||
else
|
||||
count++;
|
||||
}
|
||||
|
||||
if (past_first_slide)
|
||||
printf("<HR>");
|
||||
|
||||
printf(" <br>\n");
|
||||
|
||||
/* Output Credit */
|
||||
printf("<hr><FONT SIZE=-1>Created with <a href=\"http://chicago.sf.net/xlhtml\">pptHtml %s</a></FONT><br>\n", PRGVER);
|
||||
|
||||
/* Output Tail */
|
||||
printf("</BODY></HTML>\n");
|
||||
cole_fclose(cf, &err);
|
||||
}
|
||||
|
||||
static void container_processor(int type)
|
||||
{
|
||||
if (type == 0x03EE)
|
||||
{
|
||||
if (past_first_slide)
|
||||
printf("<BR><HR><BR>\n");
|
||||
else
|
||||
past_first_slide = 1;
|
||||
}
|
||||
switch (type)
|
||||
{
|
||||
case 0x000D:
|
||||
if (last_container == 0x11) /* suppress notes info */
|
||||
output_this_container = 0;
|
||||
else
|
||||
output_this_container = 1;
|
||||
break;
|
||||
case 0x0FF0:
|
||||
output_this_container = 1;
|
||||
break;
|
||||
default:
|
||||
/* printf("Cont:%x|\n", type); */
|
||||
output_this_container = 0;
|
||||
break;
|
||||
}
|
||||
last_container = type;
|
||||
}
|
||||
|
||||
static void atom_processor(int type, int count, int buf_last, unsigned char data)
|
||||
{
|
||||
if ((buf_idx >= WORK_SIZE)||(output_this_container == 0))
|
||||
return;
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
memset(working_buffer, 0, WORK_SIZE);
|
||||
buf_idx = 0;
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case 0x0FA0: /* Text String in unicode */
|
||||
working_buffer[buf_idx++] = data;
|
||||
if (count == buf_last)
|
||||
{
|
||||
/* printf("Atom:%x|\n", type); */
|
||||
/* working_buffer[buf_idx++] = 0; */
|
||||
/* printf("%s<BR>\n", working_buffer); */
|
||||
print_unicode(working_buffer, buf_idx);
|
||||
printf("<BR>\n");
|
||||
}
|
||||
break;
|
||||
case 0x0FA8: /* Text String in ASCII */
|
||||
working_buffer[buf_idx++] = data;
|
||||
if (count == buf_last)
|
||||
{
|
||||
int i;
|
||||
/* working_buffer[buf_idx++] = 0; */
|
||||
/* printf("Atom:%x|\n", type); */
|
||||
for (i=0;i<buf_idx; i++)
|
||||
{
|
||||
/* printf("%02X ", (int)working_buffer[i]); */ /* Debug */
|
||||
if (working_buffer[i] == 0x0D)
|
||||
printf("<BR>\n");
|
||||
else
|
||||
putchar(working_buffer[i]);
|
||||
}
|
||||
printf("<BR>\n");
|
||||
}
|
||||
break;
|
||||
case 0x0FBA: /* CString - unicode... */
|
||||
working_buffer[buf_idx++] = data;
|
||||
if (count == buf_last)
|
||||
{
|
||||
/* working_buffer[buf_idx++] = 0; */
|
||||
/* printf("%s<BR>\n", working_buffer); */
|
||||
/* printf("Atom:%x|\n", type); */
|
||||
print_unicode(working_buffer, buf_idx);
|
||||
printf("<BR>\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void print_unicode(unsigned char *ucs, int len)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < len; i += 2)
|
||||
print_utf8(ucs[i] | (ucs[i+1] << 8));
|
||||
}
|
||||
|
||||
static void OutputCharCorrected(unsigned char c)
|
||||
{
|
||||
switch (c)
|
||||
{ /* Special char handlers here... */
|
||||
case '\r':
|
||||
printf("<BR>\n");
|
||||
break;
|
||||
case 0x3C:
|
||||
printf("<");
|
||||
break;
|
||||
case 0x3E:
|
||||
printf(">");
|
||||
break;
|
||||
case 0x26:
|
||||
printf("&");
|
||||
break;
|
||||
case 0x22:
|
||||
printf(""");
|
||||
break;
|
||||
/* Also need to cover 128-159 since MS uses this area... */
|
||||
case 0x80: /* Euro Symbol */
|
||||
printf("€");
|
||||
break;
|
||||
case 0x82: /* baseline single quote */
|
||||
printf("‚");
|
||||
break;
|
||||
case 0x83: /* florin */
|
||||
printf("ƒ");
|
||||
break;
|
||||
case 0x84: /* baseline double quote */
|
||||
printf("„");
|
||||
break;
|
||||
case 0x85: /* ellipsis */
|
||||
printf("…");
|
||||
break;
|
||||
case 0x86: /* dagger */
|
||||
printf("†");
|
||||
break;
|
||||
case 0x87: /* double dagger */
|
||||
printf("‡");
|
||||
break;
|
||||
case 0x88: /* circumflex accent */
|
||||
printf("ˆ");
|
||||
break;
|
||||
case 0x89: /* permile */
|
||||
printf("‰");
|
||||
break;
|
||||
case 0x8A: /* S Hacek */
|
||||
printf("Š");
|
||||
break;
|
||||
case 0x8B: /* left single guillemet */
|
||||
printf("‹");
|
||||
break;
|
||||
case 0x8C: /* OE ligature */
|
||||
printf("Œ");
|
||||
break;
|
||||
case 0x8E: /* #LATIN CAPITAL LETTER Z WITH CARON */
|
||||
printf("Ž");
|
||||
break;
|
||||
case 0x91: /* left single quote ? */
|
||||
printf("‘");
|
||||
break;
|
||||
case 0x92: /* right single quote ? */
|
||||
printf("’");
|
||||
break;
|
||||
case 0x93: /* left double quote */
|
||||
printf("“");
|
||||
break;
|
||||
case 0x94: /* right double quote */
|
||||
printf("”");
|
||||
break;
|
||||
case 0x95: /* bullet */
|
||||
printf("•");
|
||||
break;
|
||||
case 0x96: /* endash */
|
||||
printf("–");
|
||||
break;
|
||||
case 0x97: /* emdash */
|
||||
printf("—");
|
||||
break;
|
||||
case 0x98: /* tilde accent */
|
||||
printf("˜");
|
||||
break;
|
||||
case 0x99: /* trademark ligature */
|
||||
printf("™");
|
||||
break;
|
||||
case 0x9A: /* s Haceks Hacek */
|
||||
printf("š");
|
||||
break;
|
||||
case 0x9B: /* right single guillemet */
|
||||
printf("›");
|
||||
break;
|
||||
case 0x9C: /* oe ligature */
|
||||
printf("œ");
|
||||
break;
|
||||
case 0x9F: /* Y Dieresis */
|
||||
printf("Ÿ");
|
||||
break;
|
||||
default:
|
||||
putchar(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void print_utf8(unsigned short c)
|
||||
{
|
||||
if (c == 0)
|
||||
return;
|
||||
|
||||
if (c < 0x80)
|
||||
OutputCharCorrected(c);
|
||||
else if (c < 0x800)
|
||||
{
|
||||
putchar(0xC0 | (c >> 6));
|
||||
put_utf8(c);
|
||||
}
|
||||
else
|
||||
{
|
||||
putchar(0xE0 | (c >> 12));
|
||||
put_utf8(c >> 6);
|
||||
put_utf8(c);
|
||||
}
|
||||
}
|
||||
|
||||
static void put_utf8(unsigned short c)
|
||||
{
|
||||
putchar(0x0080 | ((short)c & 0x003F));
|
||||
}
|
||||
|
Reference in New Issue
Block a user