|
@@ -53,7 +53,7 @@ Pdf pdf = new Pdf();
|
|
pdf.addPageFromString("<html><head><meta charset=\"utf-8\"></head><h1>Müller</h1></html>");
|
|
pdf.addPageFromString("<html><head><meta charset=\"utf-8\"></head><h1>Müller</h1></html>");
|
|
pdf.addPageFromUrl("http://www.google.com");
|
|
pdf.addPageFromUrl("http://www.google.com");
|
|
|
|
|
|
-// Add a Table of contents
|
|
|
|
|
|
+// Add a Table of Contents
|
|
pdf.addToc();
|
|
pdf.addToc();
|
|
|
|
|
|
// The `wkhtmltopdf` shell command accepts different types of options such as global, page, headers and footers, and toc. Please see `wkhtmltopdf -H` for a full explanation.
|
|
// The `wkhtmltopdf` shell command accepts different types of options such as global, page, headers and footers, and toc. Please see `wkhtmltopdf -H` for a full explanation.
|
|
@@ -61,6 +61,9 @@ pdf.addToc();
|
|
pdf.addParam(new Param("--no-footer-line"), new Param("--header-html", "file:///header.html"));
|
|
pdf.addParam(new Param("--no-footer-line"), new Param("--header-html", "file:///header.html"));
|
|
pdf.addParam(new Param("--enable-javascript"));
|
|
pdf.addParam(new Param("--enable-javascript"));
|
|
|
|
|
|
|
|
+// Add styling for Table of Contents
|
|
|
|
+pdf.addTocParam(new Param("--xsl-style-sheet", "my_toc.xsl"));
|
|
|
|
+
|
|
// Save the PDF
|
|
// Save the PDF
|
|
pdf.saveAs("output.pdf");
|
|
pdf.saveAs("output.pdf");
|
|
```
|
|
```
|