Disable page shrinking for pdf printing to create accurate output

PDFs are not rendered like PNG or other image formats by phantomjs because it
uses the printer functionality of Qt+Webkit. But Webkit uses some printer
"optimization" to save paper by shrinking the output. Such shrinking results in
too small content on a page.

https://github.com/ariya/phantomjs/issues/11590 ("page.paperSize is not
accurate for .pdf")
1.x
Sven Eckelmann 2013-10-19 12:54:41 +02:00 committed by Ariya Hidayat
parent 800fbe8452
commit b4e295cc97
1 changed files with 2 additions and 2 deletions

View File

@ -35,13 +35,13 @@ namespace WebCore {
// print in IE and Camino. This lets them use fewer sheets than they
// would otherwise, which is presumably why other browsers do this.
// Wide pages will be scaled down more than this.
const float printingMinimumShrinkFactor = 1.25f;
const float printingMinimumShrinkFactor = 1;
// This number determines how small we are willing to reduce the page content
// in order to accommodate the widest line. If the page would have to be
// reduced smaller to make the widest line fit, we just clip instead (this
// behavior matches MacIE and Mozilla, at least)
const float printingMaximumShrinkFactor = 2;
const float printingMaximumShrinkFactor = 1;
PrintContext::PrintContext(Frame* frame)
: m_frame(frame)