]> git.sesse.net Git - webpdf/blob - README
Support FG/BG colors in web pages.
[webpdf] / README
1 Very preliminary documentation; sorry about that. :-)
2
3 You'll need:
4
5   - A web server (I use Apache 2, with mpm-itk[1] to separate the ugliness
6     from the rest of the server installation).
7   - ImageMagick (http://www.imagemagick.org/).
8   - Perl (http://www.perl.org/), with the CGI and HTML::Entities modules.
9   - OpenOffice.org (http://www.openoffice.org/ -- doh), tested with v1.1
10     only. See below for special configuration needed.
11   - GhostScript, probably almost any halfway recent version; newer ones
12     have better font support etc., though. (For some odd PostScript font
13     stuff, you might even need the latest AFPL version from CVS, if you
14     can live with its license.) http://www.ghostscript.com/ has it all.
15   - vim (http://www.vim.org/).
16   - gnome-web-photo, currently only available from GNOME's CVS
17     (http://cvs.gnome.org/viewcvs/gnome-web-photo/, do
18     cvs -d :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome co gnome-web-photo
19     to check out).
20   - You might also want the Microsoft core fonts (or equivalent font set)
21     installed; it seems to make a big difference especially for OpenOffice.org.
22     (http://corefonts.sourceforge.net/)
23
24 [1]: http://home.samfundet.no/~sesse/mpm-itk/
25
26
27 Configuration
28
29 mkdir output/
30 $EDITOR config.pm
31 $EDITOR index.html, so your site doesn't look like mine :-)
32
33
34 Special OpenOffice.org configuration
35
36 First of all, you'll need an X server (since OO.o needs one to do even -help).
37 Xvfb will do nicely:
38
39   nohup Xvfb :25 &
40
41 (Note that gnome-web-photo seems to be a bit picky about the color depth.
42 If you get all black images in your PDFs, add "-screen scrn 800x600x24"
43 to the Xvfb command line and see if it helps.)
44
45 Then, you'll need to log in as the CGI user (yes, yuck :-) ), run
46 OpenOffice.org for the first time, accept the license etc. Then you'll have
47 to add a new printer -- use spadmin (in the same directory as soffice), add
48 a new printer by the name of “pdf” (probably slightly misnamed, as it will
49 output PostScript, but OK). It's going to be a “PDF converter”, using
50
51   /whatever/path/you/have/cat-into "(OUTPUT)"
52
53 as command line, and your output directory as appropriate. Also remember to
54 set the page size if you don't happen to prefer Letter already.
55
56
57 Special vim configuration
58
59 You might want a simple .vimrc for your user as well; mine reads
60
61   set fileencodings=utf-8,iso8859-1
62   syn on
63   set bg=dark
64   
65 (Yes, for some reason bg=dark looks better when printing. Don't ask me why.)
66
67
68 Happy hacking :-)
69
70   -- Steinar H. Gunderson <sgunderson@bigfoot.com>, http://www.sesse.net/
71      (and of course, http://pdf.sesse.net/)