With PDF Direct we have a very nice and easy way of adding bookmarks and annotations to our PDF using the -xpp-pdf-.... properties.
The attr() function adds some flexibility to those.
But sometimes that is not enough.
Sometimes you just that extra thing that CSS does not give you, like I want to uppercase the first letter of my bookmark or I want to use only the first 5 letters as the text for my bookmark.
Or I want to limit the length of the text in my bookmark to 15 characters.
Or maybe the text you want to use is sitting at a higher level like a parent attribute.
You name it...lots of possible variations that CSS just can not give you but XyPerl could.
So it would be very nice if we could define the bookmarks or annotations from within XyPerl.
Preferably using a similar syntax.
Something like:
$X->pdf_bookmark("type={book} text={$modifiedText}" level={1});
I do realize that we lose the ability to create a bookmarked PDF without composing, but that is a small price to pay. You just will need to compose the division 1 extra time every time you have changed your CSS style sheet. But that is something everybody is used to do anyhow. It feels even unnatural that one can alter the pdf bookmarks in your CSS stylesheet and you can print without going through an extra compose step.
This would also mean that this XyPerl extension could not be used in classic stylesheet setup, but that is OK :-)
(just switch to CSS if you want to use this :-)