Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/241.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php “转换为pdf格式”;“在cellmap中找不到框架”;_Php_Laravel_Pdf - Fatal编程技术网

Php “转换为pdf格式”;“在cellmap中找不到框架”;

Php “转换为pdf格式”;“在cellmap中找不到框架”;,php,laravel,pdf,Php,Laravel,Pdf,我正在构建一个发票系统,首先您必须填写您希望在发票上显示的产品,然后它将html视图(在其中以foreach循环显示产品)转换为pdf。但如果我有6种以上的产品,它将抛出以下异常: 在cellmap中找不到框架 我知道这个问题被问了很多。但似乎仍然没有真正的解决办法。当页面上的输入大于第一页且无法跳转到新页面时,会发生此错误,因此会抛出错误: 已经试过很多了 这对我不起作用: $paper_orientation = 'landscape'; $customPaper = array(0,0,9

我正在构建一个发票系统,首先您必须填写您希望在发票上显示的产品,然后它将html视图(在其中以foreach循环显示产品)转换为pdf。但如果我有6种以上的产品,它将抛出以下异常:

在cellmap中找不到框架

我知道这个问题被问了很多。但似乎仍然没有真正的解决办法。当页面上的输入大于第一页且无法跳转到新页面时,会发生此错误,因此会抛出错误:

已经试过很多了

这对我不起作用:

$paper_orientation = 'landscape';
$customPaper = array(0,0,950,950);
$dompdf->set_paper($customPaper,$paper_orientation);

这是我的html视图:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Factuur</title>
    <link rel="stylesheet" href="/administration/style.css" media="all" />
  </head>
  <body>
    <header class="clearfix">
      <img src="/administration/logo.png">
      <div id="company">
          <h2 class="name">Company name</h2>
          <div>Address</div>
          <div>zip</div>
          <div><a href="email">email</a></div> 
      </div>
      </div>
    </header>
    <main>
      <div id="details" class="clearfix">
        <div id="client">
          <div class="to">{{ $sort == 0 ? 'Offerte' : 'Factuur' }} voor:</div>
          <h2 class="name">{{ $company }}</h2>
          <div class="address">{{ $address }}</div>
          <div class="address">{{ $zip }}</a></div>
        </div>
        <div>
          <h1>{{ $sort == 0 ? 'Offerte' : 'Factuur' }}nummer: {{ $number }}</h1>
          <div class="date">Datum: {{  $date }}</div>
        </div>
      </div>
      <table border="0" cellspacing="0" cellpadding="0">
        <thead>
          <tr>
            <th class="no">#</th>
            <th class="desc">Beschrijving</th>
            <th class="unit">Prijs</th>
            <th class="qty">Aantal</th>
            <th class="total">Totaal</th>
          </tr>
        </thead>
        <tbody>
        @foreach($products as $product)
          <tr>
            <td class="no">{{ $product->id }}</td>
            <td class="desc"><h3>{{ $product->title }}</h3>{{ $product->description }}</td>
            <td class="unit">€{{ $product->price }}</td>
            <td class="qty">{{ $product->number }}</td>
            <td class="total">€{{ $product->total }}</td>
          </tr>
        @endforeach
        </tbody>
      <tfoot>
          <tr>
            <td colspan="2"></td>
            <td colspan="2">SUBTOTAAL</td>
            <td>€ {{ $subtotal }}</td>
          </tr>
          <tr>
            <td colspan="2"></td>
            <td colspan="2">BTW 21%</td>
            <td>€ {{ $btw }}</td>
          </tr>
          <tr>
            <td colspan="2"></td>
            <td colspan="2">TOTAAL</td>
            <td>€ {{ $total }}</td>
          </tr>
        </tfoot>
      </table>
        <div id="notices" class="{{ $sort == 0 ? 'hidePayment' : 'notices' }}">
          <div>BETALING:</div>
        </div>
    </main>
    <footer>
      KvK nummer:  | BTW nummer: 
    </footer>
  </body>
</html>

工厂
公司名称
地址
拉链
{{$sort==0?'Offerte':'Factuur'}}voor:
{{$company}}
{{$address}
{{$zip}
{{$sort==0?'Offerte':'Factuur'}}numer:{{$number}
数据:{{$date}
#
贝什里金
普里斯
安塔尔
托塔尔
@foreach($products as$product)
{{$product->id}
{{$product->title}{{{$product->description}}
欧元{{$product->price}
{{$product->number}
欧元{{$product->total}
@endforeach
小吃
欧元{{$小计}
顺便说一句,21%
欧元{{$btw}
托塔尔
欧元{{$total}
测试:
KvK nummer:|顺便说一句,nummer:

有解决办法吗?

恐怕我们无能为力,因为您所链接的问题自2013年以来一直没有解决。我能给你的唯一建议是换一种不同的方式,比如(发票忍者,仅供参考),(有点老了,但仍然在列表上),或者(使用)@phaberest-oke,谢谢你尝试一下。@phaberest如果我使用laravel-snappy,问题会消失吗?它与DOMPF无关,所以这就像比较橘子和苹果。如果你对苹果过敏,你当然可以喝橙汁;)