It doesn't look like the constructor ever actually populates the orientation value.
Try this:
public function listdata()
{
$pdf = PDF::loadView('pdf.test_pdf');
$pdf->setPaper('A4', 'landscape');
return $pdf->stream('test_pdf.pdf');
}
Probably the constructor should be updated from:
public function __construct(Dompdf $dompdf, ConfigRepository $config, Filesystem $files, ViewFactory $view){
$this->dompdf = $dompdf;
$this->config = $config;
$this->files = $files;
$this->view = $view;
$this->showWarnings = $this->config->get('dompdf.show_warnings', false);
}
to:
public function __construct(Dompdf $dompdf, ConfigRepository $config, Filesystem $files, ViewFactory $view){
$this->dompdf = $dompdf;
$this->config = $config;
$this->files = $files;
$this->view = $view;
$this->showWarnings = $this->config->get('dompdf.show_warnings', false);
$this->orientation = $this->config->get('dompdf.orientation', 'portrait');
}
That should probably be submit as a PR if that resolves the issue.
and/or any reference to $this->orientation in the PDF class should be updated to use the config value.