  We study fibrations of the projective model for the symmetric space
associated with $\text{SL}(2n,\mathbb{R})$ by codimension $2$ projective
subspaces, or pencils of quadrics. In particular we show that if such a smooth
fibration is equivariant with respect to a representation of a closed surface
group, the representation is quasi-isometrically embedded, and even Anosov if
the pencils in the image contain only non-degenerate quadrics. We use this to
characterize maximal representations among representations of a closed surface
group into $\text{Sp}(2n,\mathbb{R})$ by the existence of an equivariant
continuous fibration of the associated symmetric space, satisfying an
additional technical property. These fibrations extend to fibrations of the
projective structures associated to maximal representations by bases of pencils
of quadrics.
