From: Tutor on behalf of
Peter Otten <__pete...@web.de>
Sent: Monday, August 27, 2018 6:43 PM
To: tutor@python.org
Subject: Re: [Tutor] need help generating table of contents
Albert-Jan Roskam wrote:
>
> From: Tutor on behalf
> of Peter Otten <__pete...@web.de> Se
Albert-Jan Roskam wrote:
>
> From: Tutor on behalf
> of Peter Otten <__pete...@web.de> Sent: Friday, August 24, 2018 3:55 PM
> To: tutor@python.org
>
>> The following reshuffle of your code seems to work:
>>
>> print('\r\n** Table of contents\r\n')
>> pattern = '/Title \((.+?)\).+?/Page ([0-9]
From: Tutor on behalf of
Peter Otten <__pete...@web.de>
Sent: Friday, August 24, 2018 3:55 PM
To: tutor@python.org
> The following reshuffle of your code seems to work:
>
> print('\r\n** Table of contents\r\n')
> pattern = '/Title \((.+?)\).+?/Page ([0-9]+)(?:\s+/Count ([0-9]+))?'
>
> def pr
On 24Aug2018 17:55, Peter Otten <__pete...@web.de> wrote:
Albert-Jan Roskam wrote:
I have Ghostscript files with a table of contents (toc) and I would like
to use this info to generate a human-readable toc. The problem is: I can't
get the (nested) hierarchy right.
import re
toc = """\
[ /Pag
Albert-Jan Roskam wrote:
> Hello,
>
> I have Ghostscript files with a table of contents (toc) and I would like
to use this info to generate a human-readable toc. The problem is: I can't
get the (nested) hierarchy right.
>
> import re
>
> toc = """\
> [ /PageMode /UseOutlines
> /Page 1
> /
Hello,
I have Ghostscript files with a table of contents (toc) and I would like to use
this info to generate a human-readable toc. The problem is: I can't get the
(nested) hierarchy right.
import re
toc = """\
[ /PageMode /UseOutlines
/Page 1
/View [/XYZ null null 0]
/DOCVIEW pdfmark
[ /