###Page### not evaluated, when footer-width is present

17 views
Skip to first unread message

D3xter

unread,
Jul 19, 2012, 1:08:32 PM7/19/12
to rst2pdf...@googlegroups.com
I think i found a small bug.

When i Use ###Page### or ###Total### in the footer and don't set any width,
it looks like "Page 1 of 10",

but when i set the width i only get "Page ###Page### of ###Total###".


I've attached a small style-file to demonstrate it

If you remove the width from "mytext", Page/Total is evaluated correctly.
test.style

Roberto Alsina

unread,
Jul 19, 2012, 2:04:06 PM7/19/12
to rst2pdf...@googlegroups.com
Could you file a bug at https://code.google.com/p/rst2pdf/issues/entry ?

No promises, but at least it will be there when I set aside bugfixing time,

D3xter

unread,
Jul 23, 2012, 11:13:54 AM7/23/12
to rst2pdf...@googlegroups.com, ral...@kde.org
Well, I found, where the bug resides.

In createPdf.py in the "replaceTokens" function,
the variables are replaced with the actual data.

When width is set, instead of a single Paragraph, 
a rst2pdf.flowables.BoundByWidth is given, which contains
the Paragraph inside.

So the problem is, that the Paragraph inside the BoundByWidth won't be changed.

D3xter

unread,
Jul 26, 2012, 10:10:08 AM7/26/12
to rst2pdf...@googlegroups.com, ral...@kde.org
Here is a small patch, which replaces the variables in a Paragraph, when the Paragraph is inside
a BoundByWidth
rst2pdf.patch

D3xter

unread,
Jul 26, 2012, 10:24:54 AM7/26/12
to rst2pdf...@googlegroups.com, ral...@kde.org
Uh, seems like i've introduced a small syntax-error with the multiline comment,
but it should be easy to fix ;)

Roberto Alsina

unread,
Jul 27, 2012, 4:18:01 PM7/27/12
to rst2pdf...@googlegroups.com
Thanks for the patch, I will try to merge it today.
Reply all
Reply to author
Forward
0 new messages