My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 103: Issues with borderPadding
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  May 2009
Type-Defect
Priority-Medium


Sign in to add a comment
 
Reported by c...@online.de, Feb 15, 2009
I have two issues with borderPadding:

1) The border padding of code boxes seems to be a bit larger than the top
padding, though they actually use the same padding. You will see this in
the manual pdf for instance. This makes an unbalanced impression. The code
boxes that you get with rst2html look much better in that respect.

2) I tried to compensate that manually by setting borderPadding differently
for top and bottom, but that's currently not possible with rst2pdf because
it expects a single value. rst2pdf should support a tuple of values here,
just as ReportLab does:

"The attribute borderPadding adjusts the padding between the paragraph and
the border of its background. This can either be a single value or a tuple
containing 2 to 4 values. These values are applied the same way as in
Cascading Style Sheets (CSS). If a single value is given, that value is
applied to all four sides. If more than one value is given, they are
applied in clockwise order to the sides starting at the top."
Comment 1 by roberto.alsina, Feb 15, 2009
I don't see any special handling for borderPadding, it seems to be passes as-is to 
reportlab. I can't test it now, but does it give errors when you use a tuple? (or 
maybe a list?)

Comment 2 by c...@online.de, Feb 15, 2009
If you set it to a list (since there are no tuples in json), you will get errors
because of how the value is used in flowables.py (Sidebar.frameAction,
BoundByWidth.__init__ and BoundByWidth.wrap).
Comment 3 by roberto.alsina, Feb 15, 2009
Missed that one. I could take a look this week.
Comment 4 by roberto.alsina, Feb 17, 2009
The flowables situation is desperate. I don't even understand the code anymore, 
specially all the weird padding calculations.

I need to rewrite that as sane code, and then this issue should be simple.
Comment 5 by h.vonbargen, Feb 18, 2009
> The flowables situation is desperate.
> I don't even understand the code anymore, 
> specially all the weird padding calculations.
Ha ha, I could have written this as well.
Please keep in mind that wordaxe release 0.3.0 and newer uses its own Paragraph 
implementation. I tried to understand how this all worked in the original RL code, 
but I failed... What makes things worse: There isn't something like a specification 
about how exactly all this is supposed to work.

So the padding and the exact adjustment of paragraphs may well be DIFFERENT when 
using wordaxe in comparison to ReportLab.

And the new "borderPadding as a list" feature of RL 2.3 is currently NOT SUPPORTED 
by wordaxe, see the corresponding feature request 
http://sourceforge.net/tracker/index.php?
func=detail&aid=2580129&group_id=105867&atid=642481
Comment 6 by roberto.alsina, May 15, 2009
There is a regression here.

When running test_issue_103:

  File "../../createpdf.py", line 1432, in <module>
    main()
  File "../../createpdf.py", line 1429, in main
    compressed=options.compressed)
  File "../../createpdf.py", line 1123, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line 
855, in multiBuild
    self.build(tempStory, filename, canvasmaker)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line 
777, in build
    self.handle_flowable(flowables)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line 
665, in handle_flowable
    if frame.add(f, canv, trySplit=self.allowSplitting):
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/frames.py", line 174, in 
_add
    flowable.drawOn(canv, self._x + self._leftExtraIndent, y, _sW=aW-w)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/flowables.py", line 105, 
in drawOn
    self._drawOn(canvas)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/flowables.py", line 89, 
in _drawOn
    self.draw()#this is the bit you overload
  File "/usr/lib/python2.6/site-packages/wordaxe/rl/NewParagraph.py", line 830, in 
draw
    op(leftIndent-bp,
TypeError: unsupported operand type(s) for -: 'int' and 'list'

Owner: ---
Comment 7 by roberto.alsina, May 15, 2009
This is with wordaxe 0.3.2, RL 2.3
Comment 8 by c...@online.de, May 15, 2009
This has been fixed by Henning in the wordaxe trunk
(http://deco-cow.svn.sourceforge.net/viewvc/deco-cow/trunk/wordaxe/rl/NewParagraph.py?r1=74&r2=78),
so it will be solved when wordaxe 0.3.3 will be released.
Comment 9 by roberto.alsina, May 15, 2009
Ok, that's great.
Comment 10 by roberto.alsina, May 29, 2009
Added workaround, so it can be used if you don't have wordaxe. Will be in r639
Comment 11 by roberto.alsina, May 29, 2009
(No comment was entered for this change.)
Status: Fixed
Sign in to add a comment

Hosted by Google Code