Reputation: 147
Is there any class in tcpdf that make Page Display -> Enable Scrolling default options (When i open it in adobe reader), please help, i lost half of day on this. I found this class, but not what I need.
// set pdf viewer preferences
$pdf->setViewerPreferences($preferences);
Upvotes: 4
Views: 2738
Reputation: 618
I was looking for the same answer and your question actually put me on the right track.
From inspecting the TCPDF class, ended up finding the answer in the TCPDF_STATIC class, in the static method TCPDF_STATIC::getPageLayoutMode().
The correct function to use would be TCPDF::SetDisplayMode($zoom, $layout, $mode). For your purpose I'd suggest:
$pdf->SetDisplayMode('default','OneColumn'); OR $pdf->SetDisplayMode('default','continuous'); // continuous not documented, although should work.
Possible values for those parameters are as follows (from the method's PHPdoc):
public function SetDisplayMode($zoom, $layout='SinglePage', $mode='UseNone') { if (($zoom == 'fullpage') OR ($zoom == 'fullwidth') OR ($zoom == 'real') OR ($zoom == 'default') OR (!is_string($zoom))) { $this->ZoomMode = $zoom; } else { $this->Error('Incorrect zoom display mode: '.$zoom); } $this->LayoutMode = TCPDF_STATIC::getPageLayoutMode($layout); $this->PageMode = TCPDF_STATIC::getPageMode($mode); }
Upvotes: 8