简体   繁体   English

如何在laravel 5.3中安装dompdf?

[英]How to install dompdf in laravel 5.3?

I had install laravel-dompdf follow this : https://github.com/barryvdh/laravel-dompdf 我已经安装了laravel-dompdf,请遵循以下步骤: https//github.com/barryvdh/laravel-dompdf

But after i use that pdf, laravel-dompdf many shortcomings. 但是在我使用那个pdf之后,laravel-dompdf有很多缺点。 It can not display: flex, float etc 它不能显示:flex,float等

And after I search in google, I find this : https://github.com/dompdf/dompdf 在谷歌搜索后,我发现了这个: https : //github.com/dompdf/dompdf

Are these two links the same? 这两个链接是否相同?

Are dompdf and laravel-dompdf the same? dompdf和laravel-dompdf是否相同?

I see the second link (dompdf), it looks like it's a lot of updates. 我看到第二个链接(dompdf),它看起来像很多更新。

How do I install dompdf besides laravel-dompdf? 除了laravel-dompdf之外,我如何安装dompdf?

The second one, https://github.com/dompdf/dompdf is the original core library, a pure PHP library. 第二个https://github.com/dompdf/dompdf是原始的核心库,一个纯PHP库。

The first one, https://github.com/barryvdh/laravel-dompdf is a wrapper library for using DomPDF in Laravel. 第一个https://github.com/barryvdh/laravel-dompdf是一个包装库,用于在Laravel中使用DomPDF。

You need the second one, which will automatically include and use the first one, upon proper installation. 您需要第二个,在正确安装后,它将自动包括并使用第一个。

The DomPDF core library has more recent commits, but 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. DomPDF核心库具有更新的提交,但是最新发布的版本(在发布时)是0.8 ,与Laravel包装库中当前使用的版本相同。 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 the features you mentioned have also not been implemented in those newer commits yet. DomPDF核心 GitHub存储库中的最新提交尚未提交到新版本,但是从提交历史记录来看,您提到的功能似乎还没有在这些较新的提交中实现。

So the Laravel wrapper DomPDF is using the most current released version of the vanilla PHP library DomPDF, which is fine. 因此,Laravel包装器DomPDF使用的是香草PHP库DomPDF的最新发行版,这很好。

The DomPDF core Readme says: DomPDF核心自述文件说:

Handles most CSS 2.1 and a few CSS3 properties, including @import, @media & @page rules 处理大多数 CSS 2.1和一些 CSS3属性,包括@ import,@ media和@page规则

( bold emphasis mine) (我的大胆强调)

So not even CSS 2.1 is completely supported yet. 因此,甚至还没有完全支持CSS 2.1。 There are missing features. 有缺少的功能。 I assume flex and float are among those as of yet unsupported features. 我认为flex和float属于尚不支持的功能。

You would have to wait for them to be included in the DomPDF core library in some future version, and then, for the Laravel Wrapper to be updated as well to that new version. 您将不得不等待它们在将来的版本中包含在DomPDF核心库中,然后将Laravel包装器也更新到该新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM