I already have that part working.
I am overriding DocExtentSize to prevent the grid to get drawn outside of the document bounds.
I don't want to suggest to the user that this region is valid in any way.
If the entire document is visible in the view, but the aspect ratio of the view is not the same as that of the document, there will be a region in the view that is empty; i.e. where the document does not extend to.
In this case , the DocExtentSize is larger than the document size in at least one direction.
The view does display the grid in that region, however, whichis what I want to prevent.
By limiting the DocExtentSize to the document size, no grid gets drawn in the region outside the document, but I have to include an offset of 96 in document coordinates to prevent a thin border to the right and/or bottom of the document to show.
My question is: why the offset, can I get rid of it, or if not do I need to calculate it in a less ad hoc way ?