Adding custom information on shapes and custom items

Detailed description of issue

  1. I’m intrested to know if it’s possible to add custom information on shapes like lines. Basically we are drawing a line and we need to attach some custom informations.

  2. Also we have some items in database and an item has the next properties: id, name, code, description, type, image/ color, otherProperties. We want to draw on the pdf using this items. The item type can be for example, line or a stamp. If it’s line we need to draw a line shape using the properties of the item (in otherProperties for ex we have color). If it’s type stamp we need to use this item as a stamp using the item properties.}

Hey there!

Yes both of these scenerios is possible. Each annotation is just a JS class, so you can assign any properties you like to it. If you need to serialize that data into XFDF, its a bit more involved but definitely possible - let me know if you need help doing this.

For drawing annotations from data in a database, here is a couple resources to get you started.

Basically you just need to load your data from your database, create a the corresponding annotation class, and set its properties based on your database data.

I hope this helps! Let me know if you have any more questions.