Reapply from PhantomJS: page.paperSize is not accurate for .pdf.

See also: https://github.com/ariya/phantomjs/issues/11590

Change-Id: I2dd5e1e657cbe7b96b04f575f69329649458b763