I'm using v8.1.10
See attachment
When the text of the chapter is long, the dots bite on the last character in the TOC (see chapter 2 of the example).
In chapter 3 title, I have manually deleted the last character "V" and have retyped a new one. This one is not rendered correctly in the PDF format (Chapter title and TOC).
The Word version of the backup seams correct.
- Code: Select all
// La TOC calcule mal les points de continuation
// Supprimer manuellement un caractère et le retaper perturbe la sauvegarde PDF (SPACE supprimé)
internal void DoTest()
{
string inputFilename = Path.Combine(Application.StartupPath, "AAA.docx");
string outputPDFFilename = Path.Combine(Application.StartupPath, "AAA.pdf");
Document document = new Document(inputFilename);
Paragraph tocParagraph = new Paragraph(document);
tocParagraph.AppendTOC(1, 1);
Section section = document.Sections[0];
section.Paragraphs.Insert(0, tocParagraph);
document.UpdateTableOfContents();
document.SaveToFile(outputPDFFilename);
Process.Start(outputPDFFilename);
}