質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

Laravel 5

Laravel 5は、PHPフレームワークLaravelの最新バージョンで、2014年11月に発表予定です。ディレクトリ構造がが現行版より大幅に変更されるほか、メソッドインジェクションやFormRequestの利用が可能になります。

Q&A

解決済

1回答

925閲覧

「Frame not found in cellmap」[laravel]PDF出力時に500Serverエラーが発生する。(save時)

退会済みユーザー

退会済みユーザー

総合スコア0

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

Laravel 5

Laravel 5は、PHPフレームワークLaravelの最新バージョンで、2014年11月に発表予定です。ディレクトリ構造がが現行版より大幅に変更されるほか、メソッドインジェクションやFormRequestの利用が可能になります。

0グッド

0クリップ

投稿2018/01/08 04:29

編集2018/01/08 09:27

##わからないこと
いつもお世話になっております。
この度PHPでPDFを出力する機能を開発していますが、下記のコード内「$pdf->save」にて500エラーが発生します。

この原因は何なのかわからず、困っております。
ご教授いただければ幸いです。

###コード

php

1use Barryvdh\DomPDF\Facade as PDF; 2 3 4 5$wageResult = 650; 6header('Content-Type: application/pdf'); 7header('Content-Disposition: attachment;filename="'.'2017年度.pdf"'); 8header('Cache-Control: max-age=0'); 9$pdf = PDF::loadHTML(view('file.withholding', ['wage' => $wageResult])->render()); 10$pdf->getDomPDF()->set_option('enable_font_subsetting', true); 11error_reporting(0); 12$pdf->save('php://output'); 13error_reporting(E_ALL); 14exit;

html

1<!DOCTYPE HTML> 2<html lang="ja"> 3<head> 4<meta charset="UTF-8"> 5<style type="text/css"> 6body { 7font-family: ipagothic; 8-webkit-print-color-adjust: exact; 9width:950px; 10height:600px; 11margin: 0 auto; 12} 13 14th { 15font-size: 15px; 16} 17.table1 { 18 width:100%; 19 height:25%; 20 border-collapse: collapse; 21} 22.bld-1so { 23 border:1px solid; 24} 25.txt-center { 26 text-align: -webkit-center; 27 text-align: center; 28} 29.fnt-bold { 30 font-weight:bold; 31} 32.fnt-10 { 33 font-size:10px; 34} 35.fnt-15 { 36 font-size:15px; 37} 38.fnt-30 { 39 font-size:30px; 40} 41.wdt7p { 42 width:7%; 43} 44</style> 45</head> 46<body> 47<div class="fnt-bold fnt-30 txt-center"> 48平成 29 年分 給与所得の源泉徴収票 49</div> 50<div class="bld-1so"> 51<div> 52 53 54<table cellspacing="0" style="border:1px double;width:100%;height:15%;"> 55<tbody> 56<tr> 57<th style="border:1px solid;font-size:10px;width:4%;font-size:20px;" rowspan="3"><span>支払者</span></th> 58<th style="border:1px solid;height:25%;">個人番号又は法人番号</th> 59 60</tr> 61 62<tr> 63<th style="border:1px solid;font-size:15px;width:20%;">住所(居所)又は所在地 64</th> 65<th style="border:1px solid;font-size:18px;" colspan="13">東京都新宿区大久保1丁目14-15 三辰ビル7F 66</th> 67</tr> 68 69<tr> 70<th style="border:1px solid;font-size:15px;">氏名又は名称 71</th> 72<th style="border:1px solid;font-size:18px;" colspan="13">株式会社シニアジョブ 73</th> 74</tr> 75</tbody> 76</table> 77 78</div> 79</div> 80</body> 81</html>

##追記
下記のようにエラーが表示されていました。

<div id="sf-resetcontent" class="sf-reset"> <h1>Whoops, looks like something went wrong.</h1> <h2 class="block_exception clear_fix"> <span class="exception_counter">1/1</span> <span class="exception_title"><abbr title="DOMPDF_Exception">DOMPDF_Exception</abbr> in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\cellmap.cls.php line 244" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">cellmap.cls.php line 244</a>:</span> <span class="exception_message">Frame not found in cellmap</span> </h2> <div class="block"> <ol class="traces list_exception"> <li> in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\cellmap.cls.php line 244" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">cellmap.cls.php line 244</a></li> <li>at <abbr title="Cellmap">Cellmap</abbr>->get_spanned_cells(<em>object</em>(<abbr title="Table_Cell_Frame_Decorator">Table_Cell_Frame_Decorator</abbr>)) in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\table_cell_renderer.cls.php line 50" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">table_cell_renderer.cls.php line 50</a></li> <li>at <abbr title="Table_Cell_Renderer">Table_Cell_Renderer</abbr>->render(<em>object</em>(<abbr title="Table_Cell_Frame_Decorator">Table_Cell_Frame_Decorator</abbr>)) in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\renderer.cls.php line 287" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">renderer.cls.php line 287</a></li> <li>at <abbr title="Renderer">Renderer</abbr>->_render_frame('table-cell', <em>object</em>(<abbr title="Table_Cell_Frame_Decorator">Table_Cell_Frame_Decorator</abbr>)) in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\renderer.cls.php line 107" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">renderer.cls.php line 107</a></li> <li>at <abbr title="Renderer">Renderer</abbr>->render(<em>object</em>(<abbr title="Table_Cell_Frame_Decorator">Table_Cell_Frame_Decorator</abbr>)) in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\renderer.cls.php line 190" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">renderer.cls.php line 190</a></li> <li>at <abbr title="Renderer">Renderer</abbr>->render(<em>object</em>(<abbr title="Table_Row_Frame_Decorator">Table_Row_Frame_Decorator</abbr>)) in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\renderer.cls.php line 190" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">renderer.cls.php line 190</a></li> <li>at <abbr title="Renderer">Renderer</abbr>->render(<em>object</em>(<abbr title="Table_Row_Group_Frame_Decorator">Table_Row_Group_Frame_Decorator</abbr>)) in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\renderer.cls.php line 190" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">renderer.cls.php line 190</a></li> <li>at <abbr title="Renderer">Renderer</abbr>->render(<em>object</em>(<abbr title="Table_Frame_Decorator">Table_Frame_Decorator</abbr>)) in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\renderer.cls.php line 190" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">renderer.cls.php line 190</a></li> <li>at <abbr title="Renderer">Renderer</abbr>->render(<em>object</em>(<abbr title="Block_Frame_Decorator">Block_Frame_Decorator</abbr>)) in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\renderer.cls.php line 190" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">renderer.cls.php line 190</a></li> <li>at <abbr title="Renderer">Renderer</abbr>->render(<em>object</em>(<abbr title="Block_Frame_Decorator">Block_Frame_Decorator</abbr>)) in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\renderer.cls.php line 190" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">renderer.cls.php line 190</a></li> <li>at <abbr title="Renderer">Renderer</abbr>->render(<em>object</em>(<abbr title="Block_Frame_Decorator">Block_Frame_Decorator</abbr>)) in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\page_frame_reflower.cls.php line 130" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">page_frame_reflower.cls.php line 130</a></li> <li>at <abbr title="Page_Frame_Reflower">Page_Frame_Reflower</abbr>->reflow(<em>null</em>) in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\frame_decorator.cls.php line 711" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">frame_decorator.cls.php line 711</a></li> <li>at <abbr title="Frame_Decorator">Frame_Decorator</abbr>->reflow() in <a title="X:\asp\home\laravel\vendor\dompdf\dompdf\include\dompdf.cls.php line 973" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">dompdf.cls.php line 973</a></li> <li>at <abbr title="DOMPDF">DOMPDF</abbr>->render() in <a title="X:\asp\home\laravel\vendor\barryvdh\laravel-dompdf\src\PDF.php line 208" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">PDF.php line 208</a></li> <li>at <abbr title="Barryvdh\DomPDF\PDF">PDF</abbr>->render() in <a title="X:\asp\home\laravel\vendor\barryvdh\laravel-dompdf\src\PDF.php line 154" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">PDF.php line 154</a></li> <li>at <abbr title="Barryvdh\DomPDF\PDF">PDF</abbr>->output() in <a title="X:\asp\home\laravel\vendor\barryvdh\laravel-dompdf\src\PDF.php line 166" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">PDF.php line 166</a></li> <li>at <abbr title="Barryvdh\DomPDF\PDF">PDF</abbr>->save('php://output') in <a title="X:\asp\home\laravel\app\Http\Controllers\SaleController.php line 1498" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">SaleController.php line 1498</a></li> <li>at <abbr title="App\Http\Controllers\SaleController">SaleController</abbr>->getWithholdingTaxSlip()</li> <li>at <abbr title=""></abbr>call_user_func_array(<em>array</em>(<em>object</em>(<abbr title="App\Http\Controllers\SaleController">SaleController</abbr>), 'getWithholdingTaxSlip'), <em>array</em>()) in <a title="X:\asp\home\laravel\vendor\laravel\framework\src\Illuminate\Routing\Controller.php line 256" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">Controller.php line 256</a></li> <li>at <abbr title="Illuminate\Routing\Controller">Controller</abbr>->callAction('getWithholdingTaxSlip', <em>array</em>()) in <a title="X:\asp\home\laravel\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php line 164" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">ControllerDispatcher.php line 164</a></li> <li>at <abbr title="Illuminate\Routing\ControllerDispatcher">ControllerDispatcher</abbr>->call(<em>object</em>(<abbr title="App\Http\Controllers\SaleController">SaleController</abbr>), <em>object</em>(<abbr title="Illuminate\Routing\Route">Route</abbr>), 'getWithholdingTaxSlip') in <a title="X:\asp\home\laravel\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php line 112" ondblclick="var f=this.innerHTML;this.innerHTML=this.title;this.title=f;">ControllerDispatcher.php line 112</a></li> <li>at <abbr title="Illuminate\Routing\ControllerDispatcher">ControllerDispatcher</abbr>->Illuminate\Routing\{closure}(<em>object</em>(<abbr title="Illuminate\Http\Request">Request</abbr>))</li> </ol> </div>

何卒よろしくお願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

https://github.com/dompdf/dompdf/issues/68

上記を見てもらうとわかる(英語なので辛いかもしれませんが)のですが、dompdfのバグに関する議論(Frame not found in cellmapについて)がされています。
これが改善されたのかどうかまでは追っていないのですが、どうやら回避する方法はありそうです。
リンクを見てみてもらえますか・・・?

投稿2018/01/08 09:42

SuguruOhki

総合スコア96

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2018/01/08 10:55

ご回答ありがとうございます。 大きく二つの解決策が掲載されていました。 ①フォントサイズを小さくする ②border-collapseをunsetする どちらもやってみましたが、成功しませんでした・・・ 代替案はご存知でしょうか?
SuguruOhki

2018/01/12 11:18

返信遅くなりまして・・・ 代替案は申し訳ないのですが、現状わからないですね・・・
退会済みユーザー

退会済みユーザー

2018/01/13 00:58

いえ、とんでもございません。 ご回答ありがとうございました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問