views:

1208

answers:

6

I have a small C++ project (~60 classes) that I need a human readable PDF of. I tried using doxygen but the LaTeX code it generates does not compile because it's too deeply nested for the LaTeX compiler.

Before I start creating a PDF or HTML document myself using the XML sources doxygen generates, I wanted to know if anyone of you knows a tool I could use?

+1  A: 

Synopsis is a tool similar to Doxygen, and it seems to be capable of PDF generation. I write "it seems" because, despite my interest, I never find the time to try it out.

Éric Malenfant
A: 

The output's not great, but you could try enscript --highlight cpp and then use ps2pdf to distill the results into PDF. That would be the quick and dirty solution...

Norman Ramsey
A: 

Use doxygen. It can automatically generate HTML, LaTeX and PDF outputs.

sybreon
He's already tried doxygen.
Gayan
Unless I missed something important Doxygen will not automatically do PDF. It requires the Ghostscript interpreter and a bunch of fiddling to get everything set up correctly. On Windows anyway it's quite a pain, I think installing Cygwin as well is a path of least resistance because it gives you the Unix CLI stuff the Doxygen output expects to have available. The OP already mentioned Doxygen didn't work for him though, although maybe figuring out why the Latex compiler fails would help him. I've used Doxygen+GS to generate PDF for some pretty decent codebases, I wonder what makes his special.
Whatever
A: 

CWEB may be able to help you, it is a utility for literate programming which Knuth is especially fond of.

The tools expect a mix of C/C++ and LaTeX; CTANGLE outputs the bare code for compilation, and CWEAVE which strips out the LaTeX and the formatted code for creating the documentation. The windows port even has a utility which converts a C++ project to CWEB source.

You may have to add some formatting, but it is likely less work than creating a PDF yourself using the XML.

Simon David Pratt
+1  A: 

I did it the hard way now. I wrote a small script that generates a single HTML page from a doxygen XML output which I then convert into PDF later.

If anyone is interested, the code is available here: http://dev.pocoo.org/hg/simple-dd

Armin Ronacher
A: 

You can configure doxygen to produce RTF output, although it's fairly awful looking, and it's almost impossible to configure doxygen to do anything differently with it.

So I take that, pull it into a Word template with pretty styles, run a Rube Goldberg script that chops it up appropriatley, and then distill it.

Jon Konrath