From bd60437cc68522766474ba2f5a48071192975f3c Mon Sep 17 00:00:00 2001 From: hanishkvc Date: Sat, 8 Nov 2025 03:47:25 +0530 Subject: [PATCH] SimpleChatTC:PdfText: Numbering T1 - Diff Scheme needed This simple scheme doesnt work. Rather the pdf outline seems to follow below logic If a child list is found when processing the current list, dont increment the numbering. --- tools/server/public_simplechat/local.tools/pdfmagic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/server/public_simplechat/local.tools/pdfmagic.py b/tools/server/public_simplechat/local.tools/pdfmagic.py index ff4d2fcb42..384a0752f2 100644 --- a/tools/server/public_simplechat/local.tools/pdfmagic.py +++ b/tools/server/public_simplechat/local.tools/pdfmagic.py @@ -15,10 +15,10 @@ def extract_pdfoutline(ol: Any, prefix: str): Extract the pdf outline """ if type(ol).__name__ != type([]).__name__: - return f"{prefix}{ol['/Title']}\n" + return f"{prefix}:{ol['/Title']}\n" olText = "" - for iol in ol: - olText += extract_pdfoutline(iol, prefix+"\t") + for (i,iol) in enumerate(ol): + olText += extract_pdfoutline(iol, f"{prefix}.{i+1}") return olText