Hi Volker,

we're using our own "afterFlowable()" function in rl/pagetemplates.py to
faciliate the use of platypus/tableofcontents.py to generate a toc with
clickable links. Using the flowable.style.name variable we discriminate
between the levels of heading styles.

For each level, there is a call to self.notify('TOCEntry', (levelnumber,
text, self.page, key)). In levels two and three i had to remove the 'key'
parameter, so we only got clickable links in the toc for entries in level
zero and one.

When the key parameter wasn't omitted, the resulting pdf was readable in
all readers (adobe, evince,
others), but opening it in anything besides adobe reader resulted in some
"bounding box" errors on the command line. Opening it in applications based
on the pdfsharp-libraries for .net caused the application to crash (we
wanted to add titlepages). Itext-based applications seemed to work. Also,
it wasn't possible to print from the document when a table of contents page
containing level two or level three entries was included in the range of
pages to print. Apparently the xref-table in the pdf was damaged.

I know that the platypus/tableofcontents.py functionality is not supported
by mwlib; however, i found some discussion thread for reportlab where a
similar issue was brought up and upgrading the reportlab version seemed to
solve the problem, which led me to ask here.

Best regards,
 Stefan Birkholz


2011/10/27 Volker Haas <[email protected]>

>
>
> On 12.10.2011 18:04, Stefan Birkholz wrote:
>
>> Hello,
>>
>> apparently, mwlib.ext depends on a (patched?) version 2.3 of
>> reportlab.
>>
> This is a correct assumption. Unfortuantely we encountered some bugs in
> reportlab in the past that weren't patched upstream. Therefore we rely on a
> patched version.
>
>
>   Is it feasible to upgrade to the current version 2.5?
>>
> Upgrading to a newer reportlab version is a huge pain unfortunately.
>
>
>   I did
>> a quick/naive test a while ago but there seem to be quite a few
>> problems.
>>
> The problem are the conflicts between our patches and the upstream
> version. Therefore, as mentioned above, upgrading to a newer reportlab
> version is very painful. Since we included patches for right-to-left
> languages a little while ago merging got even more painful.
>
>
>
>> However, the current version of reportlab seems to produce damaged
>> pdfs under certain conditions; e.g. in my installation when i
>> uncomment
>> #import reportlab
>> #reportlab.rl_config.platypus_**link_underline = 1
>>
>
> How are the PDFs damaged? Are there problems in certain viewers? Does the
> render process crash?
>
>
>
>  in rlwriter.py. Would this problem be fixed in a newer version of
>> reportlab?
>>
> I wouldn't count on that
>
>
>  (Another problem which is more interesting for us: we use platypus/
>> tableofcontents.py to get a toc with clickable links; having such
>> links leads to damaged pdfs when there are three or four levels in the
>> toc, but not when there are only one or two levels.
>>
> How are these PDFs damaged? One thing I encountered a while ago that might
> be related: when creating an outline for a PDF (the ouline can be displayed
> by PDF viewers): the entries couldn't skip levels. For example a level 3
> entry could only be made after a level 2 but not level 1 entry
>
>
>   As a work-around i
>> just disabled creating actual links for 3rd/4th level entries in the
>> "afterFlowable()" function in pagetemplate.py, which seems arbitrary
>> at best.)
>>
>> Best regards,
>>  Stefan Birkholz
>>
>>
> --
> volker haas                 brainbot technologies ag
> fon +49 6131 2116394        boppstraße 64
> fax +49 6131 2116392        55118 mainz
> [email protected]    http://www.brainbot.com/
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "mwlib" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to mwlib+unsubscribe@**
> googlegroups.com <mwlib%[email protected]>.
> For more options, visit this group at http://groups.google.com/**
> group/mwlib?hl=en <http://groups.google.com/group/mwlib?hl=en>.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"mwlib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/mwlib?hl=en.

Reply via email to