2017-05-04 69 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