The following works in PDFLaTeX:
\eject \pdfpagewidth=3in \pdfpageheight=10in
\eject \pdfpagewidth=10in \pdfpageheight=3in
That should work with Xelatex. See the SO qn, Change paper size in the middle of a latex document?, for more.
paper=a4 is exclusive of the KoMa-Script classes, that is,
No other class or package that I know of accepts it: the only notable exception is, of course, the package
typearea, which is part of the KoMa-Script bundle, to which the paper size options given to the KoMa-Script classes are deferred.
typearea.sty says also
a4paper as global option is recognized.
My preference would be to always use
a4paper. While I see virtues in KoMa-Script approach, it's non standard.
g-brief.cls uses only A4 paper, while
dinbrief uses it by default, so for these two classes you can avoid specifying the option. Also
scrlettr uses A4 paper by default.
Hope the code is self explanatory.
and the second: