New Forum | Previous | Next | (P-PDF) Developers
Topic: Re: Annaotation AP dictionary
Conf: (P-PDF) Developers, Msg: 56404
Date: 5/29/2002 05:19 PM
En/Na p-pdf-developer Listmanager ha escrit:
> From: "Steven"
> ------ AcroBuddies Forum | http://www.acrobuddies.com ------
> I am trying to programmatically add a rectangle annotation to a PDF document. I am successfully able to create the annotation, its associated popup, etc. I am, however, having trouble creating its AP object. I need to know how to create the BBox attribute's
> coordinates (/BBox [ 0 0 135 59 ]) based on the user space coordinates of the rectangle. I also need to know how to create the AP stream itself. A rectangle's AP stream is usually in the format:
> q 0 0 1 RG 0 d 2 w 1 1 83.351 40.0385 re S Q
> What I need to know is how to come up with the 83.351 and 40.0385, which obviously are related to the rectangle s size. These appear to also be related to
> the BBox coordinates which I enquired about above.
> Any help would be very much appreciated
If you would create 'on line' the Bbox attribute for 'Annotation' (it's
a 'Link' or a 'Note'?) you need to ask to your application that it
capture the actual 'Annotation Object' position in user space (always in
For example, if your workflow is in PostScript, you can know the
Bounding Box (the bounding box is the smallest rectangle that will just
enclose the entire graphic object shape) of for example the text 'Link
Me' (if you wont to create an Annotation Link) asking the interpreter
just in the last 'moveto' operator with the 'pathbbox' operator: it
returns the x1 y1 x2 y2 Bounding Box coordinates. For the 'AP stream'
you need the same information.
If you need a PostScript code support for this, e-mail me.
Marc Antoni Malagarriga