I have three ways to create a TOC with DOMPDF, and don't know which to choose ..
The Problem: You know the Page numbers after rendering, but want the TOC in advance of the document.
All three methods use inline PHP to write the content in a global array
After creating the PDF with DOMPDF, create a second PDF with the TOC and merge them, using FPFI
- FPDI could reduce some styling
After creating the PDF with DOMPDF, and remembering the Contents, generate the PDF a second Time with the TOC, adjusting the Page numbers
- Dont repeat yourself
- Consistent Environment
Use a Placeholder for the TOC and fill it after rendering the PDF
- Don't know if its working
Any Experts in DOMPDF have a favourite solution ?
Wolfgang