I need to export field's coordinates. How do I do it if the export format is not XML.
- In Document Definition create a custom text field, i.e. Total Coordinates
- In its properties > Rules create a script rule, i.e.
- Add Total field into the rule as well, and make sure Total Coordinates is not read only as it will be modified:
- This is the sample script that will get the Total field surrounding rectangle coordinates and write them into the Total Coordinates field:
Context.Field("Total Coordinates").Text = Context.Field("Total").Regions.SurroundingRect.Bottom.ToString() + ", " + Context.Field("Total").Regions.SurroundingRect.Left.ToString() +
", " + Context.Field("Total").Regions.SurroundingRect.Right.ToString() + ", " + Context.Field("Total").Regions.SurroundingRect.Top.ToString();
- It will return something like that:
- After that export that field into the data file together with other fields.
- It is possible to get coordinates of other fields as well the same way. However, for repeatable fields, iterate through every region as the field may have more than 1 instance.