Fonts 使用dompdf在laravel 5中生成pdf时如何处理字体
我今天开始使用。我能够很好地运行加载html的演示,但在运行加载文件的演示的过程中: 返回PDF::loadFilepublic_path.'/myfile.html'->save'/path to/my_stored_file.PDF'->stream'download.PDF' 我收到了以下错误消息 [2015-05-16 11:32:49]production.ERROR:exception'ErrorException'带有消息“file\u put\u contentsD:\xampp\htdocs\laraApps\…\storage/fonts/eb3e0c0cc4b263877903c9509310e3b3.ttf:无法打开流:在D:\xampp\htdocs\laraApps\…\vendompf\dompf\dompf\dompf\include\font\u metrics.cls.php:343中没有这样的文件或目录 堆栈跟踪: 我甚至在文件中复制了我所有的HTMLDOM,并在“loadHTML”示例中使用pased,但得到了相同的错误消息 以下是我的html文件头的外观:Fonts 使用dompdf在laravel 5中生成pdf时如何处理字体,fonts,pdf-generation,laravel-5,dompdf,Fonts,Pdf Generation,Laravel 5,Dompdf,我今天开始使用。我能够很好地运行加载html的演示,但在运行加载文件的演示的过程中: 返回PDF::loadFilepublic_path.'/myfile.html'->save'/path to/my_stored_file.PDF'->stream'download.PDF' 我收到了以下错误消息 [2015-05-16 11:32:49]production.ERROR:exception'ErrorException'带有消息“file\u put\u contentsD:\xampp
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Birth certificate template</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
<style type="text/css">
#header{ text-align: center;}
.ans{ border-bottom: dotted 2px #999; padding: 2px 0 1px 2px; margin:0 !important; width:90%; }
.ans-head{ border-bottom: dotted 2px #999; margin-left: auto; margin-right: auto; padding: 2px 0 1px 0;}
#frame{margin-left: auto; margin-right: auto;}
li{ display:block;}
div { display:block;}
</style>
</head>
我真的需要帮助。谢谢我通过将css文件的路径设置为绝对路径解决了这个问题。粘滞点:您声称使用HTML5,但实际上使用的HTML遵循HTML4.01约定。在HTML5中,只是HTML5中也没有“自动关闭”/>标记关闭。与此类似,CSS和JS的元素默认为,除非您指定一个类型属性来覆盖它。如果将它们用于正常用途,则不会添加type属性,甚至“只是为了清楚起见”。您已经使用doctypeMike强制浏览器显式解析为HTML5。非常感谢您让我注意html的版本。非常感谢。