Sphinx PDF output is bad. How do I chase down the cause?

1.3k Views Asked by At

My Sphinx input is six rst files and a bunch of PNGs and JPGs. Sphinx generates the correct HTML, but when I make pdf I get an output file that comes up blank in Adobe Reader (and comes up at over 5000%!) and does not display at all in Windows Explorer.

The problem goes away if I remove various input files or if I edit out what looks like entirely innocuous sections of the input, but I cannot get a handle on the specific cause. Any ideas on how to track this one down? Running Sphinx build with the -v option shows no errors.

I'm using the latest Sphinx (1.2.3) and the latest rst2pdf (0.93), with the default style. On Win7.

(added) This may help others with the same problem: I tried concatenating the rst files, then running rst2pdf on the concatenated file. That worked, though it gave me a bunch of warnings for bad section hierarchy and could not handle the Sphinx :ref: stuff. Could the bad section hierarchy thing (i.e. ==, --, ~~ in one file, ==, ~~, -- in another) be connected to the hopeless PDFs? Removing the conflict does not solve the problem, but that doesn't mean it's not a clue!

I could explore more if I could capture the output that Sphinx sends to rst2pdf.

1

There are 1 best solutions below

1
On

We had a similar problem: bad pdf output on project with a lot of chapters and images. We solved disabling the break page: in the conf.py, set the pdf_break_level value at 0.