This one is nice too, but will take some time to implement comparing to 2) and we need to modify the API each time a new type is needed.
I have no problem to implement either one though. So i prefer 2. Ok. Lets do 2) then. I have created a flyspray task for this [1]. Many thanks. [1] http://www.gnupdf.org/flyspray/index.php?do=details&task_id=56