dompdf支持哪些PDF元数据? [英] What PDF meta data does dompdf support?
问题描述
使用dompdf时,可以在文档信息字典中设置哪些PDF元数据?
When using dompdf what PDF meta data can be set in the document information dictionary?
最初问其他地方:
您是否可以解析更多的META信息,以便在PDF期间添加到PDF信息中
Are you able to parse more META info to be added to PDF information during PDF generation?
/ Creator(DOMPDF)
/ CreationDate(D:20150818031116-05'00')
/ ModDate(D:20150818031116-05 '00')
/Creator (DOMPDF) /CreationDate (D:20150818031116-05'00') /ModDate (D:20150818031116-05'00')
可以指定作者,版权等吗?
Can you specify Author, Copyright, etc..?
我找不到任何参考为此。只能看到您的:创建者,创建日期和修改日期!
I cannot find ANY reference to this. Only just saw your: Creator, Creation Date and Modification Date!
推荐答案
发布(0.6.1)HTML < title>
元素和一些< meta>
元素(作者,关键字) ,说明)用于设置相关的PDF元数据。
In the current stable release (0.6.1) the HTML <title>
element and some <meta>
elements (author, keywords, description) are used to set the relevant PDF meta data.
<html>
<head>
<title>Ehhhhhhh</title>
<meta name="author" content="Arthur Herbert Fonzarelli">
<meta name="keywords" content="fonzie, cool, ehhhhhhh">
</head>
<body>
<p>Ehhhhhhh</p>
</body>
</html>
此外,您还可以使用 $ dompdf将其他信息添加到PDF中-> add_info()
方法。您可以设置的受支持的元数据信息的完整列表是:标题,作者,主题,关键字,创建者,生产者,CreationDate,ModDate,陷阱。
In addition, you can add other info to the PDF using the $dompdf->add_info()
method. The full list of supported metadata info that you can set is: Title, Author, Subject, Keywords, Creator, Producer, CreationDate, ModDate, Trapped.
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->add_info('Subject', 'Cool');
这篇关于dompdf支持哪些PDF元数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!