tFPDF::SetDisplayMode PHP 메소드

SetDisplayMode() 공개 메소드

public SetDisplayMode ( $zoom, $layout = 'default' )
    function SetDisplayMode($zoom, $layout = 'default')
    {
        // Set display mode in viewer
        if ($zoom == 'fullpage' || $zoom == 'fullwidth' || $zoom == 'real' || $zoom == 'default' || !is_string($zoom)) {
            $this->ZoomMode = $zoom;
        } else {
            $this->Error('Incorrect zoom display mode: ' . $zoom);
        }
        if ($layout == 'single' || $layout == 'continuous' || $layout == 'two' || $layout == 'default') {
            $this->LayoutMode = $layout;
        } else {
            $this->Error('Incorrect layout display mode: ' . $layout);
        }
    }

Usage Example

$template = readTemplate($fname,$dummy);
if ($template)
	$text = $template->txt;
else
{
	$fname = defaultTemplateLanguage();
	$template = readTemplate($fname,$dummy);
	if (!$template) 
		die("Impossible to load a valid template");
	else
		$text = $template->getV1();
}

$fbgname = getTemplateBackgroundFilename();
if (!file_exists($fbgname))
	$fbgname = "";

if (!isset($_GET["t"]))
	printCertificate(null,null,null,null,null);
else
{
	$CERTIFICATES = true;        // flag
	require_once "extrarep.php"; // does all the work over db
}

sql_close();

$pdf->SetDisplayMode("fullpage","single");
$pdf->Output(preg_replace("/\W/","",$_SESSION["c_name"])." - Certificates.pdf", "I");
?>