The steps are simple, I just made an annotation and saved the document, after that when I try to do another one and save the file again I get an error. I figure out the issue cause. The problem is when the coordinates are calculated. The minX and minY is always 0, because the code is comparing the properties that has the initial value equals zero with the annotation position for example 30. Zero is always less than 30 so it never change the property value. My change was set the initial value of minX and minY properties to Float.MAX_VALUE, this way when the code makes the comparison it will change the property value.