[reportlab-users] pythonpoint / pgpgen bookmarking question or maybe bug?

Karl N. Redman karlredman at marketsystems.com
Wed Oct 12 16:36:30 EDT 2005


Thank you for your reply. I think I may not have been clear as to the 
problem that I'm having though.

The issue is that c.addOutlineEntry("Page 1","P1")  is not working at 
all. This call results in a "ValueError: format not resolved P1" 
exception when called from PPSlide::drawOn. However, if 
c.addOutlineEntry("Page 1","Page 1")  or c.addOutlineEntry("P1","P1")  
is called then I do not reach this exception. so if 'name' and 'key' are 
the same we're fine. The problem with this, of coarse, is that my 
outline will not have unique keys if any names should be repeated.

pythonpoint.PPSlide.drawOn does the same thing. It calls 
canv.addOutlineEntry(tag, tag, self.outlineLevel). However, I don't see 
that this is a pythonpoint issue. It seems to be a problem in the 
rendering of the document int that pdfdoc.Destination.fmt is not being 
set for some reason when pdfdoc.addOutlineEntry has been called with the 
name and key being different. This problem is easily duplicated by 
changing the key value in  the canv.addOutlineEntry call in method 
pythonpoint.PPSlide.drawOn to something like addOutlineEntry(tag, 
tag+"anything", self.outlineLevel).

I have spent a significant amount of time trying to track down this 
problem so any further suggestions would be greatly appreciated.

Sincerely,
Karl N. Redman

Robin Becker wrote:

> Karl N. Redman wrote:
> ......
>
> I think you're misusing the bookmark name in the draw method
>
>>    def drawOn(self, canv):
>>
>>        pythonpoint.PPSlide.drawOn(self, canv)
>>
>>        if ( self.bookmarkName != None):
>>
>>            canv.bookmarkPage(self.bookmarkName)
>>
>>         # THIS SEEMS BROKEN !!!!!!!!!!!!!!!!!!!!!
>>            canv.addOutlineEntry(self.bookmarkName, 
>> self.bookmarkName+"x", self.incOutlinelevel) 
>
>
>
> The bookmark method
>
> creates a bookmark with a given key.
>
> The addOutlineEntry then refers to the bookmark
>
> c.bookmarkPage("P1")
> c.addOutlineEntry("Page 1","P1")
>
> the second argument names the reference.
>
>
> you have effectively
>
> c.bookmarkPage("P1")
> c.addOutlineEntry("P1","P1x")
>
>




More information about the reportlab-users mailing list