}
}
+
+
return $res;
}
$this->addToLog($fwstk); */
}
+ public function getResolutionRatio(){
+ $a4surface = 500990; // en pt²
+ $docSurface = $this->generalInfos['size'][0] * $this->generalInfos['size'][1]; // en pt²
+ // to have the same surface resulting in px, we have to sqrt the ratio between the two surfaces defined above
+ return sqrt($a4surface / $docSurface);
+ }
+
public function makeMiniShot($page) {
$this->makeShotFixedWidth($page, 'p', 100, 90, 4, 'PNM');
}
$antialiasing = $antialiasing ? 'yes' : 'no';
$freetype = $texts ? 'yes' : 'no';
- $resolution = $resolution;
// Exporte les fichiers
$pdftoppm = new cubeCommandLine('pdftoppm', null, true);
$pdftoppm->setPath(CONVERTER_PATH);
// $method = max($method, self::FLATTEN);
}
- $out = $this->pdf2swf($page, $resolution, $quality, $storeAllChars, $method, 'p', $version);
+ $out = $this->pdf2swf($page, $resolution * $this->getResolutionRatio(), $quality, $storeAllChars, $method, 'p', $version);
if ($method < self::BARBARE_PNM) {
// Analyse de la sortie pour détecter des typos manquantes
$overflow = false;
public function makeHTML5Files($page) {
// Then make HD background shots
$resolutions = array(300 => 85, 150 => 85);
+ $rratio=$this->getResolutionRatio();
foreach ($resolutions as $r => $q) {
- $this->makeShotPNM($page, 'html/h' . $r . '-', $r, $q, 4, null, false);
- $this->makeShotPNM($page, 'html/t' . $r . '-', $r, $q, 4, null, true);
+ $this->makeShotPNM($page, 'html/h' . $r . '-', $r * $rratio, $q, 4, null, false);
+ $this->makeShotPNM($page, 'html/t' . $r . '-', $r * $rratio, $q, 4, null, true);
}
$this->makeSVGFile($page);
}