1

Is there a way to convert html file (generated by Sphinx) to a pdf with table of contents?

I'm on kubuntu 12.04, I've downloaded the lib, move files to html dir, and have modified example00.php:

<?php
/**
* HTML2PDF Librairy - example
*
* HTML => PDF convertor
* distributed under the LGPL License
*
* @author Laurent MINGUET <webmaster@html2pdf.fr>
*
* isset($_GET['vuehtml']) is not mandatory
* it allow to display the result in the HTML format
*/

// get the HTML
ob_start();
include(dirname(__FILE__).'/index.html');
$content = ob_get_clean();

// convert in PDF
require_once(dirname(__FILE__).'/html2pdf.class.php');
try
{
$html2pdf = new HTML2PDF('P', 'A4', 'en');
// $html2pdf->setModeDebug();
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
$html2pdf->Output('index.pdf');
}
catch(HTML2PDF_exception $e) {
echo $e;
exit;
}

(I've also renamed the file to index.php) Then I run it with

php5 index.php

It gave me:

PHP Notice: Undefined variable: kPathUrl in /home/boris/pst/wordy/edu/MolDynOfMicroBioSystems/_build/singlehtml/_class/tcpdfConfig.php on line 80
<strong>TCPDF ERROR: </strong>Could not include font definition file: arial

I don't know what to do next. I'm not a php programmer (but I know python, elisp, bash).

2

try to put directly a value in $kPathUrl

or use it directly in your browser
Ancien pseudo : lolo

3

If you have the source code of the generated HTML file, you can directly use Sphinx to generate PDF.
avatar
<<< Kernel Extremis©®™ >>> et Inventeur de la différence administratif/judiciaire ! (©Yoshi Noir)

<Vertyos> un poil plus mais elle suce bien quand même la mienne ^^
<Sabrina`> tinkiete flan c juste qu'ils sont jaloux que je te trouve aussi appétissant

4

Spipu (./2) :
try to put directly a value in $kPathUrl


What does it mean? Where should I put it? What path is it?