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.
This commit is contained in:
parent
51707b5169
commit
bd60437cc6
|
|
@ -15,10 +15,10 @@ def extract_pdfoutline(ol: Any, prefix: str):
|
||||||
Extract the pdf outline
|
Extract the pdf outline
|
||||||
"""
|
"""
|
||||||
if type(ol).__name__ != type([]).__name__:
|
if type(ol).__name__ != type([]).__name__:
|
||||||
return f"{prefix}{ol['/Title']}\n"
|
return f"{prefix}:{ol['/Title']}\n"
|
||||||
olText = ""
|
olText = ""
|
||||||
for iol in ol:
|
for (i,iol) in enumerate(ol):
|
||||||
olText += extract_pdfoutline(iol, prefix+"\t")
|
olText += extract_pdfoutline(iol, f"{prefix}.{i+1}")
|
||||||
return olText
|
return olText
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue