Skip to main content

Properties

bkhtmltopdf supports setting PDF metadata (e.g., author, subject) via HTML <meta> tags. These attributes are embedded in the generated PDF, making it easier for search and document management.

Attributes

AttributeExampleDescription
author<meta name="author" content="John Doe"/>Author name
subject<meta name="subject" content="Report"/>Document subject
keywords<meta name="keywords" content="PDF, HTML"/>Keywords (comma-separated)
creator<meta name="creator" content="bkhtmltopdf"/>Tool/software used
tip

These attributes only affect PDF metadata and do not impact page layout. Use English where possible for cross-platform compatibility.

Example

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hi, bkhtmltopdf!</title>
<meta name="author" content="bkhtmltopdf"/>
<meta name="subject" content="This is an example"/>
<meta name="keywords" content="bkhtmltopdf, example, pdf, html"/>
<meta name="creator" content="bkhtmltopdf"/>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>

After generating the PDF, you can check the metadata using tools like Adobe Reader ("File > Properties"): the author will be "bkhtmltopdf", the subject "This is an example", etc.