[reportlab-users] Bookmarking & Zoom (+BugFix)

Ian Sparks reportlab-users@reportlab.com
Fri, 7 Feb 2003 09:59:05 -0500


>>I'd rather try to tackle it with a small number of simple arguments =
than passing in extra objects<<

This appears to be "the ReportLab way" and would fit with the rest of =
the API.

I'm assuming the altered bookmarkPage() method would deprecate =
bookmarkHorizontalAbsolute() ?

I also assume that you want the test script to exercise every fit =
option? I'd be happy to create such a beast.

>>Thanks very much,<<

ReportLab is a superb product, I'm glad to be able to contribute a small =
something back.=20

- Ian.


-----Original Message-----
From: Andy Robinson [mailto:andy@reportlab.com]
Sent: Thursday, February 06, 2003 4:51 PM
To: reportlab-users@reportlab.com
Subject: RE: [reportlab-users] Bookmarking & Zoom (+BugFix)


Congratulations!  The number of people in the world able
to expose new PDF features just grew by 20-25% (?) which
is good news for us - and I hope encourages others!

> Adding some support to canvas.bookmarkPage and=20
> canvas.bookmarkHorizontalAbsolute to allow zoom,x position or the=20
> type of Fit setting (perhaps by passing in an optional=20
> PDFDestinationFit object?) should just be a matter of typing.
>=20
> Andy, would you consider adding this support?

I just checked in the pdfdoc fix.

I'd rather try to tackle it with a small number of simple=20
arguments than passing in extra objects, as we are thinking
a lot about exposing the canvas to Java, COM et al
and I want to avoid multiplying the number of
objects to be passed around.  Here's a candidate new API:


    def bookmarkPage(self, key,
                     fitType=3D"XYZ",
                     left=3DNone,
                     top=3DNone,
                     bottom=3DNone,
                     right=3DNone,
                     zoom=3DNone
                     ):
        """
        This creates a bookmark to the current page which can
        be referred to with the given key elsewhere.

        PDF offers very fine grained control over how Acrobat
        reader is zoomed when people link to this. The default
        is to keep the user's current zoom settings. the last
        arguments may or may not be needed depending on the
        choice of 'fitType'.
       =20
        Fit types and the other arguments they use are:
        /XYZ left top zoom - fine grained control.  Null
          or zero for any of the parameters means 'leave
          as is', so "0,0,0" will keep the reader's settings.
         =20
        /Fit - entire page fits in window

        /FitH top - top coord at top of window, width scaled
                    to fit.

        /FitV left - left coord at left of window, height
                     scaled to fit
                    =20
        /FitR left bottom right top - scale window to fit
                                  the specified rectangle

        (question: do we support /FitB, FitBH and /FitBV
        which are hangovers from version 1.1 / Acrobat 3.0?)"""

Does that work for you?

Have you got any more stamina to help make a test script if
I add it in? <grin>

Thanks very much,

Andy
_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users