laravel dompdf获取页面编号

时间:2015-01-30 12:07:21

标签: php css pdf laravel dompdf

我正在使用以下代码制作和下载pdf文件。

MyController.php

   $pdfTemplate = View::make('sample', $data)->render();
   $pdf = App::make('dompdf');
   $pdf->loadHTML($pdfTemplate);
   return $pdf->download('sample_file.pdf');

sample.php

<html>
<head>
</head>
<body>
here by using php i need to display div based on page number
<div>This is in page 1</div>
<div>This is in page 2</div>
</body>
</html>

有什么建议吗?

0 个答案:

没有答案