如何在 laravel 5.3 中安装 dompdf?

How to install dompdf in laravel 5.3?

我已经按照这个安装了 laravel-dompdf:https://github.com/barryvdh/laravel-dompdf

但是我用那个pdf之后,laravel-dompdf很多缺点。无法显示:flex、float等

在 google 中搜索后,我找到了这个:https://github.com/dompdf/dompdf

这两个link一样吗?

dompdf 和 laravel-dompdf 一样吗?

看到第二个link(dompdf),好像更新了很多。

除了 laravel-dompdf,如何安装 dompdf?

第二个,https://github.com/dompdf/dompdf是原来的核心库,纯PHP库

第一个,https://github.com/barryvdh/laravel-dompdf is a wrapper library 在 Laravel 中使用 DomPDF。

您需要第二个,正确安装后它将自动包含并使用第一个。

DomPDF 核心库有更新的提交,但是the newest released version (at the time of this posting) is 0.8, which is the same which is used in the wrapper library for Laravel currently. The more recent commits in the DomPDF core GitHub repository have not yet been made to a new release, but it seems from the commit history您提到的功能还没有在这些更新的提交中实现。

所以 Laravel 包装器 DomPDF 使用的是香草 PHP 库 DomPDF 的最新发布版本,这很好。

DomPDF core Readme 说:

Handles most CSS 2.1 and a few CSS3 properties, including @import, @media & @page rules

(粗体 强调我的)

所以 CSS 2.1 还没有完全支持。缺少功能。我假设 flex 和 float 属于尚未支持的功能。

您必须等待它们在未来的某个版本中包含在 DomPDF 核心库中,然后 Laravel Wrapper 也会更新到该新版本。