gpt4 book ai didi

php - 我正在尝试在 Laravel 中创建的 PDF 中指定字体

转载 作者:行者123 更新时间:2023-12-02 16:48:49 24 4
gpt4 key购买 nike

我正在使用 niklasravnsborg/laravel-pdf在 Laravel 中创建 PDF 文件。我想使用 Arial 字体,但该字体不起作用。

$pdf = PDF::loadView('blade', $data, [], [
'format' => 'A4-L',
'orientation' => 'L'
]);

最佳答案

我遇到了同样的问题。下面是它的确切解

$pdf = PDF::loadView('blade',$data, [], [
format' => 'A4-L',
'orientation' => 'L',
'mode' => 'c'
]);

在 blade 文件中你应该需要在顶部添加

<style type="text/css">

body {
font-family: Arial, Helvetica, sans-serif;
}
</style>

关于php - 我正在尝试在 Laravel 中创建的 PDF 中指定字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59558499/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com