首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >导出为PDF时将图纸方向设置为全屏

导出为PDF时将图纸方向设置为全屏
EN

Stack Overflow用户
提问于 2017-05-05 02:46:55
回答 1查看 814关注 0票数 0

我正在尝试让板材的方向全屏,同时导出为pdf。这是我的代码

代码语言:javascript
复制
        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');

我把这个文件作为输出,因为页面的宽度,一些表列被隐藏了:

EN

回答 1

Stack Overflow用户

发布于 2017-05-05 02:51:53

尝试将页边距设置为0

代码语言:javascript
复制
// Set all margins to 0
$sheet->setPageMargin(0);

Document here

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43790603

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档