On my Mac running TeXlive 2012 when I do
pdflatex testpage \papertype=a4paper \doublesided=n
and open the resulting PDF file in preview, I can see that the margins are completely wrong in the produced PDF.
If I leave out the a4paper and do
pdflatex testpage \papertype= \doublesided=n
I get a PDF with the expected layout, as shown here:
What am I doing wrong here and how can I make pdflatex perform correctly while using the correct paper size? I have also done the same test with xelatex, with exactly the same results.