Printing GoRectangle

I am adding a GoRectangle to a GoView in its constructor:
GoRectangle r = new GoRectangle();
r.Bounds = new RectangleF(100, 100, 100, 100);
r.Printable = true;
PrintsViewObjects = true;
BackgroundLayer.AllowPrint = true;
The rectangle shows up in the view, but it does not show up in the print preview or the print itself.
What is missing to make the rectangle print ?

I got it working by overriding PrintDocumentSize and PrintDocumentTopLeft.

Is there a way to make 'ordinary' GoShapes behave the way GoNodes behave so they automatically get recognized for printing ?

If the objects you have in your GoView layer(s) are fixed, you probably didn’t need to override those two GoView properties – you could have just set the GoView.Document.Size and GoView.Document.TopLeft properties.

But in the general case, overriding GoView.PrintDocumentSize and .PrintDocumentTopLeft is the right thing to do.
All GoObjects, whether they are GoShapes or GoNodes, are treated the same way.

Well, the issue is that the rectangle does not affect the calculation for GoView.PrintDocumentSize and .PrintDocumentTopLeft.

As soon as I drop a GoNode on the view, these properties are calculated to include the node - but not the rectangle.
It is as if the rectangle does not exist as far as affecting the dimensions of the printed page is concerned.
Setting GoView.Document.Size and GoView.Document.TopLeft also does not affect GoView.PrintDocumentSize and GoView.PrintDocumentTopLeft; if there is no node PrintDocumentSize is zero and nothing gets printed - that is, until I override the print properties.

Yes, if you add an object to a view layer, it is not part of the document, so it does not count in the document’s size.

So you are quite right -- if you want to dynamically affect the values of the GoView.PrintDocumentSize and .PrintDocumentTopLeft properties, you do need to override those properties.