2017-05-04 33 views
0

我试图在导出为PDF格式时将表单导向为全屏。这是我的代码导出为PDF时将表单导向为全屏

 Excel::create('Benchmark Constituents', function($excel) use ($Array_data) { 

      $excel->setTitle('Benchmark Constituents');      
      $excel->setDescription('File containing Benchmark Constituents'); 

     $excel->sheet('sheet1', function($sheet) use ($Array_data) { 
      $sheet->setOrientation('landscape');                
      $sheet->mergeCells('E1:G1'); 
      $sheet->cell('E1', function($cell) { 
       $cell->setValue('Benchmark Constituents'); 
       $cell->setAlignment('center'); 
       $cell->setFontColor('#ffffff'); 
       $cell->setBackground('##000000'); 
       $cell->setFont(array(
        'family'  => 'Calibri', 
        'size'  => '16', 
        'bold'  => true 
        )); 
      });                       
      $sheet->fromArray($Array_data, null,"A3",true); 
      $sheet->row(3, function($row) { 
       $row->setBackground('#808080'); 
       $row->setFontColor('#ffffff'); 
      }); 
      $sheet->row(1, function($row) { 
       $row->setBorder('none'); 
      }); 
      $sheet->row(2, function($row) { 
       $row->setBorder('none'); 

      }); 
     }); 
    })->download('pdf'); 

我收到此文件作为输出一些表列获取隐藏只是因为页面宽度:

image

+0

任何人都可以在国际空间站上帮助ue plz – Rajat

回答

0

尝试页边距设置为0

// Set all margins to 0 
$sheet->setPageMargin(0); 

Document here

+0

试过它已经不起作用了 – Rajat

+0

它不起作用 – Rajat